Skip to content

Commit

Permalink
Properly mark alpha planes as full range
Browse files Browse the repository at this point in the history
  • Loading branch information
myrsloik committed Sep 17, 2021
1 parent be937ee commit 87c2b26
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ extern "C" void VS_CC imageFileCreate(const VSMap *in, VSMap *out, void *userDat
VSVideoFormat blank_alpha_format;
vsapi->getVideoFormatByID(&blank_alpha_format, pfGray8, core);
d.blank_alpha = vsapi->newVideoFrame(&blank_alpha_format, d.vi.width, d.vi.height, nullptr, core);
vsapi->mapSetInt(vsapi->getFramePropertiesRW(d.blank_alpha), "_ColorRange", 0, maReplace);

for (int i = 0; i < 4; i++) {
uint8_t *ptr = vsapi->getWritePtr(i < 3 ? d.blank_rgb : d.blank_alpha, i % 3);
Expand Down
1 change: 1 addition & 0 deletions src/text.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ static const VSFrame *VS_CC assGetFrame(int n, int activationReason,
NULL, core);

assRender(dst, a, vsapi, img);
vsapi->mapSetInt(vsapi->getFramePropertiesRW(a), "_ColorRange", 0, maReplace);
vsapi->mapConsumeFrame(vsapi->getFramePropertiesRW(dst), "_Alpha", a, maAppend);
vsapi->freeFrame(d->lastframe);
d->lastframe = dst;
Expand Down

0 comments on commit 87c2b26

Please sign in to comment.