ome-files
0.1.1
|
Tagged Image File Format (TIFF). More...
#include <ome/files/tiff/TIFF.h>
Classes | |
class | Impl |
Internal implementation details of TIFF. More... | |
Public Types | |
typedef IFDIterator< IFD > | iterator |
IFD iterator. | |
typedef IFDIterator< const IFD > | const_iterator |
const IFD iterator. | |
Public Member Functions | |
~TIFF () | |
Destructor. | |
void | close () |
Close the TIFF file. More... | |
operator bool () | |
Check if the TIFF file is valid. More... | |
directory_index_type | directoryCount () const |
Get the total number of IFDs. More... | |
ome::compat::shared_ptr< IFD > | getDirectoryByIndex (directory_index_type index) const |
Get an IFD by its index. More... | |
ome::compat::shared_ptr< IFD > | getDirectoryByOffset (offset_type offset) const |
Get an IFD by its offset in the file. More... | |
ome::compat::shared_ptr< IFD > | getCurrentDirectory () const |
Get the currently active IFD. More... | |
void | writeCurrentDirectory () |
Write the currently active IFD. More... | |
wrapped_type * | getWrapped () const |
Get the underlying libtiff ::TIFF instance. More... | |
iterator | begin () |
Get the first image file directory. More... | |
const_iterator | begin () const |
Get the first image file directory. More... | |
iterator | end () |
Get the last+1 image file directory. More... | |
const_iterator | end () const |
Get the last+1 image file directory. More... | |
Static Public Member Functions | |
static ome::compat::shared_ptr< TIFF > | open (const boost::filesystem::path &filename, const std::string &mode) |
Open a TIFF file for reading or writing. More... | |
Protected Member Functions | |
TIFF (const boost::filesystem::path &filename, const std::string &mode) | |
Constructor (non-public). | |
Private Member Functions | |
TIFF (const TIFF &) | |
Copy constructor (deleted). | |
TIFF & | operator= (const TIFF &) |
Assignment operator (deleted). | |
void | registerImageJTags () |
Register ImageJ tags with libtiff for this image. | |
Private Attributes | |
ome::compat::shared_ptr< Impl > | impl |
Private implementation details. | |
Friends | |
class | IFD |
Tagged Image File Format (TIFF).
This class is the primary class for reading and writing TIFF files. Use the static open() method to get a working instance. This instance may be used to get IFD instances and then access to image metadata and pixel data.
TIFF::iterator ome::files::tiff::TIFF::begin | ( | ) |
Get the first image file directory.
References getDirectoryByIndex().
Referenced by directoryCount().
TIFF::const_iterator ome::files::tiff::TIFF::begin | ( | ) | const |
Get the first image file directory.
References getDirectoryByIndex().
void ome::files::tiff::TIFF::close | ( | ) |
directory_index_type ome::files::tiff::TIFF::directoryCount | ( | ) | const |
TIFF::iterator ome::files::tiff::TIFF::end | ( | ) |
Get the last+1 image file directory.
Referenced by directoryCount().
TIFF::const_iterator ome::files::tiff::TIFF::end | ( | ) | const |
Get the last+1 image file directory.
ome::compat::shared_ptr< IFD > ome::files::tiff::TIFF::getCurrentDirectory | ( | ) | const |
Get the currently active IFD.
References ome::files::tiff::IFD::current().
Referenced by writeCurrentDirectory().
ome::compat::shared_ptr< IFD > ome::files::tiff::TIFF::getDirectoryByIndex | ( | directory_index_type | index | ) | const |
Get an IFD by its index.
index | the directory index. |
an | Exception if the index is invalid or could not be accessed. |
References ome::files::tiff::Sentry::error(), impl, and ome::files::tiff::IFD::openIndex().
Referenced by begin().
ome::compat::shared_ptr< IFD > ome::files::tiff::TIFF::getDirectoryByOffset | ( | offset_type | offset | ) | const |
Get an IFD by its offset in the file.
offset | the directory offset. |
an | Exception if the offset is invalid or could not be accessed. |
References ome::files::tiff::Sentry::error(), impl, and ome::files::tiff::IFD::openOffset().
TIFF::wrapped_type * ome::files::tiff::TIFF::getWrapped | ( | ) | const |
Get the underlying libtiff ::TIFF
instance.
If there is any need to use the libtiff C interface to access any functionality not exposed through these C++ wrapper classes, this will provide a pointer to the handle.
::TIFF
type isn't available here. After including the main <tiffio.h>
header, cast the return value to the correct type:* ::TIFF *tiff = reinterpret_cast< ::TIFF *>(myfile.getWrapped()); *
::TIFF
instance. References impl.
Referenced by registerImageJTags().
|
static |
Open a TIFF file for reading or writing.
filename | the file to open. |
mode | the file open mode (r to read, w to write or a to append). |
an | Exception on failure. |
Referenced by ome::files::in::OMETIFFReader::getTIFF(), and ome::files::out::OMETIFFWriter::setId().
ome::files::tiff::TIFF::operator bool | ( | ) |
void ome::files::tiff::TIFF::writeCurrentDirectory | ( | ) |
Write the currently active IFD.
The pixel data accompanying this IFD must have been written using IFD::writeImage() prior to calling this method, or else the TIFF tags for strip and tile offsets will be incomplete and the file will fail to read.
References ome::files::tiff::Sentry::error(), getCurrentDirectory(), impl, and ome::files::tiff::SOFTWARE.