From 41ddbec10d11b01ccc10bf7e1dc862a9f3e4c85f Mon Sep 17 00:00:00 2001 From: Dylan Date: Fri, 8 Aug 2025 15:22:35 +1200 Subject: feat: Simplified API Had to restrict images to 8 bit depth sadly This could potentially be changed in the future by setting bit depth with templates and changing the data to be the specified bit depth --- src/BMPImage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/BMPImage.cpp') 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); -- cgit v1.2.3