Image Processing C Library
Core Library : main.cpp
- PNG processing with 8x8 block-based algorithms
Test Directories : testA/
, testB/
with specific comment conventions
Missing Dependencies : function.h
referenced but not present, STB headers external
Load PNG → uint8_t frame[3][128][128]
(RGB channels)
Process in 8x8 blocks via raster scan (top-left to bottom-right)
Apply per-block algorithms (e.g., brightness +40 with overflow clipping)
Save processed frame back to PNG
Critical Functions Pattern
// Standard return pattern: 1=success, 0=failure
int read_png (const char * src_path , uint8_t frame [3 ][128 ][128 ]);
int write_png (uint8_t frame [3 ][128 ][128 ], const char * dst_path );
// Block processing with boundary checking
void read_frame (uint8_t channel_frame [128 ][128 ], int start_y , int start_x , uint8_t block [8 ][8 ]);
Use stbi_image_free()
for STB-allocated data
Use standard free()
for manual allocations
Always NULL-check malloc results and implement safe cleanup (see free_png()
)
No build system present - compile directly with C compiler
Requires STB single-header libraries: stb_image.h
, stb_image_write.h
Standard C libraries only, no external linking