Skip to content

video: add more resolutions to GC2145 #91975

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

KurtE
Copy link
Contributor

@KurtE KurtE commented Jun 21, 2025

As I mentioned in issue #91968,

It would be great if the camera drivers would support a larger number of resolutions. For example those resolutions of the displays that they wish to display an image on. Potentially in both landscape and portrait mode.

So far I have added one the works in landscape mode for ILI948x and ST7796 displays as well

as a QVGA in portrait mode, which should be good for ILI9341 and some ST7789 displays.

If this looks like a valid approach will also add in GIGA Display Adapter size, and maybe and add the duplicate items to the FORMAT_CAP list for YUYV mode.

Note: the other than add the items to the list, I just added code to set resolution which computes the c_ratio/r_ratio chooses the smaller of the two to use.

Could probably do several of the others n the switch statement.

Example: shows GC2145 image shown on an ST7796 display on an Arduino GIGA using the Arduino wrapper.

camera_image_to_ST7796

@KurtE KurtE force-pushed the gc2145_resolutions branch 2 times, most recently from eed540f to 145641c Compare June 21, 2025 20:13
video: add more resolutions to GC2145

As I mentioned in issue zephyrproject-rtos#91968,

It would be great if the camera drivers would support a larger number
of resolutions.   For example those resolutions of the displays that they
wish to display an image on.
Potentially in both landscape and portrait mode.

So far I have added  one the works in landscape mode for
ILI948x and ST7796 displays as well

as a QVGA in portrait mode, which should be good for
LI9341 and some ST7789 displays.

If this looks like a valid approach, I will also add the GIGA Display
Adapter size.  Probably need to add the duplicate items to the
FORMAT_CAP list for YUYV mode.

Note: the other than add the items to the list, I just
added code to set resolution which computes the
c_ratio/r_ratio chooses the smaller of the two to use.

We may also remove most if not all of the items in the switch
statement and simply use the default clause code for them.

Signed-off-by: Kurt Eckhardt <kurte@rockisland.com>
@KurtE KurtE force-pushed the gc2145_resolutions branch from 145641c to 9e291b5 Compare June 21, 2025 20:42
Copy link

Comment on lines +1045 to +1051
c_ratio = UXGA_HSIZE / w;
r_ratio = UXGA_VSIZE / h;
if (c_ratio < r_ratio) {
r_ratio = c_ratio;
} else {
c_ratio = r_ratio;
}
Copy link
Contributor

@josuah josuah Jun 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like some convenient "catch-all" rule to configure the exact resolution one needs but there is another way to do it:

  • The role of video_set_format() is to configure the "effective resolution", the size after binning is appplied (the row and column ratio like you configure now).

  • The role of video_set_selection() is to apply a cropping to the "effective/binned resolution" into an "output resolution" to give full control over what the sensor supports.

This should be merged this week so if it is possible for you to wait (or implement it!), then this would allow you to control this sensor features fully.

Thank you for the proposal!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants