26 virtual bool isNoOp()
const {
return false; }
38 apply((
float*)data, 1, 1, 3,
sizeof(
float), 3 *
sizeof(
float),
45 #define OIIO_HAS_COLORPROCESSOR 1
53 #define OIIO_COLORCONFIG_USES_SHARED_PTR 1
98 std::string
geterror(
bool clear =
true)
const;
101 int getNumColorSpaces()
const;
104 const char* getColorSpaceNameByIndex(
int index)
const;
114 const char* getColorSpaceNameByRole(
string_view role)
const;
118 OIIO::TypeDesc getColorSpaceDataType(
string_view name,
int* bits)
const;
122 std::vector<std::string> getColorSpaceNames()
const;
126 const char* getColorSpaceFamilyByName(
string_view name)
const;
129 int getNumRoles()
const;
132 const char* getRoleByIndex(
int index)
const;
135 std::vector<std::string>
getRoles()
const;
138 int getNumLooks()
const;
141 const char* getLookNameByIndex(
int index)
const;
144 std::vector<std::string> getLookNames()
const;
151 std::vector<std::string> getAliases(
string_view color_space)
const;
169 createColorProcessor(
ustring inputColorSpace,
ustring outputColorSpace,
188 string_view outputColorSpace,
bool inverse =
false,
193 ustring outputColorSpace,
bool inverse =
false,
198 int getNumDisplays()
const;
201 const char* getDisplayNameByIndex(
int index)
const;
205 std::vector<std::string> getDisplayNames()
const;
208 const char* getDefaultDisplayName()
const;
216 const char* getViewNameByIndex(
string_view display,
int index)
const;
221 std::vector<std::string> getViewNames(
string_view display =
"")
const;
225 const char* getDefaultViewName(
string_view display =
"")
const;
230 const char* getDisplayViewColorSpaceName(
const std::string& display,
231 const std::string& view)
const;
235 const char* getDisplayViewLooks(
const std::string& display,
236 const std::string& view)
const;
262 bool inverse =
false,
string_view context_key =
"",
267 bool inverse =
false,
293 bool inverse =
false)
const;
295 bool inverse =
false)
const;
306 bool inverse =
false)
const;
329 std::string configname()
const;
338 static bool supportsOpenColorIO();
342 static int OpenColorIO_version_hex();
356 std::unique_ptr<Impl> m_impl;
357 Impl* getImpl()
const {
return m_impl.get(); }
368 return (x <= 0.04045
f) ? (x * (1.0f / 12.92f))
369 :
powf((x + 0.055
f) * (1.0
f / 1.055
f), 2.4
f);
373 #ifndef __CUDA_ARCH__
378 x <= 0.04045
f, x * (1.0
f / 12.92
f),
388 return (x <= 0.0031308
f) ? (12.92f *
x)
389 : (1.055
f *
powf(x, 1.
f / 2.4
f) - 0.055f);
393 #ifndef __CUDA_ARCH__
413 return x * (1.0f / 4.5f);
415 return powf((x + 0.099
f) * (1.0
f / 1.099
f), (1.0
f / 0.45
f));
426 return 1.099f *
powf(x, 0.45
f) - 0.099f;
OIIO_API std::string geterror(bool clear=true)
OIIO_API bool has_error()
Is there a pending global error message waiting to be retrieved?
OIIO_FORCEINLINE OIIO_HOSTDEVICE T fast_pow_pos(const T &x, const U &y)
GT_API const UT_StringHolder filename
SYS_API float powf(float x, float y)
float sRGB_to_linear(float x)
float linear_to_sRGB(float x)
PXL_API void getRoles(UT_StringArray &names)
Returns a list of the supported roles.
float linear_to_Rec709(float x)
GLint GLsizei GLsizei height
virtual bool hasChannelCrosstalk() const
vint4 select(const vbool4 &mask, const vint4 &a, const vint4 &b)
OIIO_FORCEINLINE OIIO_HOSTDEVICE float madd(float a, float b, float c)
Fused multiply and add: (a*b + c)
GLuint const GLchar * name
PXL_API const char * parseColorSpaceFromString(const char *string)
virtual ~ColorProcessor(void)
virtual bool isNoOp() const
LeafData & operator=(const LeafData &)=delete
#define OIIO_NAMESPACE_END
std::shared_ptr< ColorProcessor > ColorProcessorHandle
ImageBuf OIIO_API channels(const ImageBuf &src, int nchannels, cspan< int > channelorder, cspan< float > channelvalues={}, cspan< std::string > newchannelnames={}, bool shuffle_channel_names=false, int nthreads=0)
float Rec709_to_linear(float x)
#define OIIO_NAMESPACE_BEGIN