File tree Expand file tree Collapse file tree 3 files changed +287
-13
lines changed
Expand file tree Collapse file tree 3 files changed +287
-13
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,11 @@ add_executable(pixcii ${SOURCES})
2121# Link libraries
2222target_link_libraries (pixcii ${OpenCV_LIBS} )
2323
24+ # Link filesystem library for C++17
25+ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.0" )
26+ target_link_libraries (pixcii stdc++fs)
27+ endif ()
28+
2429# Compiler-specific options
2530if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
2631 target_compile_options (pixcii PRIVATE
Original file line number Diff line number Diff line change 1- // Define the implementations for the stb image libraries in this file
21#define STB_IMAGE_IMPLEMENTATION
32#define STB_IMAGE_WRITE_IMPLEMENTATION
43#define STB_IMAGE_RESIZE2_IMPLEMENTATION
@@ -159,8 +158,7 @@ std::vector<uint8_t> rgbToGrayscale(const Image &img)
159158 grayscale[static_cast <size_t >(y * img.width + x)] = static_cast <uint8_t >( // Use size_t for index calculation
160159 constants::GRAYSCALE_WEIGHT_R * r +
161160 constants::GRAYSCALE_WEIGHT_G * g +
162- constants::GRAYSCALE_WEIGHT_B * b
163- );
161+ constants::GRAYSCALE_WEIGHT_B * b);
164162 }
165163 }
166164
You can’t perform that action at this time.
0 commit comments