color: fixed oiio incompatibility

While developing, we used a function that only exists in OpenImageIO 2.1.x+.
Fortunately however, it seems to have simply existed with a different name in
earlier versions so we can maintain compatibility with 1.6+.
This commit is contained in:
itsmattkc
2020-04-02 12:47:05 +11:00
parent 6ea6dd810e
commit 5e609882d8
+5 -5
View File
@@ -2,11 +2,11 @@
Color::Color(const char *data, const PixelFormat::Format &format)
{
OIIO::convert_type(PixelFormat::GetOIIOTypeDesc(format),
data,
PixelFormat::GetOIIOTypeDesc(PixelFormat::PIX_FMT_RGB32F),
data_,
PixelFormat::FormatHasAlphaChannel(format) ? kRGBAChannels : kRGBChannels);
OIIO::convert_types(PixelFormat::GetOIIOTypeDesc(format),
data,
PixelFormat::GetOIIOTypeDesc(PixelFormat::PIX_FMT_RGB32F),
data_,
PixelFormat::FormatHasAlphaChannel(format) ? kRGBAChannels : kRGBChannels);
if (!PixelFormat::FormatHasAlphaChannel(format)) {
set_alpha(1.0f);