libpniio
|
class for IFD entries More...
#include <ifd_entry.hpp>
Public Member Functions | |
ifd_entry () | |
default constructor More... | |
ifd_entry (const ifd_entry &e) | |
copy constructor More... | |
ifd_entry (ifd_entry &&e) | |
move constructor More... | |
ifd_entry (uint16 tag, ifd_entry_type_id tid, size_t size, std::streampos data) | |
standard constructor More... | |
~ifd_entry () | |
destructor More... | |
ifd_entry & | operator= (const ifd_entry &e) |
copy assignment operator More... | |
ifd_entry & | operator= (ifd_entry &&e) |
move assignment operator More... | |
size_t | size () const |
number of elements More... | |
string | name () const |
get name More... | |
type_id_t | type_id () const |
get type ID More... | |
template<typename T > | |
std::vector< T > | value (std::ifstream &stream) |
get entry value More... | |
Static Public Member Functions | |
static ifd_entry | create_from_stream (std::ifstream &stream) |
create entry from stream More... | |
Private Member Functions | |
template<typename T > | |
void | _read_entry_data (std::vector< T > &r, std::ifstream &stream) |
read entry data from stream More... | |
void | _read_entry_data (std::vector< string > &r, std::ifstream &stream) |
read string entry from stream More... | |
Private Attributes | |
uint16 | _tag |
ID of the entry. More... | |
ifd_entry_type_id | _tid |
type id of the entry More... | |
size_t | _size |
number of elements of the entry More... | |
std::streampos | _data |
marks data position More... | |
Friends | |
std::ostream & | operator<< (std::ostream &o, const ifd_entry &e) |
output operator More... | |
This class can manage the content of a single IFDEntry.
pni::io::tiff::ifd_entry::ifd_entry | ( | ) |
pni::io::tiff::ifd_entry::ifd_entry | ( | const ifd_entry & | e | ) |
pni::io::tiff::ifd_entry::ifd_entry | ( | ifd_entry && | e | ) |
pni::io::tiff::ifd_entry::ifd_entry | ( | uint16 | tag, |
ifd_entry_type_id | tid, | ||
size_t | size, | ||
std::streampos | data | ||
) |
Standard constructor to create a IFDEntry.
tag | TIFF tag of the entry |
tid | type ID of the entry |
size | number of elements stored in this entry |
data | starting position of data in the stream |
pni::io::tiff::ifd_entry::~ifd_entry | ( | ) |
|
private |
Reads the entrys data from an input stream. This method assumes that the input stream points to the first element of the entry. The position of the stream is altered. It is the responsibility of the calling method to take care about the position of the stream.
r | vector where to store the data |
stream | input stream from which to read |
|
private |
Reads a string entry from the stream. The stream position will be altered by this method. Thus the calling method must take care about this.
r | vector where to store data |
stream | input stream from which to read |
|
static |
A static factory method to create an instance of IFDEntry from a stream.
stream | input stream from which to read data |
pni::core::string pni::io::tiff::ifd_entry::name | ( | ) | const |
Returns the name of the entry as a string.
size_t pni::io::tiff::ifd_entry::size | ( | ) | const |
Returns the number of elements that make up the entry.
pni::core::type_id_t pni::io::tiff::ifd_entry::type_id | ( | ) | const |
Returns the TypeID of the entries type.
std::vector< T > pni::io::tiff::ifd_entry::value | ( | std::ifstream & | stream | ) |
Template returns the value of the entry and returs it as a vector of type T. Entries are in general considered as arrays (vectors) in TIFF. Thus the std::vector type is used to represent each entry.
The method makes no assumption about the position of the stream pointer neither does it alter its state.
stream | input stream from which data will be read |
|
friend |
|
private |
|
private |
|
private |
|
private |