libopenraw
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
OpenRaw::RawFile Class Referenceabstract
Inheritance diagram for OpenRaw::RawFile:
OpenRaw::Internals::CRWFile OpenRaw::Internals::IfdFile OpenRaw::Internals::RafFile OpenRaw::Internals::Cr2File OpenRaw::Internals::MRWFile OpenRaw::Internals::OrfFile OpenRaw::Internals::PEFFile OpenRaw::Internals::Rw2File OpenRaw::Internals::TiffEpFile OpenRaw::Internals::ArwFile OpenRaw::Internals::DngFile OpenRaw::Internals::ERFFile OpenRaw::Internals::NefFile

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
 
RawFileoperator= (const RawFile &)=delete
 
virtual ~RawFile ()
 
Type type () const
 
TypeId typeId ()
 
const std::vector< uint32_t > & listThumbnailSizes (void)
 
::or_error getThumbnail (uint32_t size, Thumbnail &thumbnail)
 
::or_error getRawData (RawData &rawdata, uint32_t options)
 
::or_error getRenderedImage (BitmapData &bitmapdata, uint32_t options)
 
int32_t getOrientation ()
 
uint32_t colourMatrixSize ()
 
::or_error getColourMatrix1 (double *matrix, uint32_t &size)
 
::or_error getColourMatrix2 (double *matrix, uint32_t &size)
 
ExifLightsourceValue getCalibrationIlluminant1 ()
 
ExifLightsourceValue getCalibrationIlluminant2 ()
 
const MetaValuegetMetaValue (int32_t meta_index)
 

Static Public Member Functions

static const char ** fileExtensions ()
 
static RawFilenewRawFile (const char *_filename, Type _typeHint=OR_RAWFILE_TYPE_UNKNOWN)
 
static RawFilenewRawFileFromMemory (const uint8_t *buffer, uint32_t len, Type _typeHint=OR_RAWFILE_TYPE_UNKNOWN)
 

Protected Member Functions

 RawFile (Type _type)
 
void _setTypeId (TypeId _type_id)
 
TypeId _typeId () const
 
virtual Internals::RawContainergetContainer () const =0
 
virtual ::or_error _enumThumbnailSizes (std::vector< uint32_t > &list)=0
 
virtual ::or_error _getThumbnail (uint32_t size, Thumbnail &thumbnail)
 
void _addThumbnail (uint32_t size, const Internals::ThumbDesc &desc)
 
virtual ::or_error _getRawData (RawData &data, uint32_t options)=0
 
virtual ::or_error _getColourMatrix (uint32_t index, double *matrix, uint32_t &size)
 
virtual ExifLightsourceValue _getCalibrationIlluminant (uint16_t index)
 
virtual MetaValue_getMetaValue (int32_t)=0
 
TypeId _typeIdFromModel (const std::string &make, const std::string &model)
 
TypeId _typeIdFromMake (const std::string &make)
 
void _setIdMap (const camera_ids_t *map)
 
void _setMatrices (const Internals::BuiltinColourMatrix *matrices)
 
const Internals::BuiltinColourMatrix_getMatrices () const
 
virtual void _identifyId ()=0
 

Static Protected Member Functions

::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)
 

Detailed Description

Definition at line 50 of file rawfile.hpp.

Constructor & Destructor Documentation

◆ ~RawFile()

OpenRaw::RawFile::~RawFile ( )
virtual

Destructor

Definition at line 321 of file rawfile.cpp.

◆ RawFile()

OpenRaw::RawFile::RawFile ( RawFile::Type  _type)
protected

Construct a raw file

Parameters
_typethe type

Definition at line 315 of file rawfile.cpp.

Member Function Documentation

◆ _enumThumbnailSizes()

virtual ::or_error OpenRaw::RawFile::_enumThumbnailSizes ( std::vector< uint32_t > &  list)
protectedpure virtual

enumerate the thumbnail sizes.

Parameters
listthe list to enumerate into
Returns
OR_ERROR_NONE if success

Implemented in OpenRaw::Internals::IfdFile, OpenRaw::Internals::CRWFile, OpenRaw::Internals::MRWFile, OpenRaw::Internals::OrfFile, and OpenRaw::Internals::RafFile.

Referenced by listThumbnailSizes().

◆ _getColourMatrix()

or_error OpenRaw::RawFile::_getColourMatrix ( uint32_t  index,
double *  matrix,
uint32_t &  size 
)
protected

get the colour matrix.

Parameters
index1 or 2

Definition at line 514 of file rawfile.cpp.

References typeId().

Referenced by getColourMatrix1().

◆ _getRawData()

virtual ::or_error OpenRaw::RawFile::_getRawData ( RawData data,
uint32_t  options 
)
protectedpure virtual

get the RAW data

Parameters
datathe RAW data
optionthe option bits
Returns
OR_ERROR_NONE if success Return the data compressed or uncompressed.

Implemented in OpenRaw::Internals::IfdFile, OpenRaw::Internals::CRWFile, OpenRaw::Internals::ArwFile, OpenRaw::Internals::MRWFile, OpenRaw::Internals::RafFile, OpenRaw::Internals::OrfFile, OpenRaw::Internals::DngFile, OpenRaw::Internals::PEFFile, and OpenRaw::Internals::ERFFile.

Referenced by getRawData().

◆ _getThumbnail()

or_error OpenRaw::RawFile::_getThumbnail ( uint32_t  size,
Thumbnail thumbnail 
)
protected

get the thumbnail of exact size.

Parameters
sizethe size in pixel of the square
Return values
thumbnailthe thumbnail to load
Returns
OR_ERROR_NONE if success listThumbnailSizes() to understand how to fetch the sizes available

Internal implementation of getThumbnail. The size must match.

< of the buffer

Definition at line 413 of file rawfile.cpp.

References OpenRaw::Internals::RawContainer::fetchData(), getContainer(), OpenRaw::Internals::ThumbDesc::offset, OpenRaw::BitmapData::setDataType(), OpenRaw::BitmapData::setDimensions(), OpenRaw::Internals::ThumbDesc::type, OpenRaw::Internals::ThumbDesc::x, and OpenRaw::Internals::ThumbDesc::y.

Referenced by getThumbnail().

◆ _setTypeId()

void OpenRaw::RawFile::_setTypeId ( RawFile::TypeId  _type_id)
protected

Set the file type id

Definition at line 345 of file rawfile.cpp.

References OpenRaw::RawFile::Private::m_type_id.

◆ _typeId()

RawFile::TypeId OpenRaw::RawFile::_typeId ( ) const
protected

Just get the type id value. No identification. You might want to use typeId() in the general case.

Definition at line 340 of file rawfile.cpp.

References OpenRaw::RawFile::Private::m_type_id.

◆ colourMatrixSize()

uint32_t OpenRaw::RawFile::colourMatrixSize ( )
Returns
the number of items in the colour matrix.

Definition at line 499 of file rawfile.cpp.

Referenced by getRawData().

◆ fileExtensions()

const char ** OpenRaw::RawFile::fileExtensions ( )
static

return a NULL terminated list of file extensions that the library handle. This is purely informational.

Returns
a pointer the list, NULL terminated. The pointer is owned by the library.

Definition at line 156 of file rawfile.cpp.

◆ getCalibrationIlluminant1()

ExifLightsourceValue OpenRaw::RawFile::getCalibrationIlluminant1 ( )

Get calibration illuminant that match the colour matrix.

Returns
the Exif value. 0 = unknown. Likely not found.

Definition at line 552 of file rawfile.cpp.

◆ getColourMatrix1()

or_error OpenRaw::RawFile::getColourMatrix1 ( double *  matrix,
uint32_t &  size 
)

Get colour matrix

Parameters
indexThe matrix index.
[out]matrixan array of size double.
sizethe 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.
Returns
an error code.

Definition at line 504 of file rawfile.cpp.

References _getColourMatrix().

Referenced by getRawData().

◆ getContainer()

virtual Internals::RawContainer* OpenRaw::RawFile::getContainer ( ) const
protectedpure virtual

◆ getOrientation()

int32_t OpenRaw::RawFile::getOrientation ( )

Get the orientation of the image, using Exif enums.

Definition at line 482 of file rawfile.cpp.

◆ getRawData()

or_error OpenRaw::RawFile::getRawData ( RawData rawdata,
uint32_t  options 
)

Get the RAW data

Parameters
rawdatathe RawData to put the data into
optionsthe option bits defined by or_options
Returns
the error code

Definition at line 448 of file rawfile.cpp.

References _getRawData(), colourMatrixSize(), OpenRaw::RawData::getColourMatrix1(), and getColourMatrix1().

Referenced by getRenderedImage().

◆ getRenderedImage()

or_error OpenRaw::RawFile::getRenderedImage ( BitmapData bitmapdata,
uint32_t  options 
)

Get the rendered image

Parameters
bitmapdatathe BitmapData to put the image into
optionsthe option bits. Pass 0 for now.
Returns
the error code

Definition at line 470 of file rawfile.cpp.

References getRawData(), and OpenRaw::RawData::getRenderedImage().

◆ getThumbnail()

or_error OpenRaw::RawFile::getThumbnail ( uint32_t  size,
Thumbnail thumbnail 
)

Get the thumbnail from the raw file

Parameters
sizethe square size in px
thumbnailthe thumbnail to extract into
Returns
the error code

Definition at line 363 of file rawfile.cpp.

References _getThumbnail(), and listThumbnailSizes().

◆ listThumbnailSizes()

const std::vector< uint32_t > & OpenRaw::RawFile::listThumbnailSizes ( void  )

list the available thumbnail sizes

Definition at line 350 of file rawfile.cpp.

References _enumThumbnailSizes(), and OpenRaw::RawFile::Private::m_sizes.

Referenced by getThumbnail().

◆ newRawFile()

RawFile * OpenRaw::RawFile::newRawFile ( const char *  _filename,
RawFile::Type  _typeHint = OR_RAWFILE_TYPE_UNKNOWN 
)
static

factory method to create the proper RawFile instance.

Parameters
_filenamethe name of the file to load
_typeHinta hint on the type. Use UNKNOWN_TYPE if you want to let the library detect it for you.

Definition at line 164 of file rawfile.cpp.

Referenced by OpenRaw::Thumbnail::getAndExtractThumbnail().

◆ newRawFileFromMemory()

RawFile * OpenRaw::RawFile::newRawFileFromMemory ( const uint8_t *  buffer,
uint32_t  len,
RawFile::Type  _typeHint = OR_RAWFILE_TYPE_UNKNOWN 
)
static

factory method to create the proper RawFile instance from content

Parameters
bufferthe buffer to examine.
lenthe number of bytes in the length.
_typeHinta hint on the type. Use UNKNOWN_TYPE if you want to let the library detect it for you.

Definition at line 189 of file rawfile.cpp.

◆ type()

RawFile::Type OpenRaw::RawFile::type ( ) const

Accessor for the type

Definition at line 327 of file rawfile.cpp.

References OpenRaw::RawFile::Private::m_type.

◆ typeId()

RawFile::TypeId OpenRaw::RawFile::typeId ( )

The RAW file type ID. Identify it if needed.

Todo:
figure how to make this const.

Definition at line 332 of file rawfile.cpp.

References OpenRaw::RawFile::Private::m_type_id.

Referenced by _getColourMatrix().


The documentation for this class was generated from the following files: