67 static const dict_t compressionDict;
75 static dict_t::value_t defaultCompression;
85 FileTIFF(
const std::string & path =
"",
const std::string & mode =
"w") : tif(
nullptr), tile(defaultTile){
98 void open(
const std::string & path,
const std::string & mode =
"w"){
99 tif = XTIFFOpen(path.c_str(), mode.c_str());
103 bool isOpen()
const {
104 return (tif !=
nullptr);
111 mout.
debug(
"Closing TIFF...");
118 int setField(
int tag,
const std::string & value){
121 mout.
error(
"TIFF file not open");
123 return TIFFSetField(tif, tag, value.c_str());
128 int setField(
int tag,
const std::vector<T> & value){
131 mout.
error(
"TIFF file not open");
134 return TIFFSetField(tif, tag, value.size(), &value.at(0));
139 int setField(
int tag, T value){
142 mout.
error(
"TIFF file not open");
145 return TIFFSetField(tif, tag, value);
150 void useDefaultTileSize(){
151 this->tile = defaultTile;
155 void setTileSize(
int tileWidth,
int tileHeight = 0){
161 tile.setWidth(tileWidth);
162 if (tileHeight == 0){
163 tileHeight = tileWidth;
165 tile.setHeight(tileHeight);