Skip to content

Commit 058cb79

Browse files
committed
feat: url as input support
1 parent f7aa745 commit 058cb79

File tree

3 files changed

+287
-13
lines changed

3 files changed

+287
-13
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ add_executable(pixcii ${SOURCES})
2121
# Link libraries
2222
target_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
2530
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
2631
target_compile_options(pixcii PRIVATE

src/image.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
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

0 commit comments

Comments
 (0)