-
Notifications
You must be signed in to change notification settings - Fork 206
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
Conversation
@@ -262,8 +271,8 @@ AVIF_ARRAY_DECLARE(avifDecodeSampleArray, avifDecodeSample, sample); | |||
typedef struct avifCodecDecodeInput |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
uint16_t * topLevelItemID) | ||
{ | ||
const uint32_t cellCount = gridCols * gridRows; | ||
const char * infeName = alpha ? "Alpha" : "Color"; | ||
const char * infeName = (itemType == AVIF_ITEM_ALPHA) ? "Alpha" : "Color"; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
avifItemCategory was originally named avifItemType in AOMediaCodec#1499.
avifItemCategory was originally named avifItemType in #1499.
This refactor will be useful when adding gain maps.