Fawkes API Fawkes Development Version
jpeg.h
1
2/***************************************************************************
3 * jpeg.h - JPEG Reader
4 *
5 * Generated: Sun Jun 04 23:18:06 2006 (watching Terminator 2)
6 * Copyright 2005-2007 Tim Niemueller [www.niemueller.de]
7 *
8 ****************************************************************************/
9
10/* This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version. A runtime exception applies to
14 * this software (see LICENSE.GPL_WRE file mentioned below for details).
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Library General Public License for more details.
20 *
21 * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22 */
23
24#ifndef _FIREVISION_UTILS_READERS_JPEG_H_
25#define _FIREVISION_UTILS_READERS_JPEG_H_
26
27#include <fvutils/readers/reader.h>
28
29#include <cstdio>
30extern "C" {
31#include <jpeglib.h>
32}
33
34namespace firevision {
35
36class JpegReader : public Reader
37{
38public:
39 JpegReader(const char *filename);
40 virtual ~JpegReader();
41
42 virtual void set_buffer(unsigned char *yuv422planar_buffer);
43 virtual colorspace_t colorspace();
44 virtual unsigned int pixel_width();
45 virtual unsigned int pixel_height();
46 virtual void read();
47
48private:
49 bool opened;
50
51 unsigned char *buffer;
52 unsigned char *row_buffer;
53
54 FILE * infile;
55 int row_stride;
56 struct jpeg_decompress_struct cinfo;
57 struct jpeg_error_mgr jerr;
58};
59
60} // end namespace firevision
61
62#endif
JPEG file reader.
Definition: jpeg.h:37
virtual unsigned int pixel_width()
Get width of read image in pixels.
Definition: jpeg.cpp:89
JpegReader(const char *filename)
Constructor.
Definition: jpeg.cpp:43
virtual ~JpegReader()
Destructor.
Definition: jpeg.cpp:69
virtual colorspace_t colorspace()
Get colorspace from the just read image.
Definition: jpeg.cpp:83
virtual unsigned int pixel_height()
Get height of read image in pixels.
Definition: jpeg.cpp:99
virtual void read()
Read data from file.
Definition: jpeg.cpp:109
virtual void set_buffer(unsigned char *yuv422planar_buffer)
Set buffer that the read image should be written to.
Definition: jpeg.cpp:77
Image reader interface.
Definition: reader.h:32