libpniio
|
IFD - Image File Directory class. More...
#include <ifd.hpp>
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... | |
ifd & | operator= (const ifd &o) |
copy assignment operator More... | |
ifd & | operator= (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... | |
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.
typedef std::vector<ifd_entry>::const_iterator pni::io::tiff::ifd::const_iterator |
typedef std::vector<ifd_entry>::iterator pni::io::tiff::ifd::iterator |
pni::io::tiff::ifd::ifd | ( | ) |
pni::io::tiff::ifd::ifd | ( | const ifd & | o | ) |
|
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.
size | number of elements in the entry |
pni::io::tiff::ifd::ifd | ( | ifd && | o | ) |
pni::io::tiff::ifd::~ifd | ( | ) |
|
inline |
Returns an iterator pointing on the first entry stored in the IFD.
|
inline |
Returns a const iterator to the first entry in the IFD.
|
inline |
Returns an iterator pointing on the last entry stored in the IFD.
|
inline |
Returns a const iterator to the last entry in the IFD.
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.
i | unsigned integer with the index of the entry |
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.
n | a string with the name of the entry |
|
inline |
Returns the number of entries stored in the IFD.
|
friend |
Thiss operator can be used to dump the content of an IFD to standard out.
o | output stream |
image_dir | Image directory to print |
|
protected |