Changeset View
Changeset View
Standalone View
Standalone View
src/imageformats/exr.cpp
Context not available. | |||||
172 | width = dw.max.x - dw.min.x + 1; | 172 | width = dw.max.x - dw.min.x + 1; | ||
---|---|---|---|---|---|
173 | height = dw.max.y - dw.min.y + 1; | 173 | height = dw.max.y - dw.min.y + 1; | ||
174 | 174 | | |||
175 | QImage image(width, height, QImage::Format_RGB32); | ||||
176 | if (image.isNull()) { | ||||
177 | qWarning() << "Failed to allocate image, invalid size?" << QSize(width, height); | ||||
178 | return false; | ||||
179 | } | ||||
180 | | ||||
175 | Imf::Array2D<Imf::Rgba> pixels; | 181 | Imf::Array2D<Imf::Rgba> pixels; | ||
176 | pixels.resizeErase(height, width); | 182 | pixels.resizeErase(height, width); | ||
177 | 183 | | |||
178 | file.setFrameBuffer(&pixels[0][0] - dw.min.x - dw.min.y * width, 1, width); | 184 | file.setFrameBuffer(&pixels[0][0] - dw.min.x - dw.min.y * width, 1, width); | ||
179 | file.readPixels(dw.min.y, dw.max.y); | 185 | file.readPixels(dw.min.y, dw.max.y); | ||
180 | 186 | | |||
181 | QImage image(width, height, QImage::Format_RGB32); | | |||
182 | if (image.isNull()) { | | |||
183 | return false; | | |||
184 | } | | |||
185 | | ||||
186 | // somehow copy pixels into image | 187 | // somehow copy pixels into image | ||
187 | for (int y = 0; y < height; y++) { | 188 | for (int y = 0; y < height; y++) { | ||
188 | for (int x = 0; x < width; x++) { | 189 | for (int x = 0; x < width; x++) { | ||
Context not available. |