68 static const dict_t compressionDict;
76 static dict_t::value_t defaultCompression;
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);