|
libopenraw
0.3.7
|
RAW file. More...
#include <rawfile.hpp>
Classes | |
| struct | camera_ids_t |
| class | Private |
Public Types | |
| typedef ::or_rawfile_type | Type |
| typedef ::or_rawfile_typeid | TypeId |
Public Member Functions | |
| RawFile (const RawFile &)=delete | |
| RawFile & | operator= (const RawFile &)=delete |
| virtual | ~RawFile () |
| Destructor. | |
| Type | type () const |
| Accessor for the type. | |
| TypeId | typeId () |
| The RAW file type ID. Identify it if needed. More... | |
| TypeId | vendorId () |
| const std::vector< uint32_t > & | listThumbnailSizes (void) |
| List the available thumbnail sizes. | |
| ::or_error | getThumbnail (uint32_t size, Thumbnail &thumbnail) |
| Get the thumbnail from the raw file. More... | |
| ::or_error | getRawData (RawData &rawdata, uint32_t options) |
| Get the RAW data. More... | |
| ::or_error | getRenderedImage (BitmapData &bitmapdata, uint32_t options) |
| Get the rendered image. More... | |
| uint32_t | getOrientation () |
| Get the orientation of the image, using Exif enums. | |
| uint32_t | colourMatrixSize () |
| ::or_error | getColourMatrix1 (double *matrix, uint32_t &size) |
| Get colour matrix. More... | |
| ::or_error | getColourMatrix2 (double *matrix, uint32_t &size) |
| ExifLightsourceValue | getCalibrationIlluminant1 () |
| Get the calibration illuminant that match the colour matrix. More... | |
| ExifLightsourceValue | getCalibrationIlluminant2 () |
| virtual or_colour_matrix_origin | getColourMatrixOrigin () const |
| Get the origin of the colour matrix for the RAW file. More... | |
| Internals::IfdDir::Ref | cfaIfd () |
| Get the IFD containing the CFA. | |
| Internals::IfdDir::Ref | mainIfd () |
| Get the main IFD. | |
| Internals::IfdDir::Ref | exifIfd () |
| Get the Exif IFD. | |
| Internals::MakerNoteDir::Ref | makerNoteIfd () |
| Get the MakerNote IFD. | |
| const MetaValue * | getMetaValue (int32_t meta_index) |
| Get a metadata value. More... | |
| MetadataIterator * | getMetadataIterator () |
Static Public Member Functions | |
| static const char ** | fileExtensions () |
| Return a NULL terminated list of file extensions that the library handle. More... | |
| static RawFile * | newRawFile (const char *_filename, Type typeHint=OR_RAWFILE_TYPE_UNKNOWN) |
| Factory method to create the proper RawFile instance. More... | |
| static RawFile * | newRawFileFromMemory (const uint8_t *buffer, uint32_t len, Type typeHint=OR_RAWFILE_TYPE_UNKNOWN) |
| Factory method to create the proper RawFile instance from content. More... | |
Protected Member Functions | |
| virtual Internals::IfdDir::Ref | _locateCfaIfd ()=0 |
| Locate the IFD for the raw data. More... | |
| virtual Internals::IfdDir::Ref | _locateMainIfd ()=0 |
| Locate the main IFD. More... | |
| virtual Internals::IfdDir::Ref | _locateExifIfd () |
| Locate the Exif IFD. More... | |
| virtual Internals::MakerNoteDir::Ref | _locateMakerNoteIfd () |
| Locate the MakerNote IFD. More... | |
| RawFile (Type _type) | |
| Construct a raw file. More... | |
| virtual bool | vendorCameraIdLocation (Internals::IfdDir::Ref &ifd, uint16_t &index, const Internals::ModelIdMap *&model_map) |
| Get the vendor camera ID location. More... | |
| void | _setTypeId (TypeId _type_id) |
| Set the file type id. | |
| TypeId | _typeId () const |
| Just get the type id value. No identification. You might want to use typeId() in the general case. | |
| virtual Internals::RawContainer * | getContainer () const =0 |
| Get the container. | |
| virtual ::or_error | _enumThumbnailSizes (std::vector< uint32_t > &list)=0 |
| Enumerate the thumbnail sizes. More... | |
| virtual ::or_error | _getThumbnail (uint32_t size, Thumbnail &thumbnail) |
| Get the thumbnail of exact size. More... | |
| void | _addThumbnail (uint32_t size, Internals::ThumbDesc &&desc) |
| virtual ::or_error | _getRawData (RawData &data, uint32_t options)=0 |
| Get the RAW data. More... | |
| virtual ::or_error | _getColourMatrix (uint32_t index, double *matrix, uint32_t &size) |
| Get the colour matrix. More... | |
| virtual ExifLightsourceValue | _getCalibrationIlluminant (uint16_t index) |
| virtual MetaValue * | _getMetaValue (int32_t)=0 |
| Implementation for getMetaValue() | |
| TypeId | _typeIdFromModel (const std::string &make, const std::string &model) |
| TypeId | _typeIdFromMake (const std::string &make, const std::string &model) |
| void | _setIdMap (const camera_ids_t *map) |
| void | _setMatrices (const Internals::BuiltinColourMatrix *matrices) |
| const Internals::BuiltinColourMatrix * | _getMatrices () const |
| virtual void | _identifyId ()=0 |
| Identify the file and set the ID internally. | |
Static Protected Member Functions | |
| static RawFile::TypeId | modelid_to_typeid (const std::map< uint32_t, RawFile::TypeId > &model_map, uint32_t model_id) |
| Helper to get the TypeId from the map. More... | |
| ::or_error | _getBuiltinLevels (const Internals::BuiltinColourMatrix *m, TypeId type_id, uint16_t &black, uint16_t &white) |
| ::or_error | _getBuiltinColourMatrix (const Internals::BuiltinColourMatrix *m, TypeId type_id, double *matrix, uint32_t &size) |
Friends | |
| template<typename T > | |
| void | Internals::audit_coefficients () |
RAW file.
Definition at line 65 of file rawfile.hpp.
|
protected |
|
protectedpure virtual |
Enumerate the thumbnail sizes.
| list | the list to enumerate into |
Implemented in OpenRaw::Internals::RafFile, OpenRaw::Internals::PEFFile, OpenRaw::Internals::OrfFile, OpenRaw::Internals::NefFile, OpenRaw::Internals::MRWFile, OpenRaw::Internals::IfdFile, OpenRaw::Internals::ERFFile, OpenRaw::Internals::DngFile, OpenRaw::Internals::CRWFile, and OpenRaw::Internals::Cr3File.
Referenced by listThumbnailSizes().
|
protected |
Get the colour matrix.
| index | 1 or 2 |
Definition at line 599 of file rawfile.cpp.
References META_NS_TIFF.
Referenced by getColourMatrix1().
|
protectedpure virtual |
Get the RAW data.
| data | The RAW data |
| option | The option bits |
Implemented in OpenRaw::Internals::RafFile, OpenRaw::Internals::PEFFile, OpenRaw::Internals::OrfFile, OpenRaw::Internals::MRWFile, OpenRaw::Internals::IfdFile, OpenRaw::Internals::ERFFile, OpenRaw::Internals::DngFile, OpenRaw::Internals::CRWFile, OpenRaw::Internals::Cr3File, and OpenRaw::Internals::ArwFile.
Referenced by getRawData().
Get the thumbnail of exact size.
| size | the size in pixel of the square | |
| [out] | thumbnail | the thumbnail to load |
Internal implementation of getThumbnail. The size must match.
< of the buffer
Definition at line 495 of file rawfile.cpp.
References OpenRaw::Internals::ThumbDesc::data, OpenRaw::Internals::RawContainer::fetchData(), getContainer(), OpenRaw::Internals::ThumbDesc::offset, OR_ERROR_NONE, OR_ERROR_NOT_FOUND, OpenRaw::BitmapData::setDataType(), OpenRaw::BitmapData::setDimensions(), OpenRaw::Internals::ThumbDesc::type, OpenRaw::Internals::ThumbDesc::x, and OpenRaw::Internals::ThumbDesc::y.
Referenced by getThumbnail().
|
protectedpure virtual |
Locate the IFD for the raw data.
This is not necessarily a unique IFD and it can be the same as the main.
Implemented in OpenRaw::Internals::TiffEpFile, OpenRaw::Internals::Rw2File, OpenRaw::Internals::RafFile, OpenRaw::Internals::MRWFile, OpenRaw::Internals::IfdFile, OpenRaw::Internals::CRWFile, OpenRaw::Internals::Cr3File, OpenRaw::Internals::Cr2File, and OpenRaw::Internals::ArwFile.
Referenced by cfaIfd().
|
protectedvirtual |
Locate the Exif IFD.
The default implementation follow the specification by by calling getExifIFD() on the main IFD.
Reimplemented in OpenRaw::Internals::Rw2File, OpenRaw::Internals::CRWFile, and OpenRaw::Internals::Cr3File.
Definition at line 676 of file rawfile.cpp.
References mainIfd().
Referenced by exifIfd().
|
protectedpure virtual |
Locate the main IFD.
Implemented in OpenRaw::Internals::Rw2File, OpenRaw::Internals::RafFile, OpenRaw::Internals::MRWFile, OpenRaw::Internals::IfdFile, OpenRaw::Internals::CRWFile, OpenRaw::Internals::Cr3File, and OpenRaw::Internals::Cr2File.
Referenced by mainIfd().
|
protectedvirtual |
Locate the MakerNote IFD.
The default implementation follow the specification by by calling getMakerNoteIfd() on the main IFD.
Reimplemented in OpenRaw::Internals::CRWFile, and OpenRaw::Internals::Cr3File.
Definition at line 686 of file rawfile.cpp.
References exifIfd(), and type().
Referenced by makerNoteIfd().
| uint32_t OpenRaw::RawFile::colourMatrixSize | ( | ) |
Definition at line 584 of file rawfile.cpp.
Referenced by getRawData().
|
static |
Return a NULL terminated list of file extensions that the library handle.
This is purely informational.
Definition at line 180 of file rawfile.cpp.
| ExifLightsourceValue OpenRaw::RawFile::getCalibrationIlluminant1 | ( | ) |
Get the calibration illuminant that match the colour matrix.
Definition at line 638 of file rawfile.cpp.
Referenced by or_rawfile_get_calibration_illuminant1().
| or_error OpenRaw::RawFile::getColourMatrix1 | ( | double * | matrix, |
| uint32_t & | size | ||
| ) |
Get colour matrix.
| index | The matrix index. | |
| [out] | matrix | pointer to array of size double. |
| size | the size of the buffer. On out the actual size. If it is too small the size is adjusted and an error OR_ERROR_BUF_TOO_SMALL returned. |
Definition at line 589 of file rawfile.cpp.
References _getColourMatrix().
Referenced by getRawData(), and or_rawfile_get_colourmatrix1().
|
virtual |
Get the origin of the colour matrix for the RAW file.
or_colour_matrix_origin Reimplemented in OpenRaw::Internals::DngFile.
Definition at line 648 of file rawfile.cpp.
References OR_COLOUR_MATRIX_BUILTIN.
Referenced by or_rawfile_get_colour_matrix_origin().
| const MetaValue * OpenRaw::RawFile::getMetaValue | ( | int32_t | meta_index | ) |
Get a metadata value.
Definition at line 733 of file rawfile.cpp.
References _getMetaValue().
Referenced by getOrientation(), and or_rawfile_get_metavalue().
Get the RAW data.
| rawdata | the RawData to put the data into |
| options | the option bits defined by or_options |
Definition at line 536 of file rawfile.cpp.
References _getRawData(), colourMatrixSize(), getColourMatrix1(), OpenRaw::RawData::getColourMatrix1(), and OR_ERROR_NONE.
Referenced by getRenderedImage(), and or_rawfile_get_rawdata().
| or_error OpenRaw::RawFile::getRenderedImage | ( | BitmapData & | bitmapdata, |
| uint32_t | options | ||
| ) |
Get the rendered image.
| bitmapdata | the BitmapData to put the image into |
| options | the option bits. Pass 0 for now. |
Definition at line 557 of file rawfile.cpp.
References getRawData(), OpenRaw::RawData::getRenderedImage(), and OR_ERROR_NONE.
Referenced by or_rawfile_get_rendered_image().
Get the thumbnail from the raw file.
| size | the square size in px | |
| [out] | thumbnail | the thumbnail to extract into |
Definition at line 445 of file rawfile.cpp.
References _getThumbnail(), listThumbnailSizes(), and OR_ERROR_NOT_FOUND.
Referenced by or_rawfile_get_thumbnail().
|
staticprotected |
Helper to get the TypeId from the map.
Definition at line 406 of file rawfile.cpp.
|
static |
Factory method to create the proper RawFile instance.
| _filename | the name of the file to load |
| _typeHint | a hint on the type. Use UNKNOWN_TYPE if you want to let the library detect it for you. |
Definition at line 187 of file rawfile.cpp.
References OR_ERROR_NONE, and OR_RAWFILE_TYPE_UNKNOWN.
Referenced by OpenRaw::Thumbnail::getAndExtractThumbnail().
|
static |
Factory method to create the proper RawFile instance from content.
| buffer | the buffer to examine. |
| len | the number of bytes in the length. |
| _typeHint | a hint on the type. Use UNKNOWN_TYPE if you want to let the library detect it for you. |
Definition at line 221 of file rawfile.cpp.
References OR_ERROR_NONE, and OR_RAWFILE_TYPE_UNKNOWN.
| RawFile::TypeId OpenRaw::RawFile::typeId | ( | ) |
The RAW file type ID. Identify it if needed.
Definition at line 380 of file rawfile.cpp.
References _identifyId(), and OpenRaw::RawFile::Private::m_type_id.
Referenced by OpenRaw::Internals::MRWFile::_getRawData(), and or_rawfile_get_typeid().
|
protectedvirtual |
Get the vendor camera ID location.
| ifd | the IfdDir where it is. |
| index | the value index in the IfdDir. |
| model_map | a point to the model map. Can't be null. |
Reimplemented in OpenRaw::Internals::Cr2File, OpenRaw::Internals::ArwFile, and OpenRaw::Internals::PEFFile.
Definition at line 416 of file rawfile.cpp.