38 #ifndef OME_FILES_TIFF_TIFF_H
39 #define OME_FILES_TIFF_TIFF_H
45 #include <boost/filesystem/path.hpp>
46 #include <boost/iterator/iterator_facade.hpp>
48 #include <ome/files/tiff/Types.h>
65 template<
typename Value>
66 class IFDIterator :
public boost::iterator_facade<IFDIterator<Value>,
67 std::shared_ptr<Value>,
68 boost::forward_traversal_tag>
96 template <
class OtherValue>
107 mutable std::shared_ptr<Value>
pos;
133 return this->
pos == rhs.
pos;
141 std::shared_ptr<Value>&
156 class TIFF :
public std::enable_shared_from_this<TIFF>
162 std::shared_ptr<Impl>
impl;
173 TIFF(
const boost::filesystem::path& filename,
174 const std::string& mode);
180 operator= (
const TIFF&) =
delete;
199 static std::shared_ptr<TIFF>
200 open(
const boost::filesystem::path& filename,
201 const std::string& mode);
343 #endif // OME_FILES_TIFF_TIFF_H
std::shared_ptr< Value > & dereference() const
Dereference the iterator.
Definition: TIFF.h:142
Internal implementation details of TIFF.
Definition: TIFF.cpp:109
Tagged Image File Format (TIFF).
Definition: TIFF.h:156
std::shared_ptr< Value > pos
The current position.
Definition: TIFF.h:107
IFDIterator()
Default constructor.
Definition: TIFF.h:76
IFDIterator< IFD > iterator
IFD iterator.
Definition: TIFF.h:297
std::shared_ptr< IFD > getDirectoryByOffset(offset_type offset) const
Get an IFD by its offset in the file.
Definition: TIFF.cpp:272
void increment()
Increment the iterator by one position.
static std::shared_ptr< TIFF > open(const boost::filesystem::path &filename, const std::string &mode)
Open a TIFF file for reading or writing.
Definition: TIFF.cpp:221
~TIFF()
Destructor.
Definition: TIFF.cpp:210
wrapped_type * getWrapped() const
Get the underlying libtiff ::TIFF instance.
Definition: TIFF.cpp:215
iterator begin()
Get the first image file directory.
Definition: TIFF.cpp:302
directory_index_type directoryCount() const
Get the total number of IFDs.
Definition: TIFF.cpp:250
std::shared_ptr< IFD > getDirectoryByIndex(directory_index_type index) const
Get an IFD by its index.
Definition: TIFF.cpp:256
uint64_t offset_type
IFD offset.
Definition: Types.h:65
Iterator for IFDs contained within a TIFF.
Definition: TIFF.h:66
std::shared_ptr< IFD > getCurrentDirectory() const
Get the currently active IFD.
Definition: TIFF.cpp:283
IFDIterator(std::shared_ptr< IFD > &ifd)
Construct with an initial starting position.
Definition: TIFF.h:87
void writeCurrentDirectory()
Write the currently active IFD.
Definition: TIFF.cpp:290
void registerImageJTags()
Register ImageJ tags with libtiff for this image.
Definition: TIFF.cpp:328
iterator end()
Get the last+1 image file directory.
Definition: TIFF.cpp:316
IFDIterator(const IFDIterator< OtherValue > &rhs)
Construct from an existing iterator.
Definition: TIFF.h:97
bool equal(IFDIterator const &rhs) const
Check for equality.
Definition: TIFF.h:131
std::shared_ptr< Impl > impl
Private implementation details.
Definition: TIFF.h:160
void close()
Close the TIFF file.
Definition: TIFF.cpp:239
friend class boost::iterator_core_access
IFD iterator internals uses internal TIFF state.
Definition: TIFF.h:110
IFDIterator< const IFD > const_iterator
const IFD iterator.
Definition: TIFF.h:299
uint16_t directory_index_type
IFD index.
Definition: Types.h:62
Image File Directory (IFD).
Definition: IFD.h:70
TIFF(const boost::filesystem::path &filename, const std::string &mode)
Constructor (non-public).
Definition: TIFF.cpp:190