Skip to content
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

feat: add IDS new g40 & g24 pixel format #199

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

OlivierLDff
Copy link
Contributor

@OlivierLDff OlivierLDff commented Dec 5, 2024

Hi, we stumble across some new IDS camera that support only a proprietary pixel format. I don't know if you want to support that upstream.

Values are taken from ids_peak_comfort_c.h:

typedef enum
{
    // ....

    /*! \brief BayerGR10 grouped 40
     *
     * \note This pixel format is preliminary and its name and value may change in a future product version.
     */
    PEAK_PIXEL_FORMAT_BAYER_GR10G40_IDS = 0x40000003,

    /*! \brief BayerRG10 grouped 40
     *
     * \note This pixel format is preliminary and its name and value may change in a future product version.
     */
    PEAK_PIXEL_FORMAT_BAYER_RG10G40_IDS = 0x40000001,

    /*! \brief BayerGB10 grouped 40
     *
     * \note This pixel format is preliminary and its name and value may change in a future product version.
     */
    PEAK_PIXEL_FORMAT_BAYER_GB10G40_IDS = 0x40000002,

    /*! \brief BayerBG grouped 40
     *
     * \note This pixel format is preliminary and its name and value may change in a future product version.
     */
    PEAK_PIXEL_FORMAT_BAYER_BG10G40_IDS = 0x40000004,

    /*! \brief BayerGR12 grouped 24
     *
     * \note This pixel format is preliminary and its name and value may change in a future product version.
     */
    PEAK_PIXEL_FORMAT_BAYER_GR12G24_IDS = 0x40000013,

    /*! \brief BayerRG12 grouped 24
     *
     * \note This pixel format is preliminary and its name and value may change in a future product version.
     */
    PEAK_PIXEL_FORMAT_BAYER_RG12G24_IDS = 0x40000011,

    /*! \brief BayerGB12 grouped 24
     *
     * \note This pixel format is preliminary and its name and value may change in a future product version.
     */
    PEAK_PIXEL_FORMAT_BAYER_GB12G24_IDS = 0x40000012,

    /*! \brief BayerBG12 grouped 24
     *
     * \note This pixel format is preliminary and its name and value may change in a future product version.
     */
    PEAK_PIXEL_FORMAT_BAYER_BG12G24_IDS = 0x40000014,

    /*! \brief Mono10 grouped 40
     *
     * \note This pixel format is preliminary and its name and value may change in a future product version.
     */
    PEAK_PIXEL_FORMAT_MONO10G40_IDS     = 0x4000000f,

    /*! \brief Mono12 grouped 24
     *
     * \note This pixel format is preliminary and its name and value may change in a future product version.
     */
    PEAK_PIXEL_FORMAT_MONO12G24_IDS     = 0x4000001f

} peak_pixel_format;

Some cameras only support those new format:
image

A visual view of the new format can be found here

image

When running I got

payload receive error: InvalidPayload("packet is broken: 40000001 is invalid value for pixel format")

And now with the new version

payload received! block_id: 0, timestamp: 167.098932s
ImageInfo { width: 2592, height: 1944, x_offset: 8, y_offset: 8, pixel_format: BayerRG10g40IDS, image_size: 6298560 }

We can see that the image_size is indeed correct: 1944*2592*1.25=6298560

Copy link
Member

@Y-Nak Y-Nak left a comment

Choose a reason for hiding this comment

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

Thank you! Looks really good to me!
I'm going to fix the clippy(which is not related to the change, of course), and cut a new release.

@Y-Nak Y-Nak merged commit dde3e4a into cameleon-rs:main Dec 5, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants