Skip to content

Commit 40426d9

Browse files
Fix rgb888 to rgb565 conversion (#7)
* Fix rgb888 to rgb565 conversion Old variants of LCD swapped R and B channels, so the corresponding hack was added to the DSP modules. Now LCD display works correctly, so this hack is not needed anymore. Signed-off-by: Kirill K. Smirnov <kirill.k.smirnov@gmail.com> * Update binaries Signed-off-by: Kirill K. Smirnov <kirill.k.smirnov@gmail.com>
1 parent 214607d commit 40426d9

File tree

22 files changed

+10
-10
lines changed

22 files changed

+10
-10
lines changed
50 KB
Binary file not shown.

trik/ov7670/edge_line_sensor/include/internal/cv_ball_detector_seqpass.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class BallDetector<TRIK_VIDTRANSCODE_CV_VIDEO_FORMAT_YUV422P, TRIK_VIDTRANSCODE_
9191
static void __attribute__((always_inline)) writeOutputPixel(uint16_t* restrict _rgb565ptr,
9292
const uint32_t _rgb888)
9393
{
94-
*_rgb565ptr = ((_rgb888>>19)&0x001f) | ((_rgb888>>5)&0x07e0) | ((_rgb888<<8)&0xf800);
94+
*_rgb565ptr = ((_rgb888>>3)&0x001f) | ((_rgb888>>5)&0x07e0) | ((_rgb888>>8)&0xf800);
9595
}
9696

9797
void __attribute__((always_inline)) drawOutputPixelBound(const int32_t _srcCol,
49.9 KB
Binary file not shown.
50.2 KB
Binary file not shown.

trik/ov7670/line_sensor/include/internal/cv_line_detector_seqpass.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class LineDetector<TRIK_VIDTRANSCODE_CV_VIDEO_FORMAT_YUV422P, TRIK_VIDTRANSCODE_
5454
static void __attribute__((always_inline)) writeOutputPixel(uint16_t* restrict _rgb565ptr,
5555
const uint32_t _rgb888)
5656
{
57-
*_rgb565ptr = ((_rgb888>>19)&0x001f) | ((_rgb888>>5)&0x07e0) | ((_rgb888<<8)&0xf800);
57+
*_rgb565ptr = ((_rgb888>>3)&0x001f) | ((_rgb888>>5)&0x07e0) | ((_rgb888>>8)&0xf800);
5858
}
5959

6060
void __attribute__((always_inline)) drawOutputPixelBound(const int32_t _srcCol,
44.7 KB
Binary file not shown.

trik/ov7670/motion_sensor/include/internal/cv_motion_detector_seqpass.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class MotionDetector<TRIK_VIDTRANSCODE_CV_VIDEO_FORMAT_YUV422P, TRIK_VIDTRANSCOD
9696
static void __attribute__((always_inline)) writeOutputPixel(uint16_t* restrict _rgb565ptr,
9797
const uint32_t _rgb888)
9898
{
99-
*_rgb565ptr = ((_rgb888>>19)&0x001f) | ((_rgb888>>5)&0x07e0) | ((_rgb888<<8)&0xf800);
99+
*_rgb565ptr = ((_rgb888>>3)&0x001f) | ((_rgb888>>5)&0x07e0) | ((_rgb888>>8)&0xf800);
100100
}
101101

102102
void __attribute__((always_inline)) drawOutputPixelBound(const int32_t _srcCol,
49.8 KB
Binary file not shown.

trik/ov7670/mxn_sensor/include/internal/cv_ball_detector_seqpass.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class BallDetector<TRIK_VIDTRANSCODE_CV_VIDEO_FORMAT_YUV422P, TRIK_VIDTRANSCODE_
6767
static void __attribute__((always_inline)) writeOutputPixel(uint16_t* restrict _rgb565ptr,
6868
const uint32_t _rgb888)
6969
{
70-
*_rgb565ptr = ((_rgb888>>19)&0x001f) | ((_rgb888>>5)&0x07e0) | ((_rgb888<<8)&0xf800);
70+
*_rgb565ptr = ((_rgb888>>3)&0x001f) | ((_rgb888>>5)&0x07e0) | ((_rgb888>>8)&0xf800);
7171
}
7272

7373
void __attribute__((always_inline)) drawOutputPixelBound(const int32_t _srcCol,
58 KB
Binary file not shown.

0 commit comments

Comments
 (0)