66 static const dict_t compressionDict;
74 static dict_t::value_t defaultCompression;
84 FileTIFF(
const std::string & path =
"",
const std::string & mode =
"w") : tif(
nullptr), tile(defaultTile){
97 void open(
const std::string & path,
const std::string & mode =
"w"){
98 tif = XTIFFOpen(path.c_str(), mode.c_str());
102 bool isOpen()
const {
103 return (tif !=
nullptr);
110 mout.
debug(
"Closing TIFF...");
117 int setField(
int tag,
const std::string & value){
120 mout.
error(
"TIFF file not open");
122 return TIFFSetField(tif, tag, value.c_str());
127 int setField(
int tag,
const std::vector<T> & value){
130 mout.
error(
"TIFF file not open");
133 return TIFFSetField(tif, tag, value.size(), &value.at(0));
138 int setField(
int tag, T value){
141 mout.
error(
"TIFF file not open");
144 return TIFFSetField(tif, tag, value);
149 void useDefaultTileSize(){
150 this->tile = defaultTile;
154 void setTileSize(
int tileWidth,
int tileHeight = 0){
160 tile.setWidth(tileWidth);
161 if (tileHeight == 0){
162 tileHeight = tileWidth;
164 tile.setHeight(tileHeight);