27 #include <boost/checked_delete.hpp>
29 #include <libopenraw/consts.h>
30 #include <libopenraw/thumbnails.h>
31 #include <libopenraw/types.h>
34 #include "rawfile.hpp"
52 #define CHECK_PTR(p, r) \
60 return RawFile::fileExtensions();
66 CHECK_PTR(filename, NULL);
67 RawFile *rawfile = RawFile::newRawFile(filename, type);
75 CHECK_PTR(buffer, NULL);
76 RawFile *rawfile = RawFile::newRawFileFromMemory(buffer, len, type);
84 boost::checked_delete(
reinterpret_cast<RawFile *
>(rawfile));
93 return prawfile->
type();
101 return prawfile->
typeId();
109 return prawfile->vendorId();
112 API_EXPORT
const uint32_t *
116 CHECK_PTR(rawfile,
nullptr);
117 CHECK_PTR(size,
nullptr);
127 return &(*v.begin());
132 uint32_t _preferred_size,
158 *
reinterpret_cast<BitmapData *
>(bitmapdata), options);
165 CHECK_PTR(rawfile, 0);
186 return prawfile->getColourMatrix2(matrix, *size);
193 CHECK_PTR(rawfile, (ExifLightsourceValue)0);
201 CHECK_PTR(rawfile, (ExifLightsourceValue)0);
202 return prawfile->getCalibrationIlluminant2();
217 CHECK_PTR(rawfile,
nullptr);
225 CHECK_PTR(rawfile,
nullptr);
254 CHECK_PTR(rawfile,
nullptr);
Represent some bitmap data.
Represent camera raw data.
::or_error getThumbnail(uint32_t size, Thumbnail &thumbnail)
Get the thumbnail from the raw file.
TypeId typeId()
The RAW file type ID. Identify it if needed.
Internals::IfdDir::Ref exifIfd()
Get the Exif IFD.
::or_error getRawData(RawData &rawdata, uint32_t options)
Get the RAW data.
uint32_t getOrientation()
Get the orientation of the image, using Exif enums.
Internals::MakerNoteDir::Ref makerNoteIfd()
Get the MakerNote IFD.
::or_error getColourMatrix1(double *matrix, uint32_t &size)
Get colour matrix.
const std::vector< uint32_t > & listThumbnailSizes(void)
List the available thumbnail sizes.
::or_error getRenderedImage(BitmapData &bitmapdata, uint32_t options)
Get the rendered image.
Internals::IfdDir::Ref mainIfd()
Get the main IFD.
ExifLightsourceValue getCalibrationIlluminant1()
Get the calibration illuminant that match the colour matrix.
Internals::IfdDir::Ref cfaIfd()
Get the IFD containing the CFA.
const MetaValue * getMetaValue(int32_t meta_index)
Get a metadata value.
virtual or_colour_matrix_origin getColourMatrixOrigin() const
Get the origin of the colour matrix for the RAW file.
Type type() const
Accessor for the type.
Wrap a pointer so that we can return it.
struct _RawData * ORRawDataRef
RawData reference.
uint32_t or_rawfile_typeid
This is the type ID, a combination of vendor model It maps a specific camera. Only for the NATIVE fil...
struct _RawFile * ORRawFileRef
RawFile reference.
or_ifd_dir_type
Type of IfdDir.
struct _Thumbnail * ORThumbnailRef
Thumbnail reference.
or_rawfile_type
Types of RAW files.
or_colour_matrix_origin
Where the colour matrix comes from. Typically DNG is provided. The others are built-in.
struct _IfdDir * ORIfdDirRef
IfdDir reference.
or_error
Error codes returned by libopenraw.
struct _BitmapData * ORBitmapDataRef
BitmapData reference.
@ OR_IFD_MAIN
Main (like in TIFF)
@ OR_IFD_EXIF
Exif metadata.
@ OR_RAWFILE_TYPE_UNKNOWN
@ OR_COLOUR_MATRIX_UNKNOWN
API_EXPORT ORIfdDirRef or_rawfile_get_ifd(ORRawFileRef rawfile, or_ifd_dir_type ifd)
Get an IFD directory.
API_EXPORT or_error or_rawfile_release(ORRawFileRef rawfile)
Release the RawFile.
API_EXPORT or_colour_matrix_origin or_rawfile_get_colour_matrix_origin(ORRawFileRef rawfile)
Get the colour matrix origin for file.
API_EXPORT ExifLightsourceValue or_rawfile_get_calibration_illuminant2(ORRawFileRef rawfile)
Get calibration illuminant for the second colour matrix.
API_EXPORT ORRawFileRef or_rawfile_new(const char *filename, or_rawfile_type type)
Create a new RawFile object from a file.
API_EXPORT ORRawFileRef or_rawfile_new_from_memory(const uint8_t *buffer, uint32_t len, or_rawfile_type type)
Create a new RawFile object from a memory buffer.
API_EXPORT or_error or_rawfile_get_colourmatrix2(ORRawFileRef rawfile, double *matrix, uint32_t *size)
Get the second colour matrix.
API_EXPORT or_error or_rawfile_get_colourmatrix1(ORRawFileRef rawfile, double *matrix, uint32_t *size)
Get the first colour matrix.
API_EXPORT const uint32_t * or_rawfile_get_thumbnail_sizes(ORRawFileRef rawfile, size_t *size)
Get the the array of thumbnail sizes.
API_EXPORT const char ** or_get_file_extensions()
Return a NULL terminated list of extensions that the library supposedly handle.
API_EXPORT or_rawfile_typeid or_rawfile_get_vendorid(ORRawFileRef rawfile)
Return the type id to identify the vendor.
API_EXPORT or_error or_rawfile_get_thumbnail(ORRawFileRef rawfile, uint32_t _preferred_size, ORThumbnailRef thumb)
Get a thumbnail from a RawFile..
API_EXPORT ORConstMetaValueRef or_rawfile_get_metavalue(ORRawFileRef rawfile, int32_t meta_index)
Get the metadata value.
API_EXPORT or_rawfile_typeid or_rawfile_get_typeid(ORRawFileRef rawfile)
Return the type id to identify the exact file type.
API_EXPORT int32_t or_rawfile_get_orientation(ORRawFileRef rawfile)
Get the orientation.
API_EXPORT or_error or_rawfile_get_rendered_image(ORRawFileRef rawfile, ORBitmapDataRef bitmapdata, uint32_t options)
Get the rendered image from the raw file.
API_EXPORT or_error or_rawfile_get_rawdata(ORRawFileRef rawfile, ORRawDataRef rawdata, uint32_t options)
Get the RawData out of the RawFile.
API_EXPORT ExifLightsourceValue or_rawfile_get_calibration_illuminant1(ORRawFileRef rawfile)
Get calibration illuminant for the first colour matrix.
API_EXPORT ORMetadataIteratorRef or_rawfile_get_metadata_iterator(ORRawFileRef rawfile)
Get a metadata iterator.
API_EXPORT or_rawfile_type or_rawfile_get_type(ORRawFileRef rawfile)
Get the RawFile type.
Global namespace for libopenraw.