123456789101112131415161718192021222324252627282930313233 |
- // image_lib.h
- #ifndef IMAGE_LIB_H
- #define IMAGE_LIB_H
- #ifdef __cplusplus
- extern "C" {
- #endif
- // 定义放大、缩小、转换格式、销毁等操作的函数指针
- typedef struct Image Image;
- // 创建图像对象并初始化函数指针
- Image* jpg_create(const char* file_path);
- Image* png_create(const char* file_path);
- // 销毁图像对象
- void image_destroy(Image* img);
- // 放大图像
- int image_zoom_in(Image* img, double scale);
- // 缩小图像
- int image_zoom_out(Image* img, double scale);
- // 转换图像格式
- int image_convert_format(Image* img, const char* new_format);
- #ifdef __cplusplus
- }
- #endif
- #endif // IMAGE_LIB_H
|