|
8 | 8 | #include <libcamera/framebuffer_allocator.h> |
9 | 9 | #include <qvideoframe.h> |
10 | 10 | #include <sys/mman.h> |
11 | | -#include <QColorSpace> |
12 | 11 |
|
13 | 12 | using namespace libcamera; |
14 | 13 |
|
@@ -494,18 +493,21 @@ QImage LibCameraWorker::convertBufferToImage( |
494 | 493 | cfg.size.width, |
495 | 494 | cfg.size.height, |
496 | 495 | cfg.stride, |
497 | | - QImage::Format_BGR888); |
| 496 | + QImage::Format_RGB888); |
| 497 | + qDebug() << "[DEBUG] RGB888 conversion complete, image size:" << temp.size(); |
498 | 498 | image = temp.copy(); |
499 | 499 | } else if (cfg.pixelFormat == libcamera::formats::BGR888) { |
500 | 500 | QImage temp(static_cast<const uchar *>(memory), |
501 | 501 | cfg.size.width, |
502 | 502 | cfg.size.height, |
503 | 503 | cfg.stride, |
504 | 504 | QImage::Format_BGR888); |
| 505 | + qDebug() << "[DEBUG] BGR888 conversion complete, image size:" << temp.size(); |
505 | 506 | image = temp.copy(); |
506 | 507 | } else if (cfg.pixelFormat == libcamera::formats::MJPEG) { |
507 | 508 | size_t size = buffer->metadata().planes()[0].bytesused; |
508 | 509 | image.loadFromData(static_cast<const uchar *>(memory), static_cast<int>(size), "JPEG"); |
| 510 | + qDebug() << "[DEBUG] MJPEG conversion complete, image size:" << image.size(); |
509 | 511 | } else if (cfg.pixelFormat == libcamera::formats::YUYV) { |
510 | 512 | image = QImage(cfg.size.width, cfg.size.height, QImage::Format_RGB888); |
511 | 513 | const uint8_t *src = static_cast<const uint8_t *>(memory); |
@@ -536,6 +538,7 @@ QImage LibCameraWorker::convertBufferToImage( |
536 | 538 | image.setPixel(x + 1, y, qRgb(r1, g1, b1)); |
537 | 539 | } |
538 | 540 | } |
| 541 | + qDebug() << "[DEBUG] YUYV conversion complete, image size:" << image.size(); |
539 | 542 | } else if (cfg.pixelFormat == libcamera::formats::YUV420) { |
540 | 543 | // YUV420 planar format (I420) |
541 | 544 | unsigned int width = cfg.size.width; |
|
0 commit comments