From 68b15fc3ad4f74be192150d3a2fb35e7ef2d4edd Mon Sep 17 00:00:00 2001 From: Lukas Stockner Date: Thu, 2 May 2019 15:45:31 +0200 Subject: Cycles: support loading images from arbitrary OpenColorIO color space These are the internal changes to Cycles, for Blender integration there are no functional changes in this commit. Images are converted to scene linear color space on file load, and on reading from the OpenImageIO texture cache. 8-bit images are compressed with the sRGB transfer function to avoid precision loss while keeping memory usages low. This also means that for common cases of 8-bit sRGB images no conversion happens at all on image loading. Initial patch by Lukas, completed by Brecht. Differential Revision: https://developer.blender.org/D3491 --- intern/cycles/kernel/osl/osl_globals.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'intern/cycles/kernel/osl/osl_globals.h') diff --git a/intern/cycles/kernel/osl/osl_globals.h b/intern/cycles/kernel/osl/osl_globals.h index 414aaf891db..51bc5cf81a9 100644 --- a/intern/cycles/kernel/osl/osl_globals.h +++ b/intern/cycles/kernel/osl/osl_globals.h @@ -37,6 +37,7 @@ using std::isfinite; CCL_NAMESPACE_BEGIN class OSLRenderServices; +class ColorSpaceProcessor; /* OSL Texture Handle * @@ -53,21 +54,15 @@ class OSLRenderServices; struct OSLTextureHandle : public OIIO::RefCnt { enum Type { OIIO, SVM, IES, BEVEL, AO }; - OSLTextureHandle() : type(OIIO), svm_slot(-1), oiio_handle(NULL) - { - } - - OSLTextureHandle(Type type) : type(type), svm_slot(-1), oiio_handle(NULL) - { - } - - OSLTextureHandle(Type type, int svm_slot) : type(type), svm_slot(svm_slot), oiio_handle(NULL) + OSLTextureHandle(Type type = OIIO, int svm_slot = -1) + : type(type), svm_slot(svm_slot), oiio_handle(NULL), processor(NULL) { } Type type; int svm_slot; OSL::TextureSystem::TextureHandle *oiio_handle; + ColorSpaceProcessor *processor; }; typedef OIIO::intrusive_ptr OSLTextureHandleRef; -- cgit v1.2.3