Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

CExifEntry Class Reference

EXIF data entry in an image file. More...

#include <ExifEntry.hpp>

Collaboration diagram for CExifEntry:

Collaboration graph
[legend]
List of all members.

Public Member Functions

Private Member Functions

Private Attributes

Friends

Classes


Detailed Description

EXIF data entry in an image file.

this class represents a data entry in a EXIF file.


Constructor & Destructor Documentation

CExifEntry tag_t  tag,
const TagSpace tspace
 

construct a dummy entry for binary searching with the tag. use only when binary search:

    iterator it = std::lower_bound( m_entries.begin( ), m_entries.end( ),
                                    CExifEntry( tag, tspace ) ) ;

CExifEntry tag_t  tag,
const TagSpace tspace,
uint16_t  type,
uint32_t  count,
uint32_t  offset,
CTiff file
 

initialize the entry with all known values


Member Function Documentation

template const double As< double > std::size_t  idx = 0  )  const
 

retrieve the value in the entry as a type T. the data will be converted from the actual type stored in the entry to the requested type T, i.e. there is no undefined behaviour even if the requested type and the actual type is different.

Parameters:
idx the index of the value to be retrived. since entry can store multiple instances of values, you need to provide the index of the value you want.
T template parameter to be explicitly specified. it can be one of the following types: uint8_t, uint16_t, uint32_t, int8_t, int16_t, int32_t, Rational<uint32_t>, Rational<int32_t>, double and std::string.
Note:
when T is std::string, all instances of values in the entry will be formatted to the resulting string. thus "idx" will be ignored.
Returns:
the converted value of the entry
Exceptions:
std::runtime_error when trying to convert a string value to any type other than std::string.

unsigned char * Data  ) 
 

return the raw data read from the file. it will be in the file byte order, not host byte order.

void EnsureDataReady  )  const [private]
 

ensure the data is available by reading them from file if needed. do nothing if the data is already ready.

std::string Format  )  const
 

returns a formatted string of the value of the entry. this function will translate the value of tag properly according to the type of the tag.

Parameters:
idx ignored
Returns:
the formatted string

bool IsDataReady  )  const [private]
 

return true if the data has already been read from file. the Formatted() function will read it if it returns false.

bool IsReference  )  const [private]
 

according to the TIFF spec, if the size of the field is less than 4 bytes, the value will be encoded in the offset field. in this case, this function will return false.

Returns:
return true if the data is stored somewhere in the file pointed by m_offset. return false if the data is stored AS m_offset.

const char * LongName  )  const
 

return the long name of the tag. it is a human readable name that can be shown in user interfaces.

Returns:
name of the tag. the member is static. the caller does not need to free it.

bool operator< const CExifEntry rhs  )  const
 

provides a sort order for CExifEntry objects. used in std::map's or binary searches

uint32_t Size  )  const
 

size of the data in bytes

tag_t Tag  )  const
 

returns the tag ID of the entry. the value of the tag is defined by the EXIF spec.

const char * TagName  )  const
 

return the short name of tag. it is an abbeviation without spaces in between.

Returns:
name of the tag. the member is static. the caller does not need to free it.


Friends And Related Function Documentation

std::ostream& operator<< std::ostream &  os,
const CExifEntry e
[friend]
 

output a formatted string of the entry to the ostream "os". this function will translate the value of tag properly according to the type of the tag.


Member Data Documentation

std::vector<unsigned char> m_data [mutable, private]
 

cached data. if empty(), data is either not read from file yet or the data is small enough to be packed in m_offset (i.e. IsReference() returns false). it is always in the byte order of the file (i.e. not swapped)


The documentation for this class was generated from the following files:
Generated on Fri Jan 13 23:38:27 2006 for picinfo by  doxygen 1.4.4