45 int mult = (type == Isis::UnsignedByte) ? 1 : 2;
53 "Could not allocate enough memory",
_FILEINFO_);
67 m_image = TIFFOpen(outputName.expanded().toAscii().data(),
"w");
76 TIFFSetField(
m_image, TIFFTAG_ROWSPERSTRIP, 1);
77 TIFFSetField(
m_image, TIFFTAG_COMPRESSION, COMPRESSION_DEFLATE);
78 TIFFSetField(
m_image, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
80 TIFFSetField(
m_image, TIFFTAG_PHOTOMETRIC,
81 bands() == 1 ? PHOTOMETRIC_MINISBLACK : PHOTOMETRIC_RGB);
84 int bps = (type == Isis::UnsignedByte) ? 8 : 16;
85 TIFFSetField(
m_image, TIFFTAG_BITSPERSAMPLE, bps);
103 int index = s *
bands() + b;
107 m_raster[index] = (
unsigned char) dn;
110 ((
short int *)
m_raster)[index] = (
short int) dn;
113 ((
short unsigned int *)
m_raster)[index] = (
short unsigned int) dn;
117 "Invalid pixel type for data [" +
toString(type) +
"]",
144 return format ==
"tiff";