Move image lib to utils.cpp
This commit is contained in:
parent
095b14d3a9
commit
a8cfc6a26b
@ -18,3 +18,8 @@ target_include_directories(seam-carving
|
|||||||
${PROJECT_SOURCE_DIR}/deps
|
${PROJECT_SOURCE_DIR}/deps
|
||||||
)
|
)
|
||||||
target_link_libraries(seam-carving utils)
|
target_link_libraries(seam-carving utils)
|
||||||
|
|
||||||
|
target_include_directories(utils
|
||||||
|
PRIVATE
|
||||||
|
${PROJECT_SOURCE_DIR}/deps
|
||||||
|
)
|
19
src/image.h
Normal file
19
src/image.h
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#ifndef STBIDEF
|
||||||
|
#ifdef STB_IMAGE_WRITE_STATIC
|
||||||
|
#define STBIDEF static
|
||||||
|
#else
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#define STBIDEF extern "C"
|
||||||
|
#else
|
||||||
|
#define STBIDEF extern
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef unsigned char stbi_uc;
|
||||||
|
|
||||||
|
STBIDEF int stbi_write_png(char const *filename, int w, int h, int comp, const void *data, int stride_in_bytes);
|
||||||
|
|
||||||
|
STBIDEF stbi_uc *stbi_load(char const *filename, int *x, int *y, int *comp, int req_comp);
|
||||||
|
|
||||||
|
STBIDEF void stbi_image_free (void *retval_from_stbi_load);
|
@ -1,4 +1,5 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <cassert>
|
||||||
#include <random>
|
#include <random>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -6,12 +7,9 @@
|
|||||||
#include <CLI11.hpp>
|
#include <CLI11.hpp>
|
||||||
|
|
||||||
// Image filtering and I/O
|
// Image filtering and I/O
|
||||||
#define STB_IMAGE_IMPLEMENTATION
|
|
||||||
#include <stb_image.h>
|
|
||||||
#define STB_IMAGE_WRITE_IMPLEMENTATION
|
|
||||||
#include <SimpleProgressBar.hpp>
|
#include <SimpleProgressBar.hpp>
|
||||||
#include <stb_image_write.h>
|
|
||||||
#include "utils.hpp"
|
#include "utils.hpp"
|
||||||
|
#include "image.h"
|
||||||
|
|
||||||
#define DEFAULT_SEAMS 1
|
#define DEFAULT_SEAMS 1
|
||||||
|
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
#define STB_IMAGE_IMPLEMENTATION
|
||||||
|
#include <stb_image.h>
|
||||||
|
#define STB_IMAGE_WRITE_IMPLEMENTATION
|
||||||
|
#include <stb_image_write.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <random>
|
#include <random>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user