Allowing install
This commit is contained in:
parent
fc64a2844e
commit
dc64b6be74
|
@ -16,4 +16,6 @@ else()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_subdirectory(caesium)
|
add_subdirectory(caesium)
|
||||||
add_subdirectory(demo)
|
add_subdirectory(demo)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,3 +14,8 @@ target_link_libraries(caesium zopflipng jpeg turbojpeg)
|
||||||
# Make sure the compiler can find include files for our Caesium library
|
# Make sure the compiler can find include files for our Caesium library
|
||||||
# when other libraries or executables link to Caesium
|
# when other libraries or executables link to Caesium
|
||||||
target_include_directories(caesium PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
target_include_directories(caesium PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
|
install(FILES caesium.h DESTINATION include)
|
||||||
|
install(TARGETS caesium caesium_static
|
||||||
|
LIBRARY DESTINATION lib
|
||||||
|
ARCHIVE DESTINATION lib)
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "cstypes.h"
|
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "caesium.h"
|
|
||||||
#include "png.h"
|
#include "png.h"
|
||||||
#include "jpeg.h"
|
#include "jpeg.h"
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,52 @@
|
||||||
#define LIBCAESIUM_CAESIUM_H
|
#define LIBCAESIUM_CAESIUM_H
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <turbojpeg.h>
|
||||||
|
|
||||||
|
typedef struct cs_jpeg_pars
|
||||||
|
{
|
||||||
|
int quality;
|
||||||
|
bool exif_copy;
|
||||||
|
int dct_method;
|
||||||
|
/*
|
||||||
|
* Parameters you have no reason to set as they will be
|
||||||
|
* overwritten during the process
|
||||||
|
*/
|
||||||
|
int color_space;
|
||||||
|
enum TJSAMP subsample;
|
||||||
|
int width;
|
||||||
|
int height;
|
||||||
|
} cs_jpeg_pars;
|
||||||
|
|
||||||
|
typedef struct cs_png_pars
|
||||||
|
{
|
||||||
|
int iterations;
|
||||||
|
int iterations_large;
|
||||||
|
int block_split_strategy;
|
||||||
|
bool lossy_8;
|
||||||
|
bool transparent;
|
||||||
|
int auto_filter_strategy;
|
||||||
|
} cs_png_pars;
|
||||||
|
|
||||||
|
typedef struct cs_image_pars
|
||||||
|
{
|
||||||
|
cs_jpeg_pars jpeg;
|
||||||
|
cs_png_pars png;
|
||||||
|
} cs_image_pars;
|
||||||
|
|
||||||
|
typedef enum image_type
|
||||||
|
{
|
||||||
|
JPEG,
|
||||||
|
PNG,
|
||||||
|
UNKN,
|
||||||
|
} image_type;
|
||||||
|
|
||||||
|
typedef enum error_level
|
||||||
|
{
|
||||||
|
ERROR = 0,
|
||||||
|
WARNING = 1
|
||||||
|
} error_level;
|
||||||
|
|
||||||
#include "cstypes.h"
|
|
||||||
|
|
||||||
bool cs_compress(const char *input, const char *output, cs_image_pars *options);
|
bool cs_compress(const char *input, const char *output, cs_image_pars *options);
|
||||||
|
|
||||||
|
|
|
@ -1,51 +0,0 @@
|
||||||
#ifndef LIBCAESIUM_CSTYPES_H
|
|
||||||
#define LIBCAESIUM_CSTYPES_H
|
|
||||||
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include <turbojpeg.h>
|
|
||||||
|
|
||||||
typedef struct cs_jpeg_pars
|
|
||||||
{
|
|
||||||
int quality;
|
|
||||||
bool exif_copy;
|
|
||||||
int dct_method;
|
|
||||||
/*
|
|
||||||
* Parameters you have no reason to set as they will be
|
|
||||||
* overwritten during the process
|
|
||||||
*/
|
|
||||||
int color_space;
|
|
||||||
enum TJSAMP subsample;
|
|
||||||
int width;
|
|
||||||
int height;
|
|
||||||
} cs_jpeg_pars;
|
|
||||||
|
|
||||||
typedef struct cs_png_pars
|
|
||||||
{
|
|
||||||
int iterations;
|
|
||||||
int iterations_large;
|
|
||||||
int block_split_strategy;
|
|
||||||
bool lossy_8;
|
|
||||||
bool transparent;
|
|
||||||
int auto_filter_strategy;
|
|
||||||
} cs_png_pars;
|
|
||||||
|
|
||||||
typedef struct cs_image_pars
|
|
||||||
{
|
|
||||||
cs_jpeg_pars jpeg;
|
|
||||||
cs_png_pars png;
|
|
||||||
} cs_image_pars;
|
|
||||||
|
|
||||||
typedef enum image_type
|
|
||||||
{
|
|
||||||
JPEG,
|
|
||||||
PNG,
|
|
||||||
UNKN,
|
|
||||||
} image_type;
|
|
||||||
|
|
||||||
typedef enum error_level
|
|
||||||
{
|
|
||||||
ERROR = 0,
|
|
||||||
WARNING = 1
|
|
||||||
} error_level;
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef LIBCAESIUM_ERROR_H
|
#ifndef LIBCAESIUM_ERROR_H
|
||||||
#define LIBCAESIUM_ERROR_H
|
#define LIBCAESIUM_ERROR_H
|
||||||
|
|
||||||
#include "cstypes.h"
|
#include "caesium.h"
|
||||||
|
|
||||||
void display_error(error_level level, int code);
|
void display_error(error_level level, int code);
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include <jpeglib.h>
|
#include <jpeglib.h>
|
||||||
|
|
||||||
#include "cstypes.h"
|
#include "caesium.h"
|
||||||
|
|
||||||
int cs_jpeg_optimize(const char *input_file, const char *output_file, bool exif, const char *exif_src);
|
int cs_jpeg_optimize(const char *input_file, const char *output_file, bool exif, const char *exif_src);
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#ifndef LIBCAESIUM_PNG_H
|
#ifndef LIBCAESIUM_PNG_H
|
||||||
#define LIBCAESIUM_PNG_H
|
#define LIBCAESIUM_PNG_H
|
||||||
|
|
||||||
#include "cstypes.h"
|
#include "caesium.h"
|
||||||
|
|
||||||
bool cs_png_optimize(const char *input, const char *output, cs_png_pars *options);
|
bool cs_png_optimize(const char *input, const char *output, cs_png_pars *options);
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "cstypes.h"
|
#include "caesium.h"
|
||||||
|
|
||||||
image_type detect_image_type(FILE *pFile);
|
image_type detect_image_type(FILE *pFile);
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
add_executable(caesiumd main.c helper.c)
|
add_executable(caesiumd main.c helper.c)
|
||||||
|
|
||||||
target_link_libraries(caesiumd LINK_PUBLIC caesium)
|
target_link_libraries(caesiumd LINK_PUBLIC caesium)
|
||||||
|
|
||||||
|
install(TARGETS caesiumd DESTINATION bin)
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef LIBCAESIUM_HELPER_H
|
#ifndef LIBCAESIUM_HELPER_H
|
||||||
#define LIBCAESIUM_HELPER_H
|
#define LIBCAESIUM_HELPER_H
|
||||||
|
|
||||||
#include "cstypes.h"
|
#include "caesium.h"
|
||||||
|
|
||||||
void initialize_jpeg_parameters(cs_image_pars *options);
|
void initialize_jpeg_parameters(cs_image_pars *options);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue