libgphoto2 photo camera library (libgphoto2) API  2.5.10.1
jpeg.h
Go to the documentation of this file.
1 
24 #ifndef __GPHOTO2_JPEG_H__
25 #define __GPHOTO2_JPEG_H__
26 
27 #include <gphoto2/gphoto2-file.h>
28 
29 typedef enum {
30  JPEG_START=0xD8, JPEG_COMMENT=0xFE, JPEG_APPO=0xE0,
31  JPEG_QUANTIZATION=0xDB, JPEG_HUFFMAN=0xC4, JPEG_SOFC0=0xC0,
32  JPEG_SSSEAHAL=0xDA, JPEG_EOI=0xD9
33 } jpegmarker;
34 
35 typedef struct chunk{
36  int size;
37  unsigned char *data;
38 } chunk;
39 
40 typedef char jpeg_quantization_table[64];
41 
42 typedef struct jpeg {
43  int count;
44  struct chunk *marker[20]; /* I think this should be big enough */
45 }jpeg;
46 
47 chunk *gpi_jpeg_chunk_new(int length);
48 chunk *gpi_jpeg_chunk_new_filled(int length, char *data);
49 void gpi_jpeg_chunk_destroy(chunk *mychunk);
50 void gpi_jpeg_chunk_print(chunk *mychunk);
51 
52 char gpi_jpeg_findff(int *location, chunk *picture);
53 char gpi_jpeg_findactivemarker(char *id, int *location, chunk *picture);
54 char *gpi_jpeg_markername(unsigned int c);
55 
56 jpeg *gpi_jpeg_new (void);
57 void gpi_jpeg_destroy (jpeg *myjpeg);
58 void gpi_jpeg_add_marker (jpeg *myjpeg, chunk *picture, int start, int end);
59 void gpi_jpeg_add_chunk (jpeg *myjpeg, chunk *source);
60 void gpi_jpeg_parse (jpeg *myjpeg, chunk *picture);
61 void gpi_jpeg_print (jpeg *myjpeg);
62 
63 chunk *gpi_jpeg_make_start (void);
64 chunk *gpi_jpeg_make_SOFC (int width, int height,
65  char vh1, char vh2, char vh3,
66  char q1, char q2, char q3);
67 chunk *gpi_jpeg_makeSsSeAhAl (int huffset1, int huffset2, int huffset3);
68 
69 void gpi_jpeg_print_quantization_table(jpeg_quantization_table *table);
70 chunk *gpi_jpeg_make_quantization(const jpeg_quantization_table * table, char number);
71 jpeg_quantization_table *gpi_jpeg_quantization2table(chunk *qmarker);
72 
73 jpeg *gpi_jpeg_header(int width, int height,
74  char vh1, char vh2, char vh3,
75  char q1, char q2, char q3,
76  const jpeg_quantization_table *quant1, const jpeg_quantization_table *quant2,
77  char huffset1, char huffset2, char huffset3,
78  chunk *huff1, chunk *huff2, chunk *huff3, chunk *huff4);
79 
80 char gpi_jpeg_write(CameraFile *file, const char *name, jpeg *myjpeg);
81 #endif
Definition: jpeg.h:42
Definition: jpeg.h:35
File structure.
Abstracted gphoto2 file operations.