export: allow rgb32f and rgba32f to pass through ocio without conversion
Minor optimization.
This commit is contained in:
@@ -118,8 +118,17 @@ bool ExportTask::Run()
|
||||
void FrameColorConvert(ColorProcessorPtr processor, FramePtr frame)
|
||||
{
|
||||
// OCIO conversion requires a frame in 32F format
|
||||
if (frame->format() != PixelFormat::PIX_FMT_RGBA32F) {
|
||||
frame = PixelFormat::ConvertPixelFormat(frame, PixelFormat::PIX_FMT_RGBA32F);
|
||||
if (frame->format() != PixelFormat::PIX_FMT_RGBA32F
|
||||
&& frame->format() != PixelFormat::PIX_FMT_RGB32F) {
|
||||
PixelFormat::Format dst;
|
||||
|
||||
if (PixelFormat::FormatHasAlphaChannel(frame->format())) {
|
||||
dst = PixelFormat::PIX_FMT_RGBA32F;
|
||||
} else {
|
||||
dst = PixelFormat::PIX_FMT_RGB32F;
|
||||
}
|
||||
|
||||
frame = PixelFormat::ConvertPixelFormat(frame, dst);
|
||||
}
|
||||
|
||||
// Color conversion must be done with unassociated alpha, and the pipeline is always associated
|
||||
|
||||
Reference in New Issue
Block a user