26 #include <boost/checked_delete.hpp> 28 #include <libopenraw/consts.h> 29 #include <libopenraw/thumbnails.h> 30 #include <libopenraw/types.h> 32 #include "rawfile.hpp" 48 #define CHECK_PTR(p, r) \ 53 const char **or_get_file_extensions()
58 ORRawFileRef or_rawfile_new(
const char *filename, or_rawfile_type type)
60 CHECK_PTR(filename, NULL);
62 return reinterpret_cast<ORRawFileRef
>(rawfile);
65 ORRawFileRef or_rawfile_new_from_memory(
const uint8_t *buffer, uint32_t len,
68 CHECK_PTR(buffer, NULL);
70 return reinterpret_cast<ORRawFileRef
>(rawfile);
73 or_error or_rawfile_release(ORRawFileRef rawfile)
75 CHECK_PTR(rawfile, OR_ERROR_NOTAREF);
76 boost::checked_delete(reinterpret_cast<RawFile *>(rawfile));
80 or_rawfile_type or_rawfile_get_type(ORRawFileRef rawfile)
82 CHECK_PTR(rawfile, OR_RAWFILE_TYPE_UNKNOWN);
84 return prawfile->
type();
87 or_rawfile_typeid or_rawfile_get_typeid(ORRawFileRef rawfile)
89 CHECK_PTR(rawfile, OR_RAWFILE_TYPE_UNKNOWN);
95 or_rawfile_get_thumbnail_sizes(ORRawFileRef rawfile,
98 CHECK_PTR(rawfile,
nullptr);
99 CHECK_PTR(size,
nullptr);
109 return &(*v.begin());
112 or_error or_rawfile_get_thumbnail(ORRawFileRef rawfile,
113 uint32_t _preferred_size,
114 ORThumbnailRef thumb)
116 CHECK_PTR(rawfile, OR_ERROR_NOTAREF);
119 *reinterpret_cast<Thumbnail *>(thumb));
122 or_error or_rawfile_get_rawdata(ORRawFileRef rawfile, ORRawDataRef rawdata,
126 CHECK_PTR(rawfile, OR_ERROR_NOTAREF);
127 return prawfile->
getRawData(*reinterpret_cast<RawData *>(rawdata), options);
130 or_error or_rawfile_get_rendered_image(ORRawFileRef rawfile,
131 ORBitmapDataRef bitmapdata,
135 CHECK_PTR(rawfile, OR_ERROR_NOTAREF);
137 *reinterpret_cast<BitmapData *>(bitmapdata), options);
140 int32_t or_rawfile_get_orientation(ORRawFileRef rawfile)
143 CHECK_PTR(rawfile, 0);
147 or_error or_rawfile_get_colourmatrix1(ORRawFileRef rawfile,
double *matrix,
151 CHECK_PTR(rawfile, OR_ERROR_NOTAREF);
152 CHECK_PTR(size, OR_ERROR_INVALID_PARAM);
156 or_error or_rawfile_get_colourmatrix2(ORRawFileRef rawfile,
double *matrix,
160 CHECK_PTR(rawfile, OR_ERROR_NOTAREF);
161 CHECK_PTR(size, OR_ERROR_INVALID_PARAM);
162 return prawfile->getColourMatrix2(matrix, *size);
165 ExifLightsourceValue or_rawfile_get_calibration_illuminant1(ORRawFileRef rawfile)
168 CHECK_PTR(rawfile, (ExifLightsourceValue)0);
172 ExifLightsourceValue or_rawfile_get_calibration_illuminant2(ORRawFileRef rawfile)
175 CHECK_PTR(rawfile, (ExifLightsourceValue)0);
176 return prawfile->getCalibrationIlluminant2();
180 or_rawfile_get_metavalue(ORRawFileRef rawfile, int32_t meta_index)
183 CHECK_PTR(rawfile,
nullptr);
184 return reinterpret_cast<ORConstMetaValueRef
>(prawfile->getMetaValue(meta_index));
CIFF is the container for CRW files. It is an attempt from Canon to make this a standard. I guess it failed.
::or_error getThumbnail(uint32_t size, Thumbnail &thumbnail)
::or_error getRawData(RawData &rawdata, uint32_t options)
::or_error getRenderedImage(BitmapData &bitmapdata, uint32_t options)
ExifLightsourceValue getCalibrationIlluminant1()
static RawFile * newRawFileFromMemory(const uint8_t *buffer, uint32_t len, Type _typeHint=OR_RAWFILE_TYPE_UNKNOWN)
static const char ** fileExtensions()
::or_error getColourMatrix1(double *matrix, uint32_t &size)
const std::vector< uint32_t > & listThumbnailSizes(void)
static RawFile * newRawFile(const char *_filename, Type _typeHint=OR_RAWFILE_TYPE_UNKNOWN)