libpniio
Public Types | Public Member Functions | Protected Attributes | Friends
pni::io::tiff::ifd Class Reference

IFD - Image File Directory class. More...

#include <ifd.hpp>

Collaboration diagram for pni::io::tiff::ifd:
Collaboration graph
[legend]

Public Types

typedef std::vector< ifd_entry >
::iterator 
iterator
 iterator over IDF entries in IDFList More...
 
typedef std::vector< ifd_entry >
::const_iterator 
const_iterator
 const. iterator over IDF entries in IDF List More...
 

Public Member Functions

 ifd ()
 default constructor More...
 
 ifd (const ifd &o)
 copy constructor More...
 
 ifd (size_t size)
 standard constructor More...
 
 ifd (ifd &&o)
 move constructor More...
 
 ~ifd ()
 destructor More...
 
ifdoperator= (const ifd &o)
 copy assignment operator More...
 
ifdoperator= (ifd &&o)
 move assignment operator More...
 
size_t size () const
 get number of IFD entries More...
 
ifd_entry operator[] (size_t i) const
 operator to obtain an entry by index More...
 
ifd_entry operator[] (const string &n) const
 operator to obtain an entry by its name More...
 
iterator begin ()
 get first iterator More...
 
iterator end ()
 get last iterator More...
 
const_iterator begin () const
 get const first iterator More...
 
const_iterator end () const
 get const last iterator More...
 

Protected Attributes

std::vector< ifd_entry_entries
 list of IFD entries More...
 

Friends

std::ostream & operator<< (std::ostream &o, const ifd &image_dir)
 overloaded ostream operator for standard output More...
 

Detailed Description

This class describes an Image File Directory (IFD) block in a TIFF file. Each IFD is associated with a single image. An IFD can be considered as a container for IFD entries. Each of this entries has a particular type and one or several values of this type. The entries can be obtained using the [] operator in two different fashions: once with in integer argument representing the index of the entry in the IFD or with a string giving the name of the entry (if the entry is according to the standard). The TIFF specification defines a group of standard entries with defines names.

The IFD class behaves like a C++ container providing iterators to run over all entries stored in the IFD.

Member Typedef Documentation

Constructor & Destructor Documentation

pni::io::tiff::ifd::ifd ( )
pni::io::tiff::ifd::ifd ( const ifd o)
pni::io::tiff::ifd::ifd ( size_t  size)
explicit

This constructor assumes that the stream points to the first element of the IFD which must hold the number of entries. Once construction is finished the stream will point to the offset of the next IFD. The calling programm can immediately read the offset and proceed with the next IFD.

Parameters
sizenumber of elements in the entry
pni::io::tiff::ifd::ifd ( ifd &&  o)
pni::io::tiff::ifd::~ifd ( )

Member Function Documentation

iterator pni::io::tiff::ifd::begin ( )
inline

Returns an iterator pointing on the first entry stored in the IFD.

Returns
iterator
const_iterator pni::io::tiff::ifd::begin ( ) const
inline

Returns a const iterator to the first entry in the IFD.

Returns
const iterator
iterator pni::io::tiff::ifd::end ( )
inline

Returns an iterator pointing on the last entry stored in the IFD.

Returns
iterator
const_iterator pni::io::tiff::ifd::end ( ) const
inline

Returns a const iterator to the last entry in the IFD.

Returns
const iterator
ifd & pni::io::tiff::ifd::operator= ( const ifd o)
ifd & pni::io::tiff::ifd::operator= ( ifd &&  o)
ifd_entry pni::io::tiff::ifd::operator[] ( size_t  i) const

This woks for all entries stored in the IFD also for those not defined by the TIFF specification. If the index requested exceeds the number of entries stored in the IFD an exception will be raised.

Parameters
iunsigned integer with the index of the entry
Returns
smart pointer to an IFDAbstractEntry object
ifd_entry pni::io::tiff::ifd::operator[] ( const string &  n) const

This operator works only for entries which are defined in the TIFF specification. If the requested entry is not available an exception will be raised.

Parameters
na string with the name of the entry
Returns
smart pointer to an IFDAbstractEntry
size_t pni::io::tiff::ifd::size ( ) const
inline

Returns the number of entries stored in the IFD.

Returns
number of IFDs

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  o,
const ifd image_dir 
)
friend

Thiss operator can be used to dump the content of an IFD to standard out.

Parameters
ooutput stream
image_dirImage directory to print
Returns
output stream

Field Documentation

std::vector<ifd_entry> pni::io::tiff::ifd::_entries
protected

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