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

Refactor 'alpha' bool to an 'itemCategory' enum value. #1499

Merged
merged 2 commits into from
Aug 10, 2023

Conversation

maryla-uc
Copy link
Collaborator

This refactor will be useful when adding gain maps.

@maryla-uc maryla-uc marked this pull request as ready for review August 9, 2023 11:43
@@ -262,8 +271,8 @@ AVIF_ARRAY_DECLARE(avifDecodeSampleArray, avifDecodeSample, sample);
typedef struct avifCodecDecodeInput
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just a thought: avifCodecDecodeInput could be moved to read.c

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Indeed, but I think it should be done in another PR.

src/write.c Outdated Show resolved Hide resolved
src/write.c Outdated Show resolved Hide resolved
src/write.c Outdated
uint16_t * topLevelItemID)
{
const uint32_t cellCount = gridCols * gridRows;
const char * infeName = alpha ? "Alpha" : "Color";
const char * infeName = (itemType == AVIF_ITEM_ALPHA) ? "Alpha" : "Color";
Copy link
Collaborator

Choose a reason for hiding this comment

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

I saw avifGetErrorForItemType() and I am wondering if there should also be avifGetInfeNameForItemType(), avifIsItemTypeAlpha() etc.
Can be done later of course.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's only used in one place so I think it's fine as is?

@maryla-uc maryla-uc changed the title Refactor 'alpha' bool to an 'itemType' enum value. Refactor 'alpha' bool to an 'itemCategory' enum value. Aug 10, 2023
@maryla-uc maryla-uc merged commit cef074c into AOMediaCodec:main Aug 10, 2023
14 checks passed
wantehchang added a commit to wantehchang/libavif that referenced this pull request Sep 1, 2023
avifItemCategory was originally named avifItemType in
AOMediaCodec#1499.
y-guyon pushed a commit that referenced this pull request Sep 12, 2023
avifItemCategory was originally named avifItemType in
#1499.
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