woops, changed this while testing, forgot to change back
This commit is contained in:
@@ -372,26 +372,33 @@ public:
|
|||||||
|
|
||||||
int idx = (y * width + x) * channels;
|
int idx = (y * width + x) * channels;
|
||||||
|
|
||||||
if (colorformat == frame::colormap::B) {
|
switch(colorformat) {
|
||||||
colorBuffer[idx] = static_cast<uint8_t>(color.mean() * 255.0f);
|
case frame::colormap::B:
|
||||||
} else if (colorformat == frame::colormap::RGB) {
|
colorBuffer[idx ] = static_cast<uint8_t>(color.mean() * 255.0f);
|
||||||
colorBuffer[idx ] = static_cast<uint8_t>(color[0] * 255.0f);
|
break;
|
||||||
colorBuffer[idx + 1] = static_cast<uint8_t>(color[1] * 255.0f);
|
case frame::colormap::RGB:
|
||||||
colorBuffer[idx + 2] = static_cast<uint8_t>(color[2] * 255.0f);
|
colorBuffer[idx ] = static_cast<uint8_t>(color[0] * 255.0f);
|
||||||
} else if (colorformat == frame::colormap::BGR) {
|
colorBuffer[idx + 1] = static_cast<uint8_t>(color[1] * 255.0f);
|
||||||
colorBuffer[idx ] = static_cast<uint8_t>(color[2] * 255.0f);
|
colorBuffer[idx + 2] = static_cast<uint8_t>(color[2] * 255.0f);
|
||||||
colorBuffer[idx + 1] = static_cast<uint8_t>(color[1] * 255.0f);
|
break;
|
||||||
colorBuffer[idx + 2] = static_cast<uint8_t>(color[0] * 255.0f);
|
case frame::colormap::BGR:
|
||||||
} else if (colorformat == frame::colormap::RGBA) {
|
colorBuffer[idx ] = static_cast<uint8_t>(color[2] * 255.0f);
|
||||||
colorBuffer[idx ] = static_cast<uint8_t>(color[0] * 255.0f);
|
colorBuffer[idx + 1] = static_cast<uint8_t>(color[1] * 255.0f);
|
||||||
colorBuffer[idx + 1] = static_cast<uint8_t>(color[1] * 255.0f);
|
colorBuffer[idx + 2] = static_cast<uint8_t>(color[0] * 255.0f);
|
||||||
colorBuffer[idx + 2] = static_cast<uint8_t>(color[2] * 255.0f);
|
break;
|
||||||
colorBuffer[idx + 3] = 255;
|
case frame::colormap::RGBA:
|
||||||
} else if (colorformat == frame::colormap::BGRA) {
|
colorBuffer[idx ] = static_cast<uint8_t>(color[0] * 255.0f);
|
||||||
colorBuffer[idx ] = static_cast<uint8_t>(color[2] * 255.0f);
|
colorBuffer[idx + 1] = static_cast<uint8_t>(color[1] * 255.0f);
|
||||||
colorBuffer[idx + 1] = static_cast<uint8_t>(color[1] * 255.0f);
|
colorBuffer[idx + 2] = static_cast<uint8_t>(color[2] * 255.0f);
|
||||||
colorBuffer[idx + 2] = static_cast<uint8_t>(color[0] * 255.0f);
|
colorBuffer[idx + 3] = 255;
|
||||||
colorBuffer[idx + 3] = 255;
|
break;
|
||||||
|
case frame::colormap::BGRA:
|
||||||
|
colorBuffer[idx ] = static_cast<uint8_t>(color[2] * 255.0f);
|
||||||
|
colorBuffer[idx + 1] = static_cast<uint8_t>(color[1] * 255.0f);
|
||||||
|
colorBuffer[idx + 2] = static_cast<uint8_t>(color[0] * 255.0f);
|
||||||
|
colorBuffer[idx + 3] = 255;
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user