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+.
15 lines
465 B
C++
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);
|
|
}
|
|
}
|