refinery
RAW file processor
|
Returns Image instances based on stream input and Exif data. More...
#include <refinery/unpack.h>
Public Member Functions | |
GrayImage * | readGrayImage (std::streambuf &istream, const ExifData &exifData) |
Reads and returns a GrayImage. | |
GrayImage * | readGrayImage (FILE *istream, const ExifData &exifData) |
Reads and returns a GrayImage. | |
RGBImage * | readRgbImage (std::streambuf &istream, const ExifData &exifData) |
Reads and returns an RGBImage. | |
RGBImage * | readRgbImage (FILE *istream, const ExifData &exifData) |
Reads and returns an RGBImage. |
Returns Image instances based on stream input and Exif data.
When reading is done, the stream will be seeked one byte past the last byte in the image.
You must know ahead of time whether the input image is grayscale or RGB. This can be calculated using Exif data. Most modern cameras use Bayer filter arrays over monochrome sensors and so they are grayscale, not RGB.
Here's what you can do to create a GrayImage:
std::filebuf file; file.open("image.NEF", std::ios::in); refinery::DcrawExifData exifData(file); refinery::ImageReader reader; std::auto_ptr<GrayImage*> grayImage( reader.readGrayImage(file, exifData));
GrayImage* refinery::ImageReader::readGrayImage | ( | std::streambuf & | istream, |
const ExifData & | exifData | ||
) |
Reads and returns a GrayImage.
[in] | istream | Input streambuf, such as an std::filebuf. |
[in] | exifData | Image Exif data. |
Reads and returns a GrayImage.
This doesn't use C++ streams, so it's suitable for language bindings.
[in] | istream | Input file pointer. |
[in] | exifData | Image Exif data. |
RGBImage* refinery::ImageReader::readRgbImage | ( | std::streambuf & | istream, |
const ExifData & | exifData | ||
) |
Reads and returns an RGBImage.
Aside from reading RAW files, this can read 8-bit or 16-bit PPM files.
[in] | istream | Input streambuf, such as an std::filebuf. |
[in] | exifData | Image Exif data. |
Reads and returns an RGBImage.
Aside from reading RAW files, this can read 8-bit or 16-bit PPM files.
This doesn't use C++ streams, so it's suitable for language bindings.
[in] | istream | Input file pointer. |
[in] | exifData | Image Exif data. |