bioformats
5.1.8
|
Image File Directory (IFD). More...
#include <ome/bioformats/tiff/IFD.h>
Classes | |
class | Impl |
Internal implementation details of OffsetIFD. More... | |
Public Member Functions | |
virtual | ~IFD () |
Destructor. | |
ome::compat::shared_ptr< TIFF > & | getTIFF () const |
Get the source TIFF this descriptor belongs to. More... | |
void | makeCurrent () const |
Make this IFD the current directory. More... | |
offset_type | getOffset () const |
Get the directory offset. More... | |
void | getRawField (tag_type tag,...) const |
Get a field by its tag number. More... | |
void | setRawField (tag_type tag,...) |
Set a field by its tag number. More... | |
template<typename TagCategory > | |
Field< TagCategory > | getField (TagCategory tag) |
Get a Field by its tag enumeration. More... | |
template<typename TagCategory > | |
const Field< TagCategory > | getField (TagCategory tag) const |
Get a Field by its tag enumeration. More... | |
TileType | getTileType () const |
Get the tile type. More... | |
void | setTileType (TileType type) |
Set the tile type. More... | |
dimension_size_type | getCurrentTile () const |
Get the current tile being written. More... | |
void | setCurrentTile (dimension_size_type tile) |
Set the current tile being written. More... | |
TileInfo | getTileInfo () |
Get tiling metadata. More... | |
const TileInfo | getTileInfo () const |
Get tiling metadata. More... | |
std::vector< TileCoverage > & | getTileCoverage () |
Get tile coverage cache. More... | |
const std::vector< TileCoverage > & | getTileCoverage () const |
Get tile coverage cache. More... | |
uint32_t | getImageWidth () const |
Get the image width. More... | |
void | setImageWidth (uint32_t width) |
Set the image width. More... | |
uint32_t | getImageHeight () const |
Get the image height. More... | |
void | setImageHeight (uint32_t height) |
Set the image height. More... | |
uint32_t | getTileWidth () const |
Get the tile width. More... | |
void | setTileWidth (uint32_t width) |
Set the tile width. More... | |
uint32_t | getTileHeight () const |
Get the tile height. More... | |
void | setTileHeight (uint32_t height) |
Set the tile height. More... | |
::ome::xml::model::enums::PixelType | getPixelType () const |
Get the OME data model PixelType. More... | |
void | setPixelType (::ome::xml::model::enums::PixelType type) |
Set the OME data model PixelType. More... | |
uint16_t | getBitsPerSample () const |
Get bits per sample. More... | |
void | setBitsPerSample (uint16_t samples) |
Set bits per sample. More... | |
uint16_t | getSamplesPerPixel () const |
Get samples per pixel. More... | |
void | setSamplesPerPixel (uint16_t samples) |
Set samples per pixel. More... | |
PlanarConfiguration | getPlanarConfiguration () const |
Get planar configuration. More... | |
void | setPlanarConfiguration (PlanarConfiguration planarconfig) |
Set planar configuration. More... | |
PhotometricInterpretation | getPhotometricInterpretation () const |
Get photometric interpretation. More... | |
void | setPhotometricInterpretation (PhotometricInterpretation photometric) |
Set photometric interpretation. More... | |
void | readImage (VariantPixelBuffer &buf) const |
Read a whole image plane into a pixel buffer. More... | |
void | readImage (VariantPixelBuffer &buf, dimension_size_type subC) const |
Read a whole image plane into a pixel buffer. More... | |
void | readImage (VariantPixelBuffer &dest, dimension_size_type x, dimension_size_type y, dimension_size_type w, dimension_size_type h) const |
Read a region of an image plane into a pixel buffer. More... | |
void | readImage (VariantPixelBuffer &dest, dimension_size_type x, dimension_size_type y, dimension_size_type w, dimension_size_type h, dimension_size_type subC) const |
Read a region of an image plane into a pixel buffer. More... | |
void | readLookupTable (VariantPixelBuffer &buf) const |
Read a lookup table into a pixel buffer. More... | |
void | writeImage (const VariantPixelBuffer &buf) |
Write a whole image plane from a pixel buffer. More... | |
void | writeImage (const VariantPixelBuffer &buf, dimension_size_type subC) |
Write a whole image plane from a pixel buffer. More... | |
void | writeImage (const VariantPixelBuffer &source, dimension_size_type x, dimension_size_type y, dimension_size_type w, dimension_size_type h) |
Write a whole image plane from a pixel buffer. More... | |
void | writeImage (const VariantPixelBuffer &source, dimension_size_type x, dimension_size_type y, dimension_size_type w, dimension_size_type h, dimension_size_type subC) |
Write a whole image plane from a pixel buffer. More... | |
ome::compat::shared_ptr< IFD > | next () const |
Get next directory. More... | |
bool | last () const |
Check if this is the last directory. More... | |
Static Public Member Functions | |
static ome::compat::shared_ptr< IFD > | openIndex (ome::compat::shared_ptr< TIFF > &tiff, directory_index_type index) |
Open an IFD by index. More... | |
static ome::compat::shared_ptr< IFD > | openOffset (ome::compat::shared_ptr< TIFF > &tiff, offset_type offset) |
Open an IFD. More... | |
static ome::compat::shared_ptr< IFD > | current (ome::compat::shared_ptr< TIFF > &tiff) |
Get the current IFD. More... | |
Protected Member Functions | |
IFD (ome::compat::shared_ptr< TIFF > &tiff, offset_type offset) | |
Constructor (not public). | |
IFD (ome::compat::shared_ptr< TIFF > &tiff) | |
Constructor (not public). | |
Private Member Functions | |
IFD (const IFD &) | |
Copy constructor (deleted). | |
IFD & | operator= (const IFD &) |
Assignment operator (deleted). | |
Private Attributes | |
ome::compat::shared_ptr< Impl > | impl |
Private implementation details. | |
|
static |
Get the current IFD.
tiff | the source TIFF. |
Referenced by ome::bioformats::tiff::TIFF::getCurrentDirectory().
uint16_t ome::bioformats::tiff::IFD::getBitsPerSample | ( | ) | const |
Get bits per sample.
References ome::bioformats::tiff::BITSPERSAMPLE, getField(), and impl.
Referenced by ome::bioformats::tiff::getCoreMetadata(), and getPixelType().
dimension_size_type ome::bioformats::tiff::IFD::getCurrentTile | ( | ) | const |
Get the current tile being written.
This is the tile currently being modified pending flush.
References impl.
|
inline |
Get a Field by its tag enumeration.
tag | the field identifier. |
Referenced by getBitsPerSample(), ome::bioformats::tiff::getCoreMetadata(), getImageHeight(), getImageWidth(), getPhotometricInterpretation(), getPixelType(), getPlanarConfiguration(), getSamplesPerPixel(), getTileHeight(), getTileType(), getTileWidth(), ome::bioformats::tiff::ImageJMetadata::ImageJMetadata(), readLookupTable(), setBitsPerSample(), setImageHeight(), setImageWidth(), setPhotometricInterpretation(), setPixelType(), setPlanarConfiguration(), setSamplesPerPixel(), setTileHeight(), and setTileWidth().
|
inline |
uint32_t ome::bioformats::tiff::IFD::getImageHeight | ( | ) | const |
Get the image height.
References getField(), ome::bioformats::tiff::IMAGELENGTH, and impl.
Referenced by ome::bioformats::tiff::getCoreMetadata(), readImage(), and writeImage().
uint32_t ome::bioformats::tiff::IFD::getImageWidth | ( | ) | const |
Get the image width.
References getField(), ome::bioformats::tiff::IMAGEWIDTH, and impl.
Referenced by ome::bioformats::tiff::getCoreMetadata(), getTileWidth(), readImage(), and writeImage().
offset_type ome::bioformats::tiff::IFD::getOffset | ( | ) | const |
Get the directory offset.
Internally this is simply a call to TIFFCurrentDirOffset.
References impl.
PhotometricInterpretation ome::bioformats::tiff::IFD::getPhotometricInterpretation | ( | ) | const |
Get photometric interpretation.
References getField(), impl, and ome::bioformats::tiff::PHOTOMETRIC.
Referenced by ome::bioformats::tiff::getCoreMetadata().
ome::xml::model::enums::PixelType ome::bioformats::tiff::IFD::getPixelType | ( | ) | const |
Get the OME data model PixelType.
This is computed based upon the SampleFormat and BitsPerSample tags for this IFD.
an | Exception if there is no corresponding PixelType for the SampleFormat and BitsPerSample in use. |
References ome::bioformats::tiff::COMPLEX_FLOAT, ome::bioformats::tiff::FLOAT, getBitsPerSample(), getField(), impl, ome::bioformats::tiff::SAMPLEFORMAT, ome::bioformats::tiff::SIGNED_INT, and ome::bioformats::tiff::UNSIGNED_INT.
Referenced by ome::bioformats::tiff::getCoreMetadata(), readImage(), setBitsPerSample(), and writeImage().
PlanarConfiguration ome::bioformats::tiff::IFD::getPlanarConfiguration | ( | ) | const |
Get planar configuration.
References getField(), impl, and ome::bioformats::tiff::PLANARCONFIG.
Referenced by ome::bioformats::tiff::getCoreMetadata(), readImage(), and writeImage().
void ome::bioformats::tiff::IFD::getRawField | ( | tag_type | tag, |
... | |||
) | const |
Get a field by its tag number.
tag | the tag number. |
... | pointers to variables to store the value(s) in. |
References ome::bioformats::tiff::Sentry::error(), getTIFF(), and makeCurrent().
uint16_t ome::bioformats::tiff::IFD::getSamplesPerPixel | ( | ) | const |
Get samples per pixel.
References getField(), impl, and ome::bioformats::tiff::SAMPLESPERPIXEL.
Referenced by ome::bioformats::tiff::getCoreMetadata(), readImage(), and writeImage().
ome::compat::shared_ptr< TIFF > & ome::bioformats::tiff::IFD::getTIFF | ( | ) | const |
Get the source TIFF this descriptor belongs to.
References impl.
Referenced by getRawField(), last(), makeCurrent(), next(), and setRawField().
std::vector< TileCoverage > & ome::bioformats::tiff::IFD::getTileCoverage | ( | ) |
const std::vector< TileCoverage > & ome::bioformats::tiff::IFD::getTileCoverage | ( | ) | const |
uint32_t ome::bioformats::tiff::IFD::getTileHeight | ( | ) | const |
Get the tile height.
References getField(), getTileType(), impl, ome::bioformats::tiff::ROWSPERSTRIP, ome::bioformats::tiff::TILE, and ome::bioformats::tiff::TILELENGTH.
TileInfo ome::bioformats::tiff::IFD::getTileInfo | ( | ) |
Get tiling metadata.
an | Exception if tiles are not supported. |
Referenced by readImage(), and writeImage().
const TileInfo ome::bioformats::tiff::IFD::getTileInfo | ( | ) | const |
TileType ome::bioformats::tiff::IFD::getTileType | ( | ) | const |
Get the tile type.
References getField(), impl, ome::bioformats::tiff::ROWSPERSTRIP, ome::bioformats::tiff::STRIP, ome::bioformats::tiff::TILE, ome::bioformats::tiff::TILELENGTH, and ome::bioformats::tiff::TILEWIDTH.
Referenced by getTileHeight(), getTileWidth(), setTileHeight(), and setTileWidth().
uint32_t ome::bioformats::tiff::IFD::getTileWidth | ( | ) | const |
Get the tile width.
References getField(), getImageWidth(), getTileType(), impl, ome::bioformats::tiff::TILE, and ome::bioformats::tiff::TILEWIDTH.
bool ome::bioformats::tiff::IFD::last | ( | ) | const |
Check if this is the last directory.
true
if last, false
otherwise. References getTIFF(), and makeCurrent().
void ome::bioformats::tiff::IFD::makeCurrent | ( | ) | const |
Make this IFD the current directory.
Internally this is simply a call to TIFFSetDirectory.
References ome::bioformats::tiff::Sentry::error(), getTIFF(), and impl.
Referenced by getRawField(), last(), next(), and setRawField().
ome::compat::shared_ptr< IFD > ome::bioformats::tiff::IFD::next | ( | ) | const |
Get next directory.
References getTIFF(), makeCurrent(), and openOffset().
|
static |
Open an IFD by index.
tiff | the source TIFF. |
index | the directory index. |
References ome::bioformats::tiff::Sentry::error(), and openOffset().
Referenced by ome::bioformats::tiff::TIFF::getDirectoryByIndex().
|
static |
Open an IFD.
tiff | the source TIFF. |
offset | the directory offset. |
Referenced by ome::bioformats::tiff::TIFF::getDirectoryByOffset(), next(), and openIndex().
void ome::bioformats::tiff::IFD::readImage | ( | VariantPixelBuffer & | buf | ) | const |
Read a whole image plane into a pixel buffer.
buf | the destination pixel buffer. |
References getImageHeight(), and getImageWidth().
Referenced by readImage().
void ome::bioformats::tiff::IFD::readImage | ( | VariantPixelBuffer & | buf, |
dimension_size_type | subC | ||
) | const |
Read a whole image plane into a pixel buffer.
buf | the destination pixel buffer. |
subC | the subchannel to read. |
References getImageHeight(), getImageWidth(), and readImage().
void ome::bioformats::tiff::IFD::readImage | ( | VariantPixelBuffer & | dest, |
dimension_size_type | x, | ||
dimension_size_type | y, | ||
dimension_size_type | w, | ||
dimension_size_type | h | ||
) | const |
Read a region of an image plane into a pixel buffer.
If the destination pixel buffer is of a different size to the region being read, or is of the incorrect pixel type, or has a different storage order, it will be resized using the correct pixel type and storage order.
dest | the destination pixel buffer. |
x | the X coordinate of the upper-left corner of the sub-image. |
y | the Y coordinate of the upper-left corner of the sub-image. |
w | the width of the sub-image. |
h | the height of the sub-image. |
References ome::bioformats::DIM_CHANNEL, ome::bioformats::DIM_MODULO_C, ome::bioformats::DIM_MODULO_T, ome::bioformats::DIM_MODULO_Z, ome::bioformats::DIM_SPATIAL_X, ome::bioformats::DIM_SPATIAL_Y, ome::bioformats::DIM_SPATIAL_Z, ome::bioformats::DIM_SUBCHANNEL, ome::bioformats::DIM_TEMPORAL_T, ome::bioformats::PixelBufferBase::dimensions, getPixelType(), getPlanarConfiguration(), getSamplesPerPixel(), getTileInfo(), ome::bioformats::PixelBufferBase::make_storage_order(), ome::bioformats::VariantPixelBuffer::pixelType(), ome::bioformats::tiff::SEPARATE, ome::bioformats::VariantPixelBuffer::setBuffer(), ome::bioformats::VariantPixelBuffer::shape(), ome::bioformats::VariantPixelBuffer::storage_order(), ome::bioformats::tiff::TileInfo::tileCoverage(), ome::bioformats::VariantPixelBuffer::vbuffer(), and ome::xml::model::enums::DimensionOrder::XYZTC.
void ome::bioformats::tiff::IFD::readImage | ( | VariantPixelBuffer & | dest, |
dimension_size_type | x, | ||
dimension_size_type | y, | ||
dimension_size_type | w, | ||
dimension_size_type | h, | ||
dimension_size_type | subC | ||
) | const |
Read a region of an image plane into a pixel buffer.
If the destination pixel buffer is of a different size to the region being read, or is of the incorrect pixel type, or has a different storage order, it will be resized using the correct pixel type and storage order.
dest | the destination pixel buffer. |
x | the X coordinate of the upper-left corner of the sub-image. |
y | the Y coordinate of the upper-left corner of the sub-image. |
w | the width of the sub-image. |
h | the height of the sub-image. |
subC | the subchannel to read. |
References readImage(), and ome::bioformats::VariantPixelBuffer::vbuffer().
void ome::bioformats::tiff::IFD::readLookupTable | ( | VariantPixelBuffer & | buf | ) | const |
Read a lookup table into a pixel buffer.
buf | the destination pixel buffer. |
References ome::bioformats::tiff::COLORMAP, ome::bioformats::DIM_CHANNEL, ome::bioformats::DIM_MODULO_C, ome::bioformats::DIM_MODULO_T, ome::bioformats::DIM_MODULO_Z, ome::bioformats::DIM_SPATIAL_X, ome::bioformats::DIM_SPATIAL_Y, ome::bioformats::DIM_SPATIAL_Z, ome::bioformats::DIM_SUBCHANNEL, ome::bioformats::DIM_TEMPORAL_T, getField(), ome::bioformats::PixelBufferBase::make_storage_order(), ome::bioformats::VariantPixelBuffer::setBuffer(), ome::bioformats::VariantPixelBuffer::vbuffer(), and ome::xml::model::enums::DimensionOrder::XYZTC.
void ome::bioformats::tiff::IFD::setBitsPerSample | ( | uint16_t | samples | ) |
Set bits per sample.
samples | the number of bits per sample. |
References ome::bioformats::tiff::BITSPERSAMPLE, getField(), getPixelType(), impl, and ome::bioformats::significantBitsPerPixel().
void ome::bioformats::tiff::IFD::setCurrentTile | ( | dimension_size_type | tile | ) |
Set the current tile being written.
This is the tile currently being modified pending flush.
tile | the current tile. |
References impl.
void ome::bioformats::tiff::IFD::setImageHeight | ( | uint32_t | height | ) |
Set the image height.
height | the image height. |
References getField(), ome::bioformats::tiff::IMAGELENGTH, and impl.
void ome::bioformats::tiff::IFD::setImageWidth | ( | uint32_t | width | ) |
Set the image width.
width | the image width. |
References getField(), ome::bioformats::tiff::IMAGEWIDTH, and impl.
void ome::bioformats::tiff::IFD::setPhotometricInterpretation | ( | PhotometricInterpretation | photometric | ) |
Set photometric interpretation.
photometric | the photometric interpretation of sample values. |
References getField(), impl, and ome::bioformats::tiff::PHOTOMETRIC.
void ome::bioformats::tiff::IFD::setPixelType | ( | ::ome::xml::model::enums::PixelType | type | ) |
Set the OME data model PixelType.
This sets the SampleFormat and BitsPerSample tags for this IFD which correspond to the PixelType in use.
type | the PixelType to set. |
an | Exception if the PixelType is invalid. |
References ome::bioformats::tiff::COMPLEX_FLOAT, ome::bioformats::tiff::FLOAT, getField(), impl, ome::bioformats::tiff::SAMPLEFORMAT, ome::bioformats::tiff::SIGNED_INT, and ome::bioformats::tiff::UNSIGNED_INT.
void ome::bioformats::tiff::IFD::setPlanarConfiguration | ( | PlanarConfiguration | planarconfig | ) |
Set planar configuration.
planarconfig | the number of planar configuration. |
References getField(), impl, and ome::bioformats::tiff::PLANARCONFIG.
void ome::bioformats::tiff::IFD::setRawField | ( | tag_type | tag, |
... | |||
) |
Set a field by its tag number.
tag | the tag number. |
... | variables containing the value(s) to set. |
References ome::bioformats::tiff::Sentry::error(), getTIFF(), and makeCurrent().
void ome::bioformats::tiff::IFD::setSamplesPerPixel | ( | uint16_t | samples | ) |
Set samples per pixel.
samples | the number of samples per pixel. |
References getField(), impl, and ome::bioformats::tiff::SAMPLESPERPIXEL.
void ome::bioformats::tiff::IFD::setTileHeight | ( | uint32_t | height | ) |
Set the tile height.
height | the tile height. |
References getField(), getTileType(), impl, ome::bioformats::tiff::ROWSPERSTRIP, ome::bioformats::tiff::TILE, and ome::bioformats::tiff::TILELENGTH.
void ome::bioformats::tiff::IFD::setTileType | ( | TileType | type | ) |
void ome::bioformats::tiff::IFD::setTileWidth | ( | uint32_t | width | ) |
Set the tile width.
width | the tile width. |
References getField(), getTileType(), impl, ome::bioformats::tiff::TILE, and ome::bioformats::tiff::TILEWIDTH.
void ome::bioformats::tiff::IFD::writeImage | ( | const VariantPixelBuffer & | buf | ) |
Write a whole image plane from a pixel buffer.
buf | the source pixel buffer. |
References getImageHeight(), and getImageWidth().
Referenced by writeImage().
void ome::bioformats::tiff::IFD::writeImage | ( | const VariantPixelBuffer & | buf, |
dimension_size_type | subC | ||
) |
Write a whole image plane from a pixel buffer.
buf | the source pixel buffer. |
subC | the subchannel to write. |
References getImageHeight(), getImageWidth(), and writeImage().
void ome::bioformats::tiff::IFD::writeImage | ( | const VariantPixelBuffer & | source, |
dimension_size_type | x, | ||
dimension_size_type | y, | ||
dimension_size_type | w, | ||
dimension_size_type | h | ||
) |
Write a whole image plane from a pixel buffer.
The source pixel buffer must match the size of the region being written, and must also the same pixel type and storage ordering as the TIFF image.
source | the source pixel buffer. |
x | the X coordinate of the upper-left corner of the sub-image. |
y | the Y coordinate of the upper-left corner of the sub-image. |
w | the width of the sub-image. |
h | the height of the sub-image. |
References ome::bioformats::DIM_CHANNEL, ome::bioformats::DIM_MODULO_C, ome::bioformats::DIM_MODULO_T, ome::bioformats::DIM_MODULO_Z, ome::bioformats::DIM_SPATIAL_X, ome::bioformats::DIM_SPATIAL_Y, ome::bioformats::DIM_SPATIAL_Z, ome::bioformats::DIM_SUBCHANNEL, ome::bioformats::DIM_TEMPORAL_T, ome::bioformats::PixelBufferBase::dimensions, getPixelType(), getPlanarConfiguration(), getSamplesPerPixel(), getTileInfo(), impl, ome::bioformats::PixelBufferBase::make_storage_order(), ome::bioformats::VariantPixelBuffer::pixelType(), ome::bioformats::tiff::SEPARATE, ome::bioformats::VariantPixelBuffer::shape(), ome::bioformats::VariantPixelBuffer::storage_order(), ome::bioformats::tiff::TileInfo::tileCoverage(), ome::bioformats::VariantPixelBuffer::vbuffer(), and ome::xml::model::enums::DimensionOrder::XYZTC.
void ome::bioformats::tiff::IFD::writeImage | ( | const VariantPixelBuffer & | source, |
dimension_size_type | x, | ||
dimension_size_type | y, | ||
dimension_size_type | w, | ||
dimension_size_type | h, | ||
dimension_size_type | subC | ||
) |
Write a whole image plane from a pixel buffer.
The source pixel buffer must match the size of the region being written, and must also the same pixel type and storage ordering as the TIFF image.
source | the source pixel buffer. |
x | the X coordinate of the upper-left corner of the sub-image. |
y | the Y coordinate of the upper-left corner of the sub-image. |
w | the width of the sub-image. |
h | the height of the sub-image. |
subC | the subchannel to write. |