aboutsummaryrefslogtreecommitdiff
path: root/src/BMPImage.cpp
diff options
context:
space:
mode:
authorDylan <boss@tehbox.org>2025-08-08 15:22:35 +1200
committerDylan <boss@tehbox.org>2025-08-08 15:38:59 +1200
commit41ddbec10d11b01ccc10bf7e1dc862a9f3e4c85f (patch)
treec4775a629588419803320818fc1458f6d35e8ae8 /src/BMPImage.cpp
parent5823a8dff5c6c565c9b253b122d2baeb767b72e2 (diff)
downloadtehimage-41ddbec10d11b01ccc10bf7e1dc862a9f3e4c85f.tar.gz
tehimage-41ddbec10d11b01ccc10bf7e1dc862a9f3e4c85f.zip
feat: Simplified APIv0.0.1
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
Diffstat (limited to 'src/BMPImage.cpp')
-rw-r--r--src/BMPImage.cpp2
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);