comparison UnitTests/PngWriter.cpp @ 369:4632a044746e

simplification of the code
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 19 Feb 2013 12:09:03 +0100
parents 80011cd589e6
children
comparison
equal deleted inserted replaced
368:80011cd589e6 369:4632a044746e
48 TEST(PngWriter, Gray16Pattern) 48 TEST(PngWriter, Gray16Pattern)
49 { 49 {
50 Orthanc::PngWriter w; 50 Orthanc::PngWriter w;
51 int width = 256; 51 int width = 256;
52 int height = 256; 52 int height = 256;
53 int pitch = width * 2 + 17; 53 int pitch = width * 2 + 16;
54 54
55 std::vector<uint8_t> image(height * pitch); 55 std::vector<uint8_t> image(height * pitch);
56
56 int v = 0; 57 int v = 0;
57 for (int y = 0; y < height; y++) 58 for (int y = 0; y < height; y++)
58 { 59 {
59 uint16_t *p = reinterpret_cast<uint16_t*>(&image[0] + y * pitch); 60 uint16_t *p = reinterpret_cast<uint16_t*>(&image[0] + y * pitch);
60 for (int x = 0; x < width; x++, p++, v++) 61 for (int x = 0; x < width; x++, p++, v++)