Skip to content

Commit 2870418

Browse files
committed
swap u and v
1 parent 2f03761 commit 2870418

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/libcameracamera.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,8 +550,8 @@ QImage LibCameraWorker::convertBufferToImage(
550550
const uint8_t *src = static_cast<const uint8_t *>(memory);
551551
const uint8_t *yPlane = src;
552552
// Swap U and V planes - Pi outputs Y, V, U (YV12) not Y, U, V (I420)
553-
const uint8_t *vPlane = src + stride * height;
554-
const uint8_t *uPlane = vPlane + (stride / 2) * (height / 2);
553+
const uint8_t *uPlane = src + stride * height;
554+
const uint8_t *vPlane = uPlane + (stride / 2) * (height / 2);
555555

556556
for (unsigned int y = 0; y < height; y++) {
557557
uint8_t *destRow = image.scanLine(y);

0 commit comments

Comments
 (0)