1 /*
2  * imagesource_jpeg.h
3  * 24-bit RGB and 8-bit Greyscale JPEG scanline-based Loader
4  * Doesn't support Random Access
5  *
6  * Copyright (c) 2004 by Alastair M. Robinson
7  * Distributed under the terms of the GNU General Public License -
8  * see the file named "COPYING" for more details.
9  *
10  */
11 
12 #ifndef IMAGESOURCE_JPEG_H
13 #define IMAGESOURCE_JPEG_H
14 
15 #include "imagesource.h"
16 #include <cstdio>
17 
18 using namespace std;
19 
20 class ImageSource_JPEG : public ImageSource
21 {
22 	public:
23 	ImageSource_JPEG(const char *filename);
24 	ImageSource_JPEG(FILE *file);	// Use this variant if you want to provide an open file handle
25 	~ImageSource_JPEG();
26 	ISDataType *GetRow(int row);
27 	private:
28 	void Init();
29 	FILE *file;
30 	struct jpeg_decompress_struct *cinfo;
31 	unsigned char *tmprow;
32 	struct ImageSource_JPEG_ErrManager *err;
33 	char *iccprofbuffer;
34 	bool started;
35 };
36 
37 #endif
38