Skip to content

replace imageformats with gamut. remove alpha #137

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

Merged
merged 1 commit into from
Nov 9, 2022

Conversation

aferust
Copy link
Collaborator

@aferust aferust commented Nov 9, 2022

  • gamut is an up-to-date solution for imageio. For imageio, dcv switched to gamut.
  • Computer Vision has nothing to do with alpha channels, so the alpha channel was kept apart from imageio and videoio.
  • A small bug in dcv.plot was fixed. It was an issue for some png images.

@aferust aferust merged commit dd5d726 into libmir:master Nov 9, 2022
@@ -27,22 +27,24 @@ enum ImageFormat
{
IF_UNASSIGNED = 0, /// Not assigned format.
IF_MONO, /// Mono, single channel format.
IF_MONO_ALPHA, /// Mono with alpha channel.
//IF_MONO_ALPHA, /// Mono with alpha channel.
IF_RGB, /// RGB format.
Copy link
Member

Choose a reason for hiding this comment

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

IF_RGB = 3?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

IF_RGB enum value doesn't represent channel count. ImageFormat enum value must be a correct index of imageFormatChannelCount. To clarify it I am adding explicit values of enum members so that:

enum ImageFormat
{
    IF_UNASSIGNED = 0, /// Not assigned format.
    IF_MONO = 1, /// Mono, single channel format.
    //IF_MONO_ALPHA, /// Mono with alpha channel.
    IF_RGB = 2, /// RGB format.
    IF_BGR = 3, /// BGR format.
    IF_YUV = 4, /// YUV (YCbCr) format.
    //IF_RGB_ALPHA, /// RGB format with alpha.
    //IF_BGR_ALPHA /// BGR format with alpha.
}

...
immutable size_t[] imageFormatChannelCount = [
    0, // unassigned
    1, // mono
    //2, // mono alpha
    3, // rgb
    3, // bgr
    3, // yuv
    //4, // rgba
    //4 // bgra
    ];

Copy link
Member

Choose a reason for hiding this comment

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

ah, got it, thank you

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