Added Read method

This commit is contained in:
Leonetienne
2022-03-05 22:00:57 +01:00
parent 33932906c4
commit 808738ac2e
9 changed files with 277 additions and 17 deletions

View File

@@ -33,10 +33,10 @@ namespace Leonetienne::BmpPP {
const std::size_t numChannels = image.GetNumColorChannels();
// Calculate how many padding bytes to add per row
std::size_t paddingBytesPerRow = (4 - ((image.size.x * numChannels) % 4)) % 4;
const std::size_t paddingBytesPerRow = (4 - ((image.size.x * numChannels) % 4)) % 4;
// Iterate over all pixel rows
for (std::size_t y = 0; y < image.size.y; y++) {
for (std::int64_t y = image.size.y-1; y >= 0; y--) {
const std::size_t rowIndex = y * image.size.x * numChannels;
for (std::size_t x = 0; x < image.size.x; x++) {