4 #include <QImageWriter>
28 else if (format ==
"jpeg")
30 else if (format ==
"tiff")
32 else if (format ==
"gif")
34 else if (format ==
"bmp")
56 QString msg =
"Invalid pixel type. The Qt exporter for file type [";
58 msg +=
"] requires an unsigned byte (i.e. 8BIT) output.";
79 for (
int i = 0; i < 256; i++) {
80 colors.push_back(qRgb(i, i, i));
120 Buffer &grayLine = *in[0];
124 int lineIndex = grayLine.
Line() - 1;
125 for (
int sampleIndex = 0; sampleIndex < grayLine.
SampleDimension(); sampleIndex++) {
130 m_qimage->setPixel(sampleIndex, lineIndex, pixelValue);
131 if (!
m_qimage->valid(sampleIndex, lineIndex)) {
132 QString msg =
"Qt has detected your file size as exceeding 2GB.";
133 msg +=
" While your image might be under 2GB, your image labels are more";
134 msg +=
" than likely pushing the file size over 2GB.";
148 Buffer &greenLine = *in[1];
149 Buffer &blueLine = *in[2];
151 QRgb *line = (QRgb *)
m_qimage->scanLine(redLine.
Line() - 1);
157 line[s] = qRgb(red, green, blue);
169 Buffer &greenLine = *in[1];
170 Buffer &blueLine = *in[2];
171 Buffer &alphaLine = *in[3];
173 QRgb *line = (QRgb *)
m_qimage->scanLine(redLine.
Line() - 1);
180 line[s] = qRgba(red, green, blue, alpha);
194 QString compression) {
202 QString err =
"Unable to save [" + outputName.expanded() +
219 BigInt maxSize = (BigInt) 2 * 1024 * 1024 * 1024;
221 BigInt size = samples * lines *
bands;
222 if (size >= maxSize) {
223 QString gigaBytes =
toString(size / (1024.0 * 1024.0 * 1024.0));
224 QString msg =
"Cube exceeds max size of 2GB. Qimage cannot support ";
225 msg +=
"that much raw data. Your cube is " + gigaBytes +
" GB.";
239 bool supported =
false;
242 while (it != list.end() && !supported) {
243 if (*it == QString(format)) supported =
true;