Libmpo  Build #33
A WIP library to decode and encode MPO (multiple picture object) files
 All Data Structures Files Functions Variables Enumerations Enumerator
mpodatasrc.h
1 //
2 // Created by Lectem on 10/04/2015.
3 //
4 
5 #ifndef LIBMPO_MPODATASRC_H
6 #define LIBMPO_MPODATASRC_H
7 
8 #include <stdio.h>
9 #include "jpeglib.h"
10 #include "jerror.h"
11 
12 
13 typedef struct {
14  struct jpeg_source_mgr pub; /* public fields */
15 
16  FILE * infile; /* source stream */
17  JOCTET * buffer; /* start of buffer */
18  boolean start_of_file; /* have we gotten any data yet? */
19  size_t buffer_file_offset;
21 
22 typedef my_source_mgr * my_src_ptr;
23 
24 
25 GLOBAL(void)
26 my_jpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile);
27 
28 static size_t my_ftell(my_src_ptr src)
29 {
30  if(src->pub.next_input_byte)
31  {
32  return src->buffer_file_offset + (src->pub.next_input_byte - src->buffer);
33  }
34  else return src->buffer_file_offset;
35 }
36 
37 #endif //LIBMPO_MPODATASRC_H
Definition: mpodatasrc.h:13