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
68 static const dict_t compressionDict;
76 static dict_t::value_t defaultCompression;
82 #ifndef USE_GEOTIFF_NO
86 FileTIFF(
const std::string & path =
"",
const std::string & mode =
"w") : tif(
nullptr), tile(defaultTile){
99 void open(
const std::string & path,
const std::string & mode =
"w"){
100 tif = XTIFFOpen(path.c_str(), mode.c_str());
104 bool isOpen()
const {
105 return (tif !=
nullptr);
112 mout.
debug(
"Closing TIFF...");
119 int setField(
int tag,
const std::string & value){
122 mout.
error(
"TIFF file not open");
124 return TIFFSetField(tif, tag, value.c_str());
129 int setField(
int tag,
const std::vector<T> & value){
132 mout.
error(
"TIFF file not open");
135 return TIFFSetField(tif, tag, value.size(), &value.at(0));
140 int setField(
int tag, T value){
143 mout.
error(
"TIFF file not open");
146 return TIFFSetField(tif, tag, value);
151 void useDefaultTileSize(){
152 this->tile = defaultTile;
156 void setTileSize(
int tileWidth,
int tileHeight = 0){
162 tile.setWidth(tileWidth);
163 if (tileHeight == 0){
164 tileHeight = tileWidth;
166 tile.setHeight(tileHeight);
Two-way mapping between strings and objects of template class T.
Definition: Dictionary.h:63
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:310
Logger & error(const TT &... args)
Echoes.
Definition: Log.h:414
Logger & debug(const TT &... args)
Public, yet typically used "internally", when TIMING=true.
Definition: Log.h:678
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:317
void writeImageData(const drain::image::Image &src)
Definition: FileTIFF.cpp:128
Class for multi-channel digital images. Supports dynamic typing with base types (char,...
Definition: Image.h:184
Definition: DataSelector.cpp:1277