libopenraw  0.3.7
Functions

Decode the raw file. More...

Functions

const char ** or_get_file_extensions ()
 Return a NULL terminated list of extensions that the library supposedly handle. More...
 
ORRawFileRef or_rawfile_new (const char *filename, or_rawfile_type type)
 Create a new RawFile object from a file. More...
 
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. More...
 
or_error or_rawfile_release (ORRawFileRef rawfile)
 Release the RawFile. More...
 
or_rawfile_type or_rawfile_get_type (ORRawFileRef rawfile)
 Get the RawFile type. More...
 
or_rawfile_typeid or_rawfile_get_typeid (ORRawFileRef rawfile)
 Return the type id to identify the exact file type. More...
 
or_rawfile_typeid or_rawfile_get_vendorid (ORRawFileRef rawfile)
 Return the type id to identify the vendor. More...
 
const uint32_t * or_rawfile_get_thumbnail_sizes (ORRawFileRef rawfile, size_t *size)
 Get the the array of thumbnail sizes. More...
 
or_error or_rawfile_get_thumbnail (ORRawFileRef rawfile, uint32_t preferred_size, ORThumbnailRef thumb)
 Get a thumbnail from a RawFile.. More...
 
or_error or_rawfile_get_rawdata (ORRawFileRef rawfile, ORRawDataRef rawdata, uint32_t options)
 Get the RawData out of the RawFile. More...
 
or_error or_rawfile_get_rendered_image (ORRawFileRef rawfile, ORBitmapDataRef rawdata, uint32_t options)
 Get the rendered image from the raw file. More...
 
int32_t or_rawfile_get_orientation (ORRawFileRef rawfile)
 Get the orientation. More...
 
or_error or_rawfile_get_colourmatrix1 (ORRawFileRef rawfile, double *matrix, uint32_t *size)
 Get the first colour matrix. More...
 
or_error or_rawfile_get_colourmatrix2 (ORRawFileRef rawfile, double *matrix, uint32_t *size)
 Get the second colour matrix. More...
 
ExifLightsourceValue or_rawfile_get_calibration_illuminant1 (ORRawFileRef rawfile)
 Get calibration illuminant for the first colour matrix. More...
 
ExifLightsourceValue or_rawfile_get_calibration_illuminant2 (ORRawFileRef rawfile)
 Get calibration illuminant for the second colour matrix. More...
 
or_colour_matrix_origin or_rawfile_get_colour_matrix_origin (ORRawFileRef rawfile)
 Get the colour matrix origin for file. More...
 
ORConstMetaValueRef or_rawfile_get_metavalue (ORRawFileRef rawfile, int32_t meta_index)
 Get the metadata value. More...
 
ORIfdDirRef or_rawfile_get_ifd (ORRawFileRef rawfile, or_ifd_dir_type ifd)
 Get an IFD directory. More...
 
ORMetadataIteratorRef or_rawfile_get_metadata_iterator (ORRawFileRef rawfile)
 Get a metadata iterator. More...
 

Detailed Description

Decode the raw file.

Function Documentation

◆ or_get_file_extensions()

const char** or_get_file_extensions ( )

Return a NULL terminated list of extensions that the library supposedly handle.

Returns
A NULL terminated list. Owned the library.

Definition at line 58 of file rawfile.cpp.

◆ or_rawfile_get_calibration_illuminant1()

ExifLightsourceValue or_rawfile_get_calibration_illuminant1 ( ORRawFileRef  rawfile)

Get calibration illuminant for the first colour matrix.

Returns
The Exif value. See ExifLightsourceValue. EV_LIGHTSOURCE_UNKNOWN means the matrix is not found.
See also
ExifLightsourceValue.

Definition at line 190 of file rawfile.cpp.

References OpenRaw::RawFile::getCalibrationIlluminant1().

◆ or_rawfile_get_calibration_illuminant2()

ExifLightsourceValue or_rawfile_get_calibration_illuminant2 ( ORRawFileRef  rawfile)

Get calibration illuminant for the second colour matrix.

See also
or_rawfile_get_calibration_illuminant1

Definition at line 198 of file rawfile.cpp.

◆ or_rawfile_get_colour_matrix_origin()

or_colour_matrix_origin or_rawfile_get_colour_matrix_origin ( ORRawFileRef  rawfile)

Get the colour matrix origin for file.

This allow to determine if it is provided by the file or as a hardcoded value in the library.

Parameters
rawfileThe RawFile object
Returns
The colour matrix origin

Definition at line 206 of file rawfile.cpp.

References OpenRaw::RawFile::getColourMatrixOrigin(), and OR_COLOUR_MATRIX_UNKNOWN.

◆ or_rawfile_get_colourmatrix1()

or_error or_rawfile_get_colourmatrix1 ( ORRawFileRef  rawfile,
double *  matrix,
uint32_t *  size 
)

Get the first colour matrix.

The error code will be one of the following: OR_ERROR_BUF_TOO_SMALL if matrix is too small. Check the value of size to know how much you need. OR_ERROR_NOT_IMPLEMENTED if there is no matrix in the file nor built-in matrices.

Call or_rawfile_get_colour_matrix_origin() if you want to know if it is a built-in matrix.

See also
or_rawfile_get_colour_matrix_origin()
Parameters
rawfileThe RAW file object
[int]matrix The storage array for the matrix
[in/out]size The size of the matrix array. On output the actual size of the matrix.
Returns
An error codex.

Definition at line 170 of file rawfile.cpp.

References OpenRaw::RawFile::getColourMatrix1(), OR_ERROR_INVALID_PARAM, and OR_ERROR_NOTAREF.

◆ or_rawfile_get_colourmatrix2()

or_error or_rawfile_get_colourmatrix2 ( ORRawFileRef  rawfile,
double *  matrix,
uint32_t *  size 
)

Get the second colour matrix.

See or_rawfile_get_colourmatrix1 for details. Will return OR_ERROR_INVALID_PARAM if the matrix doesn't exist in the file. There won't be a built-in matrix.

See also
or_rawfile_get_colourmatrix1()

Definition at line 180 of file rawfile.cpp.

References OR_ERROR_INVALID_PARAM, and OR_ERROR_NOTAREF.

◆ or_rawfile_get_ifd()

ORIfdDirRef or_rawfile_get_ifd ( ORRawFileRef  rawfile,
or_ifd_dir_type  ifd 
)

Get an IFD directory.

Parameters
rawfileThe RawFile object.
ifdThe IFD you want, from or_ifd_dir_type.
Returns
An IfdDir. Must be freed with or_ifd_release()
See also
or_ifd_dir_type

Definition at line 222 of file rawfile.cpp.

References OpenRaw::RawFile::cfaIfd(), OpenRaw::RawFile::exifIfd(), OpenRaw::RawFile::mainIfd(), OpenRaw::RawFile::makerNoteIfd(), OR_IFD_EXIF, OR_IFD_MAIN, OR_IFD_MNOTE, and OR_IFD_RAW.

◆ or_rawfile_get_metadata_iterator()

ORMetadataIteratorRef or_rawfile_get_metadata_iterator ( ORRawFileRef  rawfile)

Get a metadata iterator.

Parameters
rawfileThe RawFile object.
Returns
The metadata iterator. Must be freed with or_metadata_iterator_free()

Definition at line 251 of file rawfile.cpp.

◆ or_rawfile_get_metavalue()

ORConstMetaValueRef or_rawfile_get_metavalue ( ORRawFileRef  rawfile,
int32_t  meta_index 
)

Get the metadata value.

Parameters
rawfilethe RawFile object.
meta_indexthe index value which a bit OR between a namespace and an index
Returns
a const MetaValue, owned by the RawFile

Definition at line 214 of file rawfile.cpp.

References OpenRaw::RawFile::getMetaValue().

Referenced by dump_file_info().

◆ or_rawfile_get_orientation()

int32_t or_rawfile_get_orientation ( ORRawFileRef  rawfile)

Get the orientation.

This is a convenince method, equivalent to getting the value of EXIF_TAG_ORIENTATION.

Parameters
rawfileThe RawFile object.
Returns
the orientation using EXIF semantics. If there is no orientation attribute, return 0.

Definition at line 162 of file rawfile.cpp.

References OpenRaw::RawFile::getOrientation().

◆ or_rawfile_get_rawdata()

or_error or_rawfile_get_rawdata ( ORRawFileRef  rawfile,
ORRawDataRef  rawdata,
uint32_t  options 
)

Get the RawData out of the RawFile.

Will return an error code: OR_ERROR_NOT_FOUND if the RAW data can't be located. This likely indicate a file that isn't properly supported.

The RawData object will contain the uncompress RAW data if possible (unless otherwise requested).

Parameters
rawfileThe RawFile.
[in/out]rawdata An allocated RawData object. Pass OR_OPTIONS_DONT_DECOMPRESS if you don't want the RAW data stream to be decompressed, OR_OPTIONS_NONE otherwise.
optionsSome options.
Returns
An error code or OR_ERROR_NONE on success.

Definition at line 142 of file rawfile.cpp.

References OpenRaw::RawFile::getRawData(), and OR_ERROR_NOTAREF.

◆ or_rawfile_get_rendered_image()

or_error or_rawfile_get_rendered_image ( ORRawFileRef  rawfile,
ORBitmapDataRef  rawdata,
uint32_t  options 
)

Get the rendered image from the raw file.

Parameters
rawfileThe raw file.
rawdataThe preallocated bitmap data.
optionsOption for rendering. Pass OR_OPTIONS_NONE for now.
Returns
An error code. OR_ERROR_NOTAREF is rawfile is NULL.

Definition at line 151 of file rawfile.cpp.

References OpenRaw::RawFile::getRenderedImage(), and OR_ERROR_NOTAREF.

◆ or_rawfile_get_thumbnail()

or_error or_rawfile_get_thumbnail ( ORRawFileRef  rawfile,
uint32_t  preferred_size,
ORThumbnailRef  thumb 
)

Get a thumbnail from a RawFile..

Get a thumbnail close to the preferred size. If there is no exact match, it will prefer a bigger thumbnail so that you can downsize it.

Return an error in case or error. OR_ERROR_NOT_FOUND if no thumbnail can be found.

Parameters
rawfileThe RawFile object.
preferred_sizeThe requested preferred size.
[in/out]thumb The Thumbnail object to store the data.
Returns
An error code. OR_ERROR_NONE in case of success.

Definition at line 131 of file rawfile.cpp.

References OpenRaw::RawFile::getThumbnail(), and OR_ERROR_NOTAREF.

Referenced by OrDiag::dumpPreviews().

◆ or_rawfile_get_thumbnail_sizes()

const uint32_t* or_rawfile_get_thumbnail_sizes ( ORRawFileRef  rawfile,
size_t *  size 
)

Get the the array of thumbnail sizes.

Parameters
rawfileThe RawFile.
[out]sizeThe size of the array is returned
Returns
The array. It is owned by the raw file

Definition at line 113 of file rawfile.cpp.

References OpenRaw::RawFile::listThumbnailSizes().

Referenced by OrDiag::dumpPreviews().

◆ or_rawfile_get_type()

or_rawfile_type or_rawfile_get_type ( ORRawFileRef  rawfile)

Get the RawFile type.

Returns
The type from or_rawfile_type. It isn't necessarily what was passed at creation time.

Definition at line 89 of file rawfile.cpp.

References OR_RAWFILE_TYPE_UNKNOWN, and OpenRaw::RawFile::type().

Referenced by dump_file_info().

◆ or_rawfile_get_typeid()

or_rawfile_typeid or_rawfile_get_typeid ( ORRawFileRef  rawfile)

Return the type id to identify the exact file type.

Returns
The type ID. It is a combination of vendor ID and camera ID.
See also
or_rawfile_typeid.

Definition at line 97 of file rawfile.cpp.

References OR_RAWFILE_TYPE_UNKNOWN, and OpenRaw::RawFile::typeId().

Referenced by dump_file_info().

◆ or_rawfile_get_vendorid()

or_rawfile_typeid or_rawfile_get_vendorid ( ORRawFileRef  rawfile)

Return the type id to identify the vendor.

Returns
The vendor ID. Use the constants values to match.

Definition at line 105 of file rawfile.cpp.

References OR_RAWFILE_TYPE_UNKNOWN.

Referenced by dump_file_info().

◆ or_rawfile_new()

ORRawFileRef or_rawfile_new ( const char *  filename,
or_rawfile_type  type 
)

Create a new RawFile object from a file.

Parameters
filenameThe path to the file to open.
typeThe hint for the file type. Pass OR_RAWFILE_TYPE_UNKNOWN to let the library guess.
Returns
A new allocated RawFile pointer. Must be freed with or_rawfile_release().

Definition at line 64 of file rawfile.cpp.

◆ or_rawfile_new_from_memory()

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.

Parameters
bufferThe memory buffer: bytes from the RAW file.
lenThe length of the memory buffer in bytes.
typeThe hint for the file type. Pass OR_RAWFILE_TYPE_UNKNOWN to let the library guess.
Returns
A new allocated RawFile pointer. Must be freed with or_rawfile_release().

Definition at line 72 of file rawfile.cpp.

◆ or_rawfile_release()

or_error or_rawfile_release ( ORRawFileRef  rawfile)

Release the RawFile.

Parameters
[in]rawfileThe RawFile object to release.
Returns
An error code. OR_ERROR_NOT_AREF if the pointer is NULL.

Definition at line 81 of file rawfile.cpp.

References OR_ERROR_NONE, and OR_ERROR_NOTAREF.