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:
Philip Rideout
2018-08-09 17:30:17 -07:00
committed by Romain Guy
parent 0f20068775
commit 07c34ee833
8 changed files with 47 additions and 48 deletions

View File

@@ -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;