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;
109 friend class boost::iterator_core_access;
131 return this->
pos == rhs.
pos;
139 std::shared_ptr<Value>&
154 class TIFF :
public std::enable_shared_from_this<TIFF>
160 std::shared_ptr<Impl>
impl;
164 TIFF(
const boost::filesystem::path& filename,
165 const std::string& mode);
191 static std::shared_ptr<TIFF>
192 open(
const boost::filesystem::path& filename,
193 const std::string& mode);
334 #endif // OME_FILES_TIFF_TIFF_H
std::shared_ptr< Value > & dereference() const
Dereference the iterator.
Definition: TIFF.h:140
Internal implementation details of TIFF.
Definition: TIFF.cpp:113
Tagged Image File Format (TIFF).
Definition: TIFF.h:154
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:288
std::shared_ptr< IFD > getDirectoryByOffset(offset_type offset) const
Get an IFD by its offset in the file.
Definition: TIFF.cpp:278
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:227
~TIFF()
Destructor.
Definition: TIFF.cpp:216
wrapped_type * getWrapped() const
Get the underlying libtiff ::TIFF instance.
Definition: TIFF.cpp:221
iterator begin()
Get the first image file directory.
Definition: TIFF.cpp:308
directory_index_type directoryCount() const
Get the total number of IFDs.
Definition: TIFF.cpp:256
std::shared_ptr< IFD > getDirectoryByIndex(directory_index_type index) const
Get an IFD by its index.
Definition: TIFF.cpp:262
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:289
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:296
void registerImageJTags()
Register ImageJ tags with libtiff for this image.
Definition: TIFF.cpp:334
iterator end()
Get the last+1 image file directory.
Definition: TIFF.cpp:322
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:129
std::shared_ptr< Impl > impl
Private implementation details.
Definition: TIFF.h:158
void close()
Close the TIFF file.
Definition: TIFF.cpp:245
TIFF & operator=(const TIFF &)
Assignment operator (deleted).
IFDIterator< const IFD > const_iterator
const IFD iterator.
Definition: TIFF.h:290
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:196