API: moved functions to files to make it easier to import to other projects

This commit is contained in:
Andrew Haynes
2026-03-22 17:24:40 -04:00
parent 05a15d38af
commit 64cf77bbe3
11 changed files with 678 additions and 572 deletions
+10 -11
View File
@@ -4,22 +4,21 @@ set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include_directories(include)
project(image_processor LANGUAGES C)
# find_package(JPEG REQUIRED)
#
# add_executable(image_processor src/main.c)
#
# target_include_directories(image_processor PRIVATE ${JPEG_INCLUDE_DIRS})
#
# target_link_libraries(image_processor PRIVATE ${JPEG_LIBRARIES})
set(SOURCES
src/main.c
src/transformations.c
src/utils.c
src/filters.c
src/imgio.c
)
find_library(TURBOJPEG_LIB NAMES turbojpeg REQUIRED)
find_path(TURBOJPEG_INCLUDE NAMES turbojpeg.h REQUIRED)
add_executable(image_processor src/main.c)
add_executable(image_processor ${SOURCES})
# 2. Include the directories for the header files
target_include_directories(image_processor PRIVATE ${TURBOJPEG_INCLUDE})
# 3. Link the actual turbojpeg library
target_link_libraries(image_processor PRIVATE ${TURBOJPEG_LIB})