image_lib.h 647 B

123456789101112131415161718192021222324252627282930313233
  1. // image_lib.h
  2. #ifndef IMAGE_LIB_H
  3. #define IMAGE_LIB_H
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. // 定义放大、缩小、转换格式、销毁等操作的函数指针
  8. typedef struct Image Image;
  9. // 创建图像对象并初始化函数指针
  10. Image* jpg_create(const char* file_path);
  11. Image* png_create(const char* file_path);
  12. // 销毁图像对象
  13. void image_destroy(Image* img);
  14. // 放大图像
  15. int image_zoom_in(Image* img, double scale);
  16. // 缩小图像
  17. int image_zoom_out(Image* img, double scale);
  18. // 转换图像格式
  19. int image_convert_format(Image* img, const char* new_format);
  20. #ifdef __cplusplus
  21. }
  22. #endif
  23. #endif // IMAGE_LIB_H