jpeg.h

Go to the documentation of this file.
00001 
00024 #ifndef __GPHOTO2_JPEG_H__
00025 #define __GPHOTO2_JPEG_H__
00026 
00027 #include <gphoto2/gphoto2-file.h>
00028 
00029 typedef enum {
00030     JPEG_START=0xD8,        JPEG_COMMENT=0xFE,      JPEG_APPO=0xE0,
00031     JPEG_QUANTIZATION=0xDB, JPEG_HUFFMAN=0xC4,      JPEG_SOFC0=0xC0,
00032     JPEG_SSSEAHAL=0xDA,     JPEG_EOI=0xD9
00033 } jpegmarker;
00034 
00035 typedef struct chunk{
00036     int size;
00037     unsigned char *data;
00038 } chunk;
00039 
00040 typedef char jpeg_quantization_table[64];
00041 
00042 typedef struct jpeg {
00043     int count;
00044     struct chunk *marker[20]; /* I think this should be big enough */
00045 }jpeg;
00046 
00047 chunk *gpi_jpeg_chunk_new(int length);
00048 chunk *gpi_jpeg_chunk_new_filled(int length, char *data);
00049 void gpi_jpeg_chunk_destroy(chunk *mychunk);
00050 void gpi_jpeg_chunk_print(chunk *mychunk);
00051 
00052 char  gpi_jpeg_findff(int *location, chunk *picture);
00053 char  gpi_jpeg_findactivemarker(char *id, int *location, chunk *picture);
00054 char *gpi_jpeg_markername(int c);
00055 
00056 jpeg *gpi_jpeg_new        (void);
00057 void  gpi_jpeg_destroy    (jpeg *myjpeg);
00058 void  gpi_jpeg_add_marker (jpeg *myjpeg, chunk *picture, int start, int end);
00059 void  gpi_jpeg_add_chunk  (jpeg *myjpeg, chunk *source);
00060 void  gpi_jpeg_parse      (jpeg *myjpeg, chunk *picture);
00061 void  gpi_jpeg_print      (jpeg *myjpeg);
00062 
00063 chunk *gpi_jpeg_make_start   (void);
00064 chunk *gpi_jpeg_make_SOFC    (int width, int height,
00065                              char vh1, char vh2, char vh3,
00066                              char q1, char q2, char q3);
00067 chunk *gpi_jpeg_makeSsSeAhAl (int huffset1, int huffset2, int huffset3);
00068 
00069 void gpi_jpeg_print_quantization_table(jpeg_quantization_table *table);
00070 chunk *gpi_jpeg_make_quantization(jpeg_quantization_table *table, char number);
00071 jpeg_quantization_table *gpi_jpeg_quantization2table(chunk *qmarker);
00072 
00073 jpeg *gpi_jpeg_header(int width, int height,
00074     char vh1, char vh2, char vh3,
00075     char q1, char q2, char q3,
00076     jpeg_quantization_table *quant1, jpeg_quantization_table *quant2,
00077     char huffset1, char huffset2, char huffset3,
00078     chunk *huff1, chunk *huff2, chunk *huff3, chunk *huff4);
00079 
00080 char gpi_jpeg_write(CameraFile *file, const char *name, jpeg *myjpeg);
00081 #endif

Generated on Sun Jul 22 19:29:31 2007 for libgphoto2 photo camera library (libgphoto2) by  doxygen 1.5.0