libopenraw
Protected Member Functions | Protected Attributes | List of all members
OpenRaw::Internals::IfdFile Class Referenceabstract

generic IFD based raw file. More...

#include <ifdfile.hpp>

Inheritance diagram for OpenRaw::Internals::IfdFile:
OpenRaw::RawFile 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

Protected Member Functions

 IfdFile (const IO::Stream::Ptr &s, Type _type, bool instantiateContainer=true)
 
virtual ::or_error _enumThumbnailSizes (std::vector< uint32_t > &list) override
 
virtual ::or_error _locateThumbnail (const IfdDir::Ref &dir, std::vector< uint32_t > &list)
 
::or_error _getRawDataFromDir (RawData &data, const IfdDir::Ref &dir)
 
virtual uint32_t _getJpegThumbnailOffset (const IfdDir::Ref &dir, uint32_t &len)
 
virtual RawContainergetContainer () const override
 
virtual IfdDir::Ref _locateCfaIfd ()=0
 
virtual IfdDir::Ref _locateMainIfd ()=0
 
virtual IfdDir::Ref _locateExifIfd ()
 
virtual MakerNoteDir::Ref _locateMakerNoteIfd ()
 
virtual void _identifyId () override
 
virtual MetaValue_getMetaValue (int32_t meta_index) override
 
virtual uint32_t _translateCompressionType (IFD::TiffCompress tiffCompression)
 
virtual ::or_error _unpackData (uint16_t bpc, uint32_t compression, RawData &data, uint32_t x, uint32_t y, uint32_t offset, uint32_t byte_length)
 
const IfdDir::Ref & cfaIfd ()
 
const IfdDir::Ref & mainIfd ()
 
const IfdDir::Ref & exifIfd ()
 
const MakerNoteDir::Ref & makerNoteIfd ()
 
virtual ::or_error _getRawData (RawData &data, uint32_t options) override
 
virtual ::or_error _decompressIfNeeded (RawData &, uint32_t)
 
- Protected Member Functions inherited from OpenRaw::RawFile
 RawFile (Type _type)
 
void _setTypeId (TypeId _type_id)
 
TypeId _typeId () const
 
virtual ::or_error _getThumbnail (uint32_t size, Thumbnail &thumbnail)
 
void _addThumbnail (uint32_t size, const Internals::ThumbDesc &desc)
 
virtual ::or_error _getColourMatrix (uint32_t index, double *matrix, uint32_t &size)
 
virtual ExifLightsourceValue _getCalibrationIlluminant (uint16_t index)
 
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
 

Protected Attributes

IO::Stream::Ptr m_io
 
IfdFileContainerm_container
 

Additional Inherited Members

- Public Types inherited from OpenRaw::RawFile
typedef ::or_rawfile_type Type
 
typedef ::or_rawfile_typeid TypeId
 
- Public Member Functions inherited from OpenRaw::RawFile
 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 inherited from OpenRaw::RawFile
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)
 
- Static Protected Member Functions inherited from OpenRaw::RawFile
::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

generic IFD based raw file.

Definition at line 48 of file ifdfile.hpp.

Member Function Documentation

§ _enumThumbnailSizes()

or_error OpenRaw::Internals::IfdFile::_enumThumbnailSizes ( std::vector< uint32_t > &  list)
overrideprotectedvirtual

list the thumbnails in the IFD

Return values
listthe list of thumbnails
Returns
the error code. OR_ERROR_NOT_FOUND if no thumbnail are found.

Implements OpenRaw::RawFile.

Reimplemented in OpenRaw::Internals::MRWFile, and OpenRaw::Internals::OrfFile.

Definition at line 114 of file ifdfile.cpp.

§ _getJpegThumbnailOffset()

uint32_t OpenRaw::Internals::IfdFile::_getJpegThumbnailOffset ( const IfdDir::Ref &  dir,
uint32_t &  len 
)
protectedvirtual

Get the JPEG thumbnail offset from dir.

Parameters
dirthe IFD to get the thumbnail from
lenthe length of the JPEG stream. 0 is not valid.
Returns
the offset. 0 is not valid.

Definition at line 297 of file ifdfile.cpp.

§ _getRawData()

or_error OpenRaw::Internals::IfdFile::_getRawData ( RawData data,
uint32_t  options 
)
overrideprotectedvirtual

get the RAW data

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

Implements OpenRaw::RawFile.

Reimplemented in OpenRaw::Internals::MRWFile, OpenRaw::Internals::OrfFile, and OpenRaw::Internals::PEFFile.

Definition at line 512 of file ifdfile.cpp.

§ _getRawDataFromDir()

or_error OpenRaw::Internals::IfdFile::_getRawDataFromDir ( RawData data,
const IfdDir::Ref &  dir 
)
protected

load the compressed rawdata from a standard location in an IFD

Parameters
datathe data storage
dirthe IFD
Returns
the error code.

Definition at line 537 of file ifdfile.cpp.

References OpenRaw::Internals::NefFile::isCompressed(), OpenRaw::BitmapData::setDataType(), and OpenRaw::RawData::setDimensions().

Referenced by OpenRaw::Internals::ERFFile::_getRawData().

§ _locateThumbnail()

or_error OpenRaw::Internals::IfdFile::_locateThumbnail ( const IfdDir::Ref &  dir,
std::vector< uint32_t > &  list 
)
protected

locate the thumnail in the IFD

Parameters
dirthe IfdDir where to locate the thumbnail
Returns
the error code. OR_ERROR_NOT_FOUND if the thumbnail are not found.

Definition at line 151 of file ifdfile.cpp.

§ _translateCompressionType()

uint32_t OpenRaw::Internals::IfdFile::_translateCompressionType ( IFD::TiffCompress  tiffCompression)
protectedvirtual

Translate the compression type from the tiff type (16MSB) to the RAW specific type if needed (16MSB)

Parameters
tiffCompressionthe 16 bits value from TIFF
Returns
the actually value. Anything >= 2^16 is specific the RAW type

by default we don't translate the compression

Reimplemented in OpenRaw::Internals::OrfFile.

Definition at line 341 of file ifdfile.cpp.

§ _unpackData()

or_error OpenRaw::Internals::IfdFile::_unpackData ( uint16_t  bpc,
uint32_t  compression,
RawData data,
uint32_t  x,
uint32_t  y,
uint32_t  offset,
uint32_t  byte_length 
)
protected

Unpack the data

Parameters
bpcbits per components
compressionthe compression type
xthe width
ythe height
offsetthe offset of the data
byte_lengththe amount of data
Returns
error code

Definition at line 697 of file ifdfile.cpp.

References OpenRaw::Internals::Unpack::unpack_be12to16().

§ cfaIfd()

const IfdDir::Ref & OpenRaw::Internals::IfdFile::cfaIfd ( )
protected

access the corresponding IFD. Will locate them if needed

Definition at line 348 of file ifdfile.cpp.

References OpenRaw::Internals::IfdTypeTrait< T >::get().

Referenced by OpenRaw::Internals::ERFFile::_getRawData().

§ getContainer()

RawContainer * OpenRaw::Internals::IfdFile::getContainer ( ) const
overrideprotectedvirtual

Get the container.

Implements OpenRaw::RawFile.

Definition at line 292 of file ifdfile.cpp.

Member Data Documentation

§ m_container

IfdFileContainer* OpenRaw::Internals::IfdFile::m_container
protected

the real container

Definition at line 90 of file ifdfile.hpp.

§ m_io

IO::Stream::Ptr OpenRaw::Internals::IfdFile::m_io
protected

the IO handle

Definition at line 89 of file ifdfile.hpp.


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