Files
oak-editor/app/render/color.cpp
T
itsmattkc 5e609882d8 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+.
2020-04-02 12:47:05 +11:00

15 lines
465 B
C++

#include "color.h"
Color::Color(const char *data, const PixelFormat::Format &format)
{
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);
}
}