00001
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef _GAN_IMAGE_JPEG_IO_H
00032 #define _GAN_IMAGE_JPEG_IO_H
00033
00034 #include <stdio.h>
00035 #include <gandalf/common/misc_defs.h>
00036 #include <gandalf/image/image_defs.h>
00037
00038 #ifdef __cplusplus
00039 extern "C" {
00040 #endif
00041
00052
00053 #ifdef HAVE_JPEG
00054
00058 typedef struct Gan_JPEGHeaderStruct
00059 {
00061 int quality;
00062 } Gan_JPEGHeaderStruct;
00063
00064
00065 struct Gan_ImageReadControlStruct;
00066 struct Gan_ImageHeaderStruct;
00067 struct Gan_ImageWriteControlStruct;
00068
00069
00070 Gan_Bool gan_image_is_jpeg(const unsigned char *magic_string, size_t length);
00071 Gan_Image* gan_read_jpeg_image_stream(FILE *infile, Gan_Image *image,
00072 const struct Gan_ImageReadControlStruct *ictrlstr, struct Gan_ImageHeaderStruct *header);
00073 Gan_Image* gan_read_jpeg_image(const char *filename, Gan_Image *image,
00074 const struct Gan_ImageReadControlStruct *ictrlstr, struct Gan_ImageHeaderStruct *header);
00075 void gan_initialise_jpeg_header_struct(Gan_JPEGHeaderStruct *octrlstr);
00076 Gan_Bool gan_write_jpeg_image_stream(FILE *outfile, const Gan_Image *image, Gan_Bool new_file, const struct Gan_ImageWriteControlStruct *octrlstr);
00077 Gan_Bool gan_write_jpeg_image(const char *filename, const Gan_Image *image, const struct Gan_ImageWriteControlStruct *octrlstr);
00078
00079 #endif
00080
00089 #ifdef __cplusplus
00090 }
00091 #endif
00092
00093 #endif