5#ifndef OPENCV_slideio_tiffkeeper_HPP
6#define OPENCV_slideio_tiffkeeper_HPP
9#include "tifftools.hpp"
10#include "slideio/imagetools/slideio_imagetools_def.hpp"
11#include "slideio/imagetools/imagetools.hpp"
21 class SLIDEIO_IMAGETOOLS_EXPORTS TIFFKeeper
24 TIFFKeeper(libtiff::TIFF* hfile =
nullptr);
25 TIFFKeeper(
const std::string& filePath,
bool readOnly =
true);
27 libtiff::TIFF* getHandle()
const {
30 bool isValid()
const {
31 return getHandle() !=
nullptr;
33 operator libtiff::TIFF* ()
const {
36 TIFFKeeper& operator = (libtiff::TIFF* hFile) {
40 libtiff::TIFF* release() {
41 libtiff::TIFF* handle = m_hFile;
45 void openTiffFile(
const std::string& filePath,
bool readOnly =
true);
47 void writeDirectory();
48 void setTags(
const TiffDirectory& dir,
bool newDirectory);
49 void writeTile(
int x,
int y, Compression compression,
const EncodeParameters& params,
const cv::Mat& mat,
50 uint8_t* buffer,
int bufferSize);
51 void readTile(
const slideio::TiffDirectory& dir,
int tile,
52 const std::vector<int>& channelIndices, cv::OutputArray output);
53 std::string readStringTag(uint16_t tag);
56 libtiff::TIFF* m_hFile;
60#define TIFFKeeperPtr std::shared_ptr<slideio::TIFFKeeper>
Definition: exceptions.hpp:12