Simplify Image by flipping RADIANCE images. (#63)
* Simplify Image by flipping RADIANCE images. Unit test for the new flip() method is forthcoming. * Optimize image flipping.
This commit is contained in:
committed by
Romain Guy
parent
0f20068775
commit
07c34ee833
@@ -364,15 +364,13 @@ Image HDRDecoder::decode() {
|
||||
} while (true);
|
||||
}
|
||||
|
||||
uint32_t flags = 0;
|
||||
if (sx == '-') flags |= Image::FLIP_X;
|
||||
|
||||
// Experimentally, "-Y" means vertical origin at the top, "+Y" at the bottom
|
||||
if (sy == '+') flags |= Image::FLIP_Y;
|
||||
|
||||
std::unique_ptr<uint8_t[]> data(new uint8_t[width * height * sizeof(math::float3)]);
|
||||
Image image(std::move(data), width, height, width*sizeof(math::float3), sizeof(math::float3));
|
||||
image.setFlags(flags);
|
||||
|
||||
uint32_t flags = 0;
|
||||
if (sx == '-') flags |= Image::FLIP_X;
|
||||
if (sy == '+') flags |= Image::FLIP_Y;
|
||||
image.flip(flags);
|
||||
|
||||
uint16_t w;
|
||||
uint16_t magic;
|
||||
|
||||
Reference in New Issue
Block a user