31 #ifndef DRAIN_TIFF_H_EXPERIMENTAL
32 #define DRAIN_TIFF_H_EXPERIMENTAL
34 #include <drain/Log.h>
35 #include "drain/util/FileInfo.h"
36 #include "drain/util/Dictionary.h"
37 #include "drain/util/Time.h"
41 #ifndef USE_GEOTIFF_NO
69 const dict_t & getCompressionDict();
73 static dict_t::value_t defaultCompression;
79 #ifndef USE_GEOTIFF_NO
83 FileTIFF(
const std::string & path =
"",
const std::string & mode =
"w") : tif(
nullptr), tile(defaultTile){
96 void open(
const std::string & path,
const std::string & mode =
"w"){
97 tif = XTIFFOpen(path.c_str(), mode.c_str());
101 bool isOpen()
const {
102 return (tif !=
nullptr);
109 mout.
debug(
"Closing TIFF...");
116 int setField(
int tag,
const std::string & value){
119 mout.
error(
"TIFF file not open");
121 return TIFFSetField(tif, tag, value.c_str());
126 int setField(
int tag,
const std::vector<T> & value){
129 mout.
error(
"TIFF file not open");
132 return TIFFSetField(tif, tag, value.size(), &value.at(0));
137 int setField(
int tag, T value){
140 mout.
error(
"TIFF file not open");
143 return TIFFSetField(tif, tag, value);
148 void useDefaultTileSize(){
149 this->tile = defaultTile;
153 void setTileSize(
int tileWidth,
int tileHeight = 0){
159 tile.setWidth(tileWidth);
160 if (tileHeight == 0){
161 tileHeight = tileWidth;
163 tile.setHeight(tileHeight);
Definition: FileInfo.h:97
Definition: FileInfo.h:48
LogSourc e is the means for a function or any program segment to "connect" to a Log.
Definition: Log.h:308
Logger & error(const TT &... args)
Echoes.
Definition: Log.h:412
Logger & debug(const TT &... args)
Public, yet typically used "internally", when TIMING=true.
Definition: Log.h:676
Utility for handling time. Internally, uses tm (C time structure).
Definition: Time.h:54
For writing images in basic TIFF format. Reading not supported currently.
Definition: FileTIFF.h:58
static void write(const std::string &path, const drain::image::Image &src)
Default implementation.
Definition: FileTIFF.cpp:303
void writeImageData(const drain::image::Image &src)
Definition: FileTIFF.cpp:114
Class for multi-channel digital images. Supports dynamic typing with base types (char,...
Definition: Image.h:184
Definition: DataSelector.cpp:1277