pngwriter.cc (12334:e0ab29a34764) | pngwriter.cc (12582:e4f0727b353e) |
---|---|
1/* 2 * Copyright (c) 2017 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 146 unchanged lines hidden (view full) --- 155 PNG_COMPRESSION_TYPE_DEFAULT, 156 PNG_FILTER_TYPE_DEFAULT); 157 158 png_write_info(pngPtr, infoPtr); 159 160 // libpng requires an array of pointers to the frame buffer's rows. 161 std::vector<PixelType> rowPacked(width); 162 for (unsigned y=0; y < height; ++y) { | 1/* 2 * Copyright (c) 2017 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 146 unchanged lines hidden (view full) --- 155 PNG_COMPRESSION_TYPE_DEFAULT, 156 PNG_FILTER_TYPE_DEFAULT); 157 158 png_write_info(pngPtr, infoPtr); 159 160 // libpng requires an array of pointers to the frame buffer's rows. 161 std::vector<PixelType> rowPacked(width); 162 for (unsigned y=0; y < height; ++y) { |
163 for (unsigned x=0; x < height; ++x) { | 163 for (unsigned x=0; x < width; ++x) { |
164 rowPacked[x] = fb.pixel(x, y); 165 } 166 167 png_write_row(pngPtr, 168 reinterpret_cast<png_bytep>(rowPacked.data()) 169 ); 170 } 171 172 // End of write 173 png_write_end(pngPtr, NULL); 174} 175 | 164 rowPacked[x] = fb.pixel(x, y); 165 } 166 167 png_write_row(pngPtr, 168 reinterpret_cast<png_bytep>(rowPacked.data()) 169 ); 170 } 171 172 // End of write 173 png_write_end(pngPtr, NULL); 174} 175 |