Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/lib/app/RvApp/CommandsModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,17 @@ namespace Rv
return p;
}

TwkFB::linearRGBA709pixelValue(fb, int(x), int(y), &p[0]);
int ignoreChroma = 0;
std::vector<TwkContainer::IntProperty*> chromaProps;
s->findPropertyOfType<TwkContainer::IntProperty>(chromaProps, "#RVLinearize.color.ignoreChromaticities");
if (!chromaProps.empty() && !chromaProps.front()->empty())
ignoreChroma = chromaProps.front()->front();

if (ignoreChroma)
TwkFB::linearRGBARawPixelValue(fb, int(x), int(y), &p[0]);
else
TwkFB::linearRGBA709pixelValue(fb, int(x), int(y), &p[0]);

NODE_RETURN(p);
}

Expand Down
11 changes: 10 additions & 1 deletion src/lib/image/TwkFB/Operations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3481,7 +3481,7 @@ namespace TwkFB
return nfb;
}

void linearRGBA709pixelValue(const FrameBuffer* fb, int x, int y, float* p)
void linearRGBARawPixelValue(const FrameBuffer* fb, int x, int y, float* p)
{
p[3] = 1.0;

Expand Down Expand Up @@ -3514,6 +3514,15 @@ namespace TwkFB
{
fb->getPixel4f(x, y, p);
}
}

void linearRGBA709pixelValue(const FrameBuffer* fb, int x, int y, float* p)
{
// Populate p[] with raw pixel values
linearRGBARawPixelValue(fb, x, y, p);

bool YUVp = fb->isYUVPlanar();
bool YRYBYp = fb->isYRYBYPlanar();

float& r = p[0];
float& g = p[1];
Expand Down
5 changes: 5 additions & 0 deletions src/lib/image/TwkFB/TwkFB/Operations.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,11 @@ namespace TwkFB

TWKFB_EXPORT void linearRGBA709pixelValue(const FrameBuffer* fb, int x, int y, float* result);

// get a raw linear pixel value. I don't see the value of converting pixel sampler
// values to a Rec.709 gamut.

TWKFB_EXPORT void linearRGBARawPixelValue(const FrameBuffer* fb, int x, int y, float* result);

} // namespace TwkFB

#endif // __TwkFB__Operations__h__