38 #ifndef OME_FILES_TIFF_TIFF_H
39 #define OME_FILES_TIFF_TIFF_H
43 #include <boost/iterator/iterator_facade.hpp>
45 #include <ome/files/tiff/Types.h>
67 template<
typename Value>
68 class IFDIterator :
public boost::iterator_facade<IFDIterator<Value>,
69 ome::compat::shared_ptr<Value>,
70 boost::forward_traversal_tag>
98 template <
class OtherValue>
109 mutable ome::compat::shared_ptr<Value>
pos;
111 friend class boost::iterator_core_access;
133 return this->pos == rhs.
pos;
141 ome::compat::shared_ptr<Value>&
156 class TIFF :
public ome::compat::enable_shared_from_this<TIFF>
162 ome::compat::shared_ptr<Impl>
impl;
166 TIFF(
const boost::filesystem::path& filename,
167 const std::string& mode);
193 static ome::compat::shared_ptr<TIFF>
194 open(
const boost::filesystem::path& filename,
195 const std::string& mode);
231 ome::compat::shared_ptr<IFD>
242 ome::compat::shared_ptr<IFD>
251 ome::compat::shared_ptr<IFD>
336 #endif // OME_FILES_TIFF_TIFF_H
ome::compat::shared_ptr< IFD > getDirectoryByIndex(directory_index_type index) const
Get an IFD by its index.
Definition: TIFF.cpp:252
Internal implementation details of TIFF.
Definition: TIFF.cpp:108
Tagged Image File Format (TIFF).
Definition: TIFF.h:156
IFDIterator()
Default constructor.
Definition: TIFF.h:78
IFDIterator< IFD > iterator
IFD iterator.
Definition: TIFF.h:290
void increment()
Increment the iterator by one position.
ome::compat::shared_ptr< Value > pos
The current position.
Definition: TIFF.h:109
~TIFF()
Destructor.
Definition: TIFF.cpp:198
wrapped_type * getWrapped() const
Get the underlying libtiff ::TIFF instance.
Definition: TIFF.cpp:203
iterator begin()
Get the first image file directory.
Definition: TIFF.cpp:300
directory_index_type directoryCount() const
Get the total number of IFDs.
Definition: TIFF.cpp:238
uint64_t offset_type
IFD offset.
Definition: Types.h:56
Iterator for IFDs contained within a TIFF.
Definition: TIFF.h:68
void writeCurrentDirectory()
Write the currently active IFD.
Definition: TIFF.cpp:288
ome::compat::shared_ptr< IFD > getCurrentDirectory() const
Get the currently active IFD.
Definition: TIFF.cpp:281
void registerImageJTags()
Register ImageJ tags with libtiff for this image.
Definition: TIFF.cpp:326
static ome::compat::shared_ptr< TIFF > open(const boost::filesystem::path &filename, const std::string &mode)
Open a TIFF file for reading or writing.
Definition: TIFF.cpp:209
iterator end()
Get the last+1 image file directory.
Definition: TIFF.cpp:314
IFDIterator(const IFDIterator< OtherValue > &rhs)
Construct from an existing iterator.
Definition: TIFF.h:99
bool equal(IFDIterator const &rhs) const
Check for equality.
Definition: TIFF.h:131
ome::compat::shared_ptr< Value > & dereference() const
Dereference the iterator.
Definition: TIFF.h:142
ome::compat::shared_ptr< Impl > impl
Private implementation details.
Definition: TIFF.h:160
void close()
Close the TIFF file.
Definition: TIFF.cpp:227
TIFF & operator=(const TIFF &)
Assignment operator (deleted).
IFDIterator< const IFD > const_iterator
const IFD iterator.
Definition: TIFF.h:292
uint16_t directory_index_type
IFD index.
Definition: Types.h:53
Image File Directory (IFD).
Definition: IFD.h:71
ome::compat::shared_ptr< IFD > getDirectoryByOffset(offset_type offset) const
Get an IFD by its offset in the file.
Definition: TIFF.cpp:264
IFDIterator(ome::compat::shared_ptr< IFD > &ifd)
Construct with an initial starting position.
Definition: TIFF.h:89
TIFF(const boost::filesystem::path &filename, const std::string &mode)
Constructor (non-public).
Definition: TIFF.cpp:191