Skip to content

Commit

Permalink
Write converted image with output colorspace (#1420) (#1500) (#1531)
Browse files Browse the repository at this point in the history
* Write converted image with output colorspace (#1420)

Signed-off-by: Bo Zhou <Bo.Schwarzstein@gmail.com>

* Check if outputcolorspace is null and set it as oiio:ColorSpace (#1460)

Signed-off-by: Bo Zhou <Bo.Schwarzstein@gmail.com>

* Call getDisplayViewColorSpaceName to get output colorspace for view mode. #1420

Signed-off-by: Bo Zhou <Bo.Schwarzstein@gmail.com>

Co-authored-by: Patrick Hodoul <patrick.hodoul@autodesk.com>

Co-authored-by: Bo Zhou <bo.schwarzstein@gmail.com>
  • Loading branch information
hodoulp and zhoub committed Nov 3, 2021
1 parent df74525 commit a8626f8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/apps/ocioconvert/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,17 @@ int main(int argc, const char **argv)
exit(1);
}

if (useDisplayView)
{
OCIO::ConstConfigRcPtr config = OCIO::GetCurrentConfig();
outputcolorspace = config->getDisplayViewColorSpaceName(display, view);
}

if (outputcolorspace)
{
spec.attribute("oiio:ColorSpace", outputcolorspace);
}

f->open(outputimage, spec);

if(!f->write_image(spec.format, img.getBuffer()))
Expand Down

0 comments on commit a8626f8

Please sign in to comment.