diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f613918c..4189a60de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -459,6 +459,29 @@ target_link_libraries(ncsixel-static PUBLIC notcurses-static ) +file(GLOB SIXELANALYZERSRC CONFIGURE DEPENDS src/sixelanalyzer/*.c) +add_executable(sixelanalyzer ${SIXELANALYZERSRC}) +target_compile_definitions(sixelanalyzer + PRIVATE + _GNU_SOURCE +) +target_include_directories(sixelanalyzer + BEFORE + PRIVATE + include + src + "${TERMINFO_INCLUDE_DIRS}" + "${CMAKE_REQUIRED_INCLUDES}" + "${PROJECT_BINARY_DIR}/include" +) +target_link_libraries(sixelanalyzer + PRIVATE + ncsixel + ${LIBM} + ${LIBRT} + Threads::Threads +) + ############################################################################ if(${USE_CXX}) # libnotcurses++ (C++ wrappers) @@ -1059,6 +1082,7 @@ if(BUILD_EXECUTABLES) install(TARGETS notcurses-demo DESTINATION bin) install(TARGETS notcurses-info DESTINATION bin) install(TARGETS ncneofetch DESTINATION bin) +install(TARGETS sixelanalyzer DESTINATION bin) if(NOT WIN32) install(TARGETS tfman DESTINATION bin) endif() diff --git a/include/notcurses/libsixel.h b/include/notcurses/libsixel.h new file mode 100644 index 000000000..b95929d16 --- /dev/null +++ b/include/notcurses/libsixel.h @@ -0,0 +1,25 @@ +#ifndef NOTCURSES_LIBSIXEL +#define NOTCURSES_LIBSIXEL + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +struct sixel; +struct sixelctx; + +struct sixelctx* libncsixel_init(void); + +struct sixel* libncsixel_encode(struct sixelctx* sctx, const char* file, unsigned colorregs); + +uint32_t* libncsixel_explode(const struct sixel* s); + +void libncsixel_stop(struct sixelctx* sctx); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/sixelanalyzer/main.c b/src/sixelanalyzer/main.c new file mode 100644 index 000000000..6b45bf900 --- /dev/null +++ b/src/sixelanalyzer/main.c @@ -0,0 +1,6 @@ +#include +#include + +int main(void){ + return EXIT_SUCCESS; +}