My goal is to flip what comes from the lenses and see it flipped in the screen (on the fly).
I'm trying to get the viewport flipped on the screen.
I want to contribute solving myself the request related to my post - CHDK forum > CHDK Development > Feature Requests > Using old lenses, but I'm not a software developer, just amateur (newbie
), so any help will be wellcome.
I made some tests and is seems to be working. I can see something that is the flipped image, and that's what i need, but i don't know why the image is not correctly displayed...
It shows lots of dots in different colors, I can figure that the image is there and it's correctly flipped (when moving the camera it moves opposite), but is not the clean image that you can normally see in the screen.
I could not figure how to make the vid_get_viewport_fb() show correctly in the screen, how to get a complete pixel from vid_get_viewport_fb().
In the code from others, there is some 3 multiplying (color rgb / yuv) that i don't know where comes from or how to use it.
Sorry for being annoying (again i'm really newbie), but after some days of testing, i think that is better to ask the experts!.
Best wishes and a happy new year!.
Part of my dirty and copied code is:
if (!buf) {
buf = malloc(screen_size);
scr_buf = vid_get_bitmap_fb();
}
if (buf) {
inv_buf=vid_get_viewport_fb();
vp_h=vid_get_viewport_height();
vp_w=screen_width;
for (s=0, v=vp_h*vp_w*3; s<screen_size; ++s, v-=3) {
inverso_pixel=inv_buf[v];
buf[s]=inverso_pixel;
}
memcpy(scr_buf, buf, screen_size);
memcpy(scr_buf+screen_size, buf, screen_size);
}