RGB24 and BGR24 cleanup (#1749)

* RGB24 and BGR24 cleanup

* Fix MF-Grabber

* Add BGR32 to V42L Grabber

* Add BGR32 to V42L Grabber

* Add BGR16 to V42L

* Revert "Add BGR16 to V42L"

This reverts commit 42975380f4.
This commit is contained in:
LordGrey
2024-06-01 20:26:20 +02:00
committed by GitHub
parent 76fff98f5c
commit 15c305b8f2
4 changed files with 62 additions and 12 deletions

View File

@@ -133,6 +133,22 @@ void ImageResampler::processImage(const uint8_t * data, int width, int height, i
break;
}
case PixelFormat::RGB24:
{
for (int yDest = yDestStart, ySource = cropTop + (_verticalDecimation >> 1); yDest <= yDestEnd; ySource += _verticalDecimation, ++yDest)
{
for (int xDest = xDestStart, xSource = cropLeft + (_horizontalDecimation >> 1); xDest <= xDestEnd; xSource += _horizontalDecimation, ++xDest)
{
ColorRgb & rgb = outputImage(abs(xDest), abs(yDest));
int index = lineLength * ySource + (xSource << 1) + xSource;
rgb.red = data[index ];
rgb.green = data[index+1];
rgb.blue = data[index+2];
}
}
break;
}
case PixelFormat::BGR24:
{
for (int yDest = yDestStart, ySource = cropTop + (_verticalDecimation >> 1); yDest <= yDestEnd; ySource += _verticalDecimation, ++yDest)