TinyTIFF
a lightweight C/C++ library for reading and writing TIFF files
|
Functions | |
TINYTIFF_EXPORT void | TinyTIFFReader_close (TinyTIFFReaderFile *tiff) |
close a given TIFF file | |
TINYTIFF_EXPORT uint32_t | TinyTIFFReader_countFrames (TinyTIFFReaderFile *tiff) |
return the width of the current frame | |
TINYTIFF_EXPORT uint16_t | TinyTIFFReader_getBitsPerSample (TinyTIFFReaderFile *tiff, int sample) |
return the bits per sample of the current frame | |
TINYTIFF_EXPORT uint32_t | TinyTIFFReader_getHeight (TinyTIFFReaderFile *tiff) |
return the height of the current frame | |
TINYTIFF_EXPORT const char * | TinyTIFFReader_getImageDescription (TinyTIFFReaderFile *tiff) |
return the image description of the current frame | |
TINYTIFF_EXPORT const char * | TinyTIFFReader_getLastError (TinyTIFFReaderFile *tiff) |
returns a pointer to the last error message | |
TINYTIFF_EXPORT uint16_t | TinyTIFFReader_getResolutionUnit (TinyTIFFReaderFile *tiff) |
return the base unit for resolution | |
TINYTIFF_EXPORT int | TinyTIFFReader_getSampleData (TinyTIFFReaderFile *tiff, void *buffer, uint16_t sample) |
read the given sample from the current frame into the given buffer, the byteorder is transformed to the byteorder of the system! | |
TINYTIFF_EXPORT int | TinyTIFFReader_getSampleData_s (TinyTIFFReaderFile *tiff, void *buffer, unsigned long buffer_size, uint16_t sample) |
read the given sample from the current frame into the given buffer, the byteorder is transformed to the byteorder of the system! This is a secure version of TinyTIFFReader_getSampleData() that also accepts the size of the output buffer for additional security checks! | |
TINYTIFF_EXPORT uint16_t | TinyTIFFReader_getSampleFormat (TinyTIFFReaderFile *tiff) |
return the sample format of the current frame | |
TINYTIFF_EXPORT uint16_t | TinyTIFFReader_getSamplesPerPixel (TinyTIFFReaderFile *tiff) |
return the samples per pixel of the current frame | |
TINYTIFF_EXPORT const char * | TinyTIFFReader_getVersion () |
returns the version number of TinyTIFFReader | |
TINYTIFF_EXPORT uint32_t | TinyTIFFReader_getWidth (TinyTIFFReaderFile *tiff) |
return the width of the current frame | |
TINYTIFF_EXPORT float | TinyTIFFReader_getXResolution (TinyTIFFReaderFile *tiff) |
return the pixels per basic resolution unit in image width direction | |
TINYTIFF_EXPORT float | TinyTIFFReader_getYResolution (TinyTIFFReaderFile *tiff) |
return the pixels per basic resolution unit in image height direction | |
TINYTIFF_EXPORT int | TinyTIFFReader_hasNext (TinyTIFFReaderFile *tiff) |
returns TINYTIFF_TRUE (non-zero) if another frame exists in the TIFF file | |
TINYTIFF_EXPORT TinyTIFFReaderFile * | TinyTIFFReader_open (const char *filename) |
open TIFF file for reading | |
TINYTIFF_EXPORT int | TinyTIFFReader_readNext (TinyTIFFReaderFile *tiff) |
reads the next frame from a multi-frame TIFF | |
TINYTIFF_EXPORT int | TinyTIFFReader_success (TinyTIFFReaderFile *tiff) |
returns TINYTIFF_TRUE (non-zero) when there was no error in the last function call, or TINYTIFF_FALSE if there was an error | |
TINYTIFF_EXPORT int | TinyTIFFReader_wasError (TinyTIFFReaderFile *tiff) |
returns TINYTIFF_TRUE (non-zero) when there was an error in the last function call, or TINYTIFF_FALSE if there was no error | |
TINYTIFF_EXPORT const char * | TinyTIFFWriter_getVersion () |
returns the version number of TinyTIFFReader | |
TINYTIFF_EXPORT void TinyTIFFReader_close | ( | TinyTIFFReaderFile * | tiff | ) |
close a given TIFF file
tiff | TIFF file to close |
This function also releases memory allocated in TinyTIFFReader_open() in tiff.
TINYTIFF_EXPORT uint32_t TinyTIFFReader_countFrames | ( | TinyTIFFReaderFile * | tiff | ) |
return the width of the current frame
tiff | TIFF file |
TINYTIFF_EXPORT uint16_t TinyTIFFReader_getBitsPerSample | ( | TinyTIFFReaderFile * | tiff, |
int | sample | ||
) |
return the bits per sample of the current frame
tiff | TIFF file |
sample | return bits for the given sample number [default: 0] |
TINYTIFF_EXPORT uint32_t TinyTIFFReader_getHeight | ( | TinyTIFFReaderFile * | tiff | ) |
return the height of the current frame
tiff | TIFF file |
TINYTIFF_EXPORT const char * TinyTIFFReader_getImageDescription | ( | TinyTIFFReaderFile * | tiff | ) |
return the image description of the current frame
tiff | TIFF file |
TINYTIFF_EXPORT const char * TinyTIFFReader_getLastError | ( | TinyTIFFReaderFile * | tiff | ) |
returns a pointer to the last error message
tiff | TIFF file |
TINYTIFF_EXPORT uint16_t TinyTIFFReader_getResolutionUnit | ( | TinyTIFFReaderFile * | tiff | ) |
return the base unit for resolution
tiff | TIFF file |
TINYTIFF_EXPORT int TinyTIFFReader_getSampleData | ( | TinyTIFFReaderFile * | tiff, |
void * | buffer, | ||
uint16_t | sample | ||
) |
read the given sample from the current frame into the given buffer, the byteorder is transformed to the byteorder of the system!
tiff | TIFF file |
buffer | the buffer this function writes into, the size has to be at least TinyTIFFReader_getWidth() * TinyTIFFReader_getHeight() * TinyTIFFReader_getBitsPerSample() / 8 |
sample | the sample to read [default: 0] |
TINYTIFF_TRUE
(non-zero) on success, if an error occured TINYTIFF_FALSE
is returned and the error message can be retrieved with TinyTIFFReader_getLastError()TINYTIFF_EXPORT int TinyTIFFReader_getSampleData_s | ( | TinyTIFFReaderFile * | tiff, |
void * | buffer, | ||
unsigned long | buffer_size, | ||
uint16_t | sample | ||
) |
read the given sample from the current frame into the given buffer, the byteorder is transformed to the byteorder of the system! This is a secure version of TinyTIFFReader_getSampleData() that also accepts the size of the output buffer for additional security checks!
tiff | TIFF file |
buffer | the buffer this function writes into, the size has to be at least TinyTIFFReader_getWidth() * TinyTIFFReader_getHeight() * TinyTIFFReader_getBitsPerSample() / 8 |
buffer_size | size of buffer |
sample | the sample to read [default: 0] |
TINYTIFF_TRUE
(non-zero) on success, if an error occured TINYTIFF_FALSE
is returned and the error message can be retrieved with TinyTIFFReader_getLastError() TINYTIFF_EXPORT uint16_t TinyTIFFReader_getSampleFormat | ( | TinyTIFFReaderFile * | tiff | ) |
return the sample format of the current frame
tiff | TIFF file |
TINYTIFF_EXPORT uint16_t TinyTIFFReader_getSamplesPerPixel | ( | TinyTIFFReaderFile * | tiff | ) |
return the samples per pixel of the current frame
tiff | TIFF file |
TINYTIFF_EXPORT uint32_t TinyTIFFReader_getWidth | ( | TinyTIFFReaderFile * | tiff | ) |
return the width of the current frame
tiff | TIFF file |
TINYTIFF_EXPORT float TinyTIFFReader_getXResolution | ( | TinyTIFFReaderFile * | tiff | ) |
return the pixels per basic resolution unit in image width direction
tiff | TIFF file |
TINYTIFF_EXPORT float TinyTIFFReader_getYResolution | ( | TinyTIFFReaderFile * | tiff | ) |
return the pixels per basic resolution unit in image height direction
tiff | TIFF file |
TINYTIFF_EXPORT int TinyTIFFReader_hasNext | ( | TinyTIFFReaderFile * | tiff | ) |
returns TINYTIFF_TRUE (non-zero) if another frame exists in the TIFF file
tiff | TIFF file |
TINYTIFF_EXPORT TinyTIFFReaderFile * TinyTIFFReader_open | ( | const char * | filename | ) |
open TIFF file for reading
filename | name of the new TIFF file |
NULL
is returned! In this case the C method open() retrned an error, so the fiel didn't exist, or you do not have permission to read it. Also if no TIFF file was detected (first twi bytes were neither 'II' nor 'MM') NULL
is returned. TINYTIFF_EXPORT int TinyTIFFReader_readNext | ( | TinyTIFFReaderFile * | tiff | ) |
reads the next frame from a multi-frame TIFF
tiff | TIFF file |
TINYTIFF_EXPORT int TinyTIFFReader_success | ( | TinyTIFFReaderFile * | tiff | ) |
returns TINYTIFF_TRUE (non-zero) when there was no error in the last function call, or TINYTIFF_FALSE if there was an error
tiff | TIFF file |
TINYTIFF_EXPORT int TinyTIFFReader_wasError | ( | TinyTIFFReaderFile * | tiff | ) |
returns TINYTIFF_TRUE (non-zero) when there was an error in the last function call, or TINYTIFF_FALSE if there was no error
tiff | TIFF file |