diff --git a/BasicRenderer/source/ImageExporter.cpp b/BasicRenderer/source/ImageExporter.cpp index 82d432b..b4526eb 100644 --- a/BasicRenderer/source/ImageExporter.cpp +++ b/BasicRenderer/source/ImageExporter.cpp @@ -92,9 +92,9 @@ namespace BasicRenderer //BGR uint32_t index = (height - j - 1) * width + i; Color c = cBuf[index]; - bmpData.emplace_back((uint8_t)(c.r * 255.999f)); - bmpData.emplace_back((uint8_t)(c.g * 255.999f)); bmpData.emplace_back((uint8_t)(c.b * 255.999f)); + bmpData.emplace_back((uint8_t)(c.g * 255.999f)); + bmpData.emplace_back((uint8_t)(c.r * 255.999f)); } uint32_t padding = bmpData.size() % 4; diff --git a/QtGUI/QRenderingWidget.cpp b/QtGUI/QRenderingWidget.cpp index 24eb65a..2c01ee0 100644 --- a/QtGUI/QRenderingWidget.cpp +++ b/QtGUI/QRenderingWidget.cpp @@ -239,9 +239,9 @@ void QRenderingWidget::CopyFrameBufferToQImage(QImage& img, const FrameBuffer& f for (uint i = 0; i < size; ++i) { uint ua = 255u << 24; - ua |= static_cast(c[i].x * 255.999f) << 16; - ua |= static_cast(c[i].y * 255.999f) << 8; - ua |= static_cast(c[i].z * 255.999f); + ua |= static_cast(c[i].r * 255.999f) << 16; + ua |= static_cast(c[i].g * 255.999f) << 8; + ua |= static_cast(c[i].b * 255.999f); rgb[i] = ua; }