add logging to setImage
This commit is contained in:
@@ -199,20 +199,25 @@ namespace thermion
|
|||||||
{
|
{
|
||||||
case PixelBufferDescriptor::PixelDataFormat::RGB:
|
case PixelBufferDescriptor::PixelDataFormat::RGB:
|
||||||
case PixelBufferDescriptor::PixelDataFormat::RGBA:
|
case PixelBufferDescriptor::PixelDataFormat::RGBA:
|
||||||
if (size != width * height * channels * sizeof(float))
|
{
|
||||||
|
size_t expectedSize = width * height * channels * sizeof(float);
|
||||||
|
if (size != expectedSize)
|
||||||
{
|
{
|
||||||
Log("Size mismatch");
|
Log("Size mismatch (expected %d, got %d)", expectedSize, size);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case PixelBufferDescriptor::PixelDataFormat::RGB_INTEGER:
|
case PixelBufferDescriptor::PixelDataFormat::RGB_INTEGER:
|
||||||
case PixelBufferDescriptor::PixelDataFormat::RGBA_INTEGER:
|
case PixelBufferDescriptor::PixelDataFormat::RGBA_INTEGER:
|
||||||
|
{
|
||||||
if (size != width * height * channels * sizeof(uint8_t))
|
if (size != width * height * channels * sizeof(uint8_t))
|
||||||
{
|
{
|
||||||
Log("Size mismatch");
|
Log("Size mismatch");
|
||||||
// return false;
|
// return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
Log("Unsupported buffer format type : %d", bufferFormat);
|
Log("Unsupported buffer format type : %d", bufferFormat);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user