diff options
Diffstat (limited to 'src/BMPImage.cpp')
| -rw-r--r-- | src/BMPImage.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/BMPImage.cpp b/src/BMPImage.cpp index df2c745..b9b2c96 100644 --- a/src/BMPImage.cpp +++ b/src/BMPImage.cpp @@ -39,7 +39,7 @@ int BMPImage::writeToFile(std::string filename) { for(int x = 0; x < width; x++) { - Pixel pixel = getPixel(x, y); + Pixel& pixel = (*this)[x,y]; fwrite(&pixel.b, sizeof(uint8_t), 1, fd); fwrite(&pixel.g, sizeof(uint8_t), 1, fd); fwrite(&pixel.r, sizeof(uint8_t), 1, fd); |
