libopenraw
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
OpenRaw::RawFile Class Referenceabstract
Inheritance diagram for OpenRaw::RawFile:
OpenRaw::Internals::CRWFile OpenRaw::Internals::IFDFile OpenRaw::Internals::ARWFile OpenRaw::Internals::Cr2File OpenRaw::Internals::MRWFile OpenRaw::Internals::OrfFile OpenRaw::Internals::PEFFile OpenRaw::Internals::TiffEpFile 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

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 ()
 
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 (IO::Stream *s, Type _type)
 
void _setTypeId (TypeId _type_id)
 
virtual ::or_error _enumThumbnailSizes (std::vector< uint32_t > &list)=0
 
virtual ::or_error _getThumbnail (uint32_t size, Thumbnail &thumbnail)=0
 
virtual ::or_error _getRawData (RawData &data, uint32_t options)=0
 
virtual MetaValue_getMetaValue (int32_t)=0
 
TypeId _typeIdFromModel (const std::string &model)
 
void _setIdMap (const camera_ids_t *map)
 
virtual void _identifyId ()=0
 

Detailed Description

Definition at line 43 of file rawfile.h.

Constructor & Destructor Documentation

OpenRaw::RawFile::~RawFile ( )
virtual

Destructor

Definition at line 285 of file rawfile.cpp.

OpenRaw::RawFile::RawFile ( IO::Stream s,
RawFile::Type  _type 
)
protected

Construct a raw file

Parameters
sthe stream to load from. Take ownership.
_typethe type

Definition at line 278 of file rawfile.cpp.

Member Function Documentation

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, and OpenRaw::Internals::MRWFile.

Referenced by listThumbnailSizes().

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::CRWFile, OpenRaw::Internals::MRWFile, OpenRaw::Internals::ARWFile, OpenRaw::Internals::PEFFile, OpenRaw::Internals::OrfFile, OpenRaw::Internals::DNGFile, OpenRaw::Internals::ERFFile, and OpenRaw::Internals::TiffEpFile.

Referenced by getRawData().

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

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

Implemented in OpenRaw::Internals::CRWFile, and OpenRaw::Internals::MRWFile.

Referenced by getThumbnail().

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

Set the file type id

Definition at line 304 of file rawfile.cpp.

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

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 127 of file rawfile.cpp.

int32_t OpenRaw::RawFile::getOrientation ( )

Get the orientation of the image, using Exif enums.

Definition at line 414 of file rawfile.cpp.

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 372 of file rawfile.cpp.

References _getRawData().

Referenced by 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 379 of file rawfile.cpp.

References OpenRaw::BitmapData::dataType(), getRawData(), OpenRaw::BitmapData::setDataType(), and OpenRaw::BitmapData::setDimensions().

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 322 of file rawfile.cpp.

References _getThumbnail(), and listThumbnailSizes().

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

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

list the available thumbnail sizes

Definition at line 309 of file rawfile.cpp.

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

Referenced by getThumbnail().

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 135 of file rawfile.cpp.

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

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 160 of file rawfile.cpp.

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

Accessor for the type

Definition at line 291 of file rawfile.cpp.

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

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

The RAW file type ID. Identify it if needed.

Todo:
figure how to make this const.

Definition at line 296 of file rawfile.cpp.

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


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