From this code it is converting RGB2YUV format, there is nowhere I found to load RGB directly into frame buffer, any idea how to load that into frame buffer of RGB888 values,
#include <Arduino.h>#include <Camera.h>#include <LCD.h> #define IMAGE_HW 480#define IMAGE_VW 272#define BUTTON PIN_SW0#define BPP_RGB 3 //bytes per pixel#define BPP_YUV 2 //bytes per pixel Camera camera(IMAGE_HW, IMAGE_VW);LCD lcd(IMAGE_HW, IMAGE_VW,1);bool lcd_on = true;uint8_t lcd_buf[IMAGE_HW * IMAGE_VW * BPP_YUV] __attribute((section("NC_BSS"),aligned(32)));uint8_t campus_buf[IMAGE_HW * IMAGE_VW * BPP_RGB] __attribute((section("NC_BSS"),aligned(32))); void setup() { // put your setup code here, to run once: pinMode(BUTTON, INPUT); camera.begin(); lcd.begin(lcd_buf, camera.getWidth(), camera.getHeight()); lcd.clear(); for(int i = 0; i < IMAGE_VW; i++){ for(int j = 0; j < IMAGE_HW*BPP_RGB; j+=BPP_RGB){ campus_buf[0+j+i*IMAGE_HW*BPP_RGB] = (uint8_t)i; campus_buf[1+j+i*IMAGE_HW*BPP_RGB] = 0; campus_buf[2+j+i*IMAGE_HW*BPP_RGB] = 0; } }
///////////////////////////////////////////////////////////////////////
load this as it is RGB value to frame buffer
////////////////////////////////////////////////////////////////////////
///////////I don't want to use this //////////////////////////////////
//lcd.BGR2YUV(campus_buf, lcd_buf, IMAGE_HW, IMAGE_VW);} void loop() {}
Any suggestion would be really appreciable.
Regards,
Ritesh
Thank you for your reply,
Yes, actually I had changed it to FORMAT_RGB888 in LCD.h file, so by default it will take that, but when I load it into MCU it shows parallel lines with no pixel arrangement, all the code I found on this topic uses YUV for showing data into LCD. I think we need some function to put it as it is to the display but don't know how (I've changed the constructor added 1 in code this) -Ritesh