Blender  V2.93
Classes
colormanagement.c File Reference
#include "IMB_colormanagement.h"
#include "IMB_colormanagement_intern.h"
#include <math.h>
#include <string.h>
#include "DNA_color_types.h"
#include "DNA_image_types.h"
#include "DNA_movieclip_types.h"
#include "DNA_scene_types.h"
#include "DNA_space_types.h"
#include "IMB_filetype.h"
#include "IMB_filter.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "IMB_metadata.h"
#include "IMB_moviecache.h"
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_math_color.h"
#include "BLI_rect.h"
#include "BLI_string.h"
#include "BLI_threads.h"
#include "BKE_appdir.h"
#include "BKE_colortools.h"
#include "BKE_context.h"
#include "BKE_image.h"
#include "BKE_main.h"
#include "RNA_define.h"
#include "SEQ_iterator.h"
#include <ocio_capi.h>

Go to the source code of this file.

Classes

struct  ColormanageProcessor
 
struct  global_gpu_state
 
struct  global_color_picking_state
 
struct  ColormanageCacheViewSettings
 
struct  ColormanageCacheDisplaySettings
 
struct  ColormanageCacheKey
 
struct  ColormanageCacheData
 
struct  ColormanageCache
 
struct  DisplayBufferThread
 
struct  DisplayBufferInitData
 
struct  ProcessorTransformThread
 
struct  ProcessorTransformInit
 
struct  PartialThreadData
 

Functions

Initialization / De-initialization
static void colormanage_role_color_space_name_get (OCIO_ConstConfigRcPtr *config, char *colorspace_name, const char *role, const char *backup_role)
 
static void colormanage_load_config (OCIO_ConstConfigRcPtr *config)
 
static void colormanage_free_config (void)
 
void colormanagement_init (void)
 
void colormanagement_exit (void)
 
Internal functions
static bool colormanage_compatible_look (ColorManagedLook *look, const char *view_name)
 
static bool colormanage_use_look (const char *look, const char *view_name)
 
void colormanage_cache_free (ImBuf *ibuf)
 
void IMB_colormanagement_display_settings_from_ctx (const bContext *C, ColorManagedViewSettings **r_view_settings, ColorManagedDisplaySettings **r_display_settings)
 
const char * IMB_colormanagement_get_display_colorspace_name (const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings)
 
static ColorSpacedisplay_transform_get_colorspace (const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings)
 
static OCIO_ConstCPUProcessorRcPtr * create_display_buffer_processor (const char *look, const char *view_transform, const char *display, float exposure, float gamma, const char *from_colorspace)
 
static OCIO_ConstProcessorRcPtr * create_colorspace_transform_processor (const char *from_colorspace, const char *to_colorspace)
 
static OCIO_ConstCPUProcessorRcPtr * colorspace_to_scene_linear_cpu_processor (ColorSpace *colorspace)
 
static OCIO_ConstCPUProcessorRcPtr * colorspace_from_scene_linear_cpu_processor (ColorSpace *colorspace)
 
static OCIO_ConstCPUProcessorRcPtr * display_from_scene_linear_processor (ColorManagedDisplay *display)
 
static OCIO_ConstCPUProcessorRcPtr * display_to_scene_linear_processor (ColorManagedDisplay *display)
 
void IMB_colormanagement_init_default_view_settings (ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings)
 
static void curve_mapping_apply_pixel (CurveMapping *curve_mapping, float *pixel, int channels)
 
void colorspace_set_default_role (char *colorspace, int size, int role)
 
void colormanage_imbuf_set_default_spaces (ImBuf *ibuf)
 
void colormanage_imbuf_make_linear (ImBuf *ibuf, const char *from_colorspace)
 
Generic Functions
static void colormanage_check_display_settings (ColorManagedDisplaySettings *display_settings, const char *what, const ColorManagedDisplay *default_display)
 
static void colormanage_check_view_settings (ColorManagedDisplaySettings *display_settings, ColorManagedViewSettings *view_settings, const char *what)
 
static void colormanage_check_colorspace_settings (ColorManagedColorspaceSettings *colorspace_settings, const char *what)
 
void IMB_colormanagement_check_file_config (Main *bmain)
 
void IMB_colormanagement_validate_settings (const ColorManagedDisplaySettings *display_settings, ColorManagedViewSettings *view_settings)
 
const char * IMB_colormanagement_role_colorspace_name_get (int role)
 
void IMB_colormanagement_check_is_data (ImBuf *ibuf, const char *name)
 
void IMB_colormanagegent_copy_settings (ImBuf *ibuf_src, ImBuf *ibuf_dst)
 
void IMB_colormanagement_assign_float_colorspace (ImBuf *ibuf, const char *name)
 
void IMB_colormanagement_assign_rect_colorspace (ImBuf *ibuf, const char *name)
 
const char * IMB_colormanagement_get_float_colorspace (ImBuf *ibuf)
 
const char * IMB_colormanagement_get_rect_colorspace (ImBuf *ibuf)
 
bool IMB_colormanagement_space_is_data (ColorSpace *colorspace)
 
static void colormanage_ensure_srgb_scene_linear_info (ColorSpace *colorspace)
 
bool IMB_colormanagement_space_is_scene_linear (ColorSpace *colorspace)
 
bool IMB_colormanagement_space_is_srgb (ColorSpace *colorspace)
 
bool IMB_colormanagement_space_name_is_data (const char *name)
 
const floatIMB_colormangement_get_xyz_to_rgb ()
 
Color Space Transformation Functions
static void colormanagement_transform_ex (unsigned char *byte_buffer, float *float_buffer, int width, int height, int channels, const char *from_colorspace, const char *to_colorspace, bool predivide, bool do_threaded)
 
void IMB_colormanagement_transform (float *buffer, int width, int height, int channels, const char *from_colorspace, const char *to_colorspace, bool predivide)
 
void IMB_colormanagement_transform_threaded (float *buffer, int width, int height, int channels, const char *from_colorspace, const char *to_colorspace, bool predivide)
 
void IMB_colormanagement_transform_byte (unsigned char *buffer, int width, int height, int channels, const char *from_colorspace, const char *to_colorspace)
 
void IMB_colormanagement_transform_byte_threaded (unsigned char *buffer, int width, int height, int channels, const char *from_colorspace, const char *to_colorspace)
 
void IMB_colormanagement_transform_from_byte (float *float_buffer, unsigned char *byte_buffer, int width, int height, int channels, const char *from_colorspace, const char *to_colorspace)
 
void IMB_colormanagement_transform_from_byte_threaded (float *float_buffer, unsigned char *byte_buffer, int width, int height, int channels, const char *from_colorspace, const char *to_colorspace)
 
void IMB_colormanagement_transform_v4 (float pixel[4], const char *from_colorspace, const char *to_colorspace)
 
void IMB_colormanagement_colorspace_to_scene_linear_v3 (float pixel[3], ColorSpace *colorspace)
 
void IMB_colormanagement_scene_linear_to_colorspace_v3 (float pixel[3], ColorSpace *colorspace)
 
void IMB_colormanagement_colorspace_to_scene_linear_v4 (float pixel[4], bool predivide, ColorSpace *colorspace)
 
void IMB_colormanagement_colorspace_to_scene_linear (float *buffer, int width, int height, int channels, struct ColorSpace *colorspace, bool predivide)
 
void IMB_colormanagement_imbuf_to_byte_texture (unsigned char *out_buffer, const int offset_x, const int offset_y, const int width, const int height, const struct ImBuf *ibuf, const bool compress_as_srgb, const bool store_premultiplied)
 
void IMB_colormanagement_imbuf_to_float_texture (float *out_buffer, const int offset_x, const int offset_y, const int width, const int height, const struct ImBuf *ibuf, const bool store_premultiplied)
 
void IMB_colormanagement_scene_linear_to_color_picking_v3 (float pixel[3])
 
void IMB_colormanagement_color_picking_to_scene_linear_v3 (float pixel[3])
 
void IMB_colormanagement_scene_linear_to_srgb_v3 (float pixel[3])
 
void IMB_colormanagement_srgb_to_scene_linear_v3 (float pixel[3])
 
void IMB_colormanagement_scene_linear_to_display_v3 (float pixel[3], ColorManagedDisplay *display)
 
void IMB_colormanagement_display_to_scene_linear_v3 (float pixel[3], ColorManagedDisplay *display)
 
void IMB_colormanagement_pixel_to_display_space_v4 (float result[4], const float pixel[4], const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings)
 
void IMB_colormanagement_pixel_to_display_space_v3 (float result[3], const float pixel[3], const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings)
 
static void colormanagement_imbuf_make_display_space (ImBuf *ibuf, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, bool make_byte)
 
void IMB_colormanagement_imbuf_make_display_space (ImBuf *ibuf, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings)
 
ImBufIMB_colormanagement_imbuf_for_write (ImBuf *ibuf, bool save_as_render, bool allocate_result, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, ImageFormatData *image_format_data)
 
void IMB_colormanagement_buffer_make_display_space (float *buffer, unsigned char *display_buffer, int width, int height, int channels, float dither, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings)
 
Public Display Buffers Interfaces
unsigned char * IMB_display_buffer_acquire (ImBuf *ibuf, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, void **cache_handle)
 
unsigned char * IMB_display_buffer_acquire_ctx (const bContext *C, ImBuf *ibuf, void **cache_handle)
 
void IMB_display_buffer_transform_apply (unsigned char *display_buffer, float *linear_buffer, int width, int height, int channels, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, bool predivide)
 
void IMB_display_buffer_release (void *cache_handle)
 
Display Functions
const char * colormanage_display_get_default_name (void)
 
ColorManagedDisplaycolormanage_display_get_default (void)
 
ColorManagedDisplaycolormanage_display_add (const char *name)
 
ColorManagedDisplaycolormanage_display_get_named (const char *name)
 
ColorManagedDisplaycolormanage_display_get_indexed (int index)
 
int IMB_colormanagement_display_get_named_index (const char *name)
 
const char * IMB_colormanagement_display_get_indexed_name (int index)
 
const char * IMB_colormanagement_display_get_default_name (void)
 
ColorManagedDisplayIMB_colormanagement_display_get_named (const char *name)
 
const char * IMB_colormanagement_display_get_none_name (void)
 
const char * IMB_colormanagement_display_get_default_view_transform_name (struct ColorManagedDisplay *display)
 
View Functions
const char * colormanage_view_get_default_name (const ColorManagedDisplay *display)
 
ColorManagedViewcolormanage_view_get_default (const ColorManagedDisplay *display)
 
ColorManagedViewcolormanage_view_add (const char *name)
 
ColorManagedViewcolormanage_view_get_named (const char *name)
 
ColorManagedViewcolormanage_view_get_indexed (int index)
 
ColorManagedViewcolormanage_view_get_named_for_display (const char *display_name, const char *name)
 
int IMB_colormanagement_view_get_named_index (const char *name)
 
const char * IMB_colormanagement_view_get_indexed_name (int index)
 
const char * IMB_colormanagement_view_get_default_name (const char *display_name)
 
Color Space Functions
static void colormanage_description_strip (char *description)
 
ColorSpacecolormanage_colorspace_add (const char *name, const char *description, bool is_invertible, bool is_data)
 
ColorSpacecolormanage_colorspace_get_named (const char *name)
 
ColorSpacecolormanage_colorspace_get_roled (int role)
 
ColorSpacecolormanage_colorspace_get_indexed (int index)
 
int IMB_colormanagement_colorspace_get_named_index (const char *name)
 
const char * IMB_colormanagement_colorspace_get_indexed_name (int index)
 
void IMB_colormanagement_colorspace_from_ibuf_ftype (ColorManagedColorspaceSettings *colorspace_settings, ImBuf *ibuf)
 
Looks Functions
ColorManagedLookcolormanage_look_add (const char *name, const char *process_space, bool is_noop)
 
ColorManagedLookcolormanage_look_get_named (const char *name)
 
ColorManagedLookcolormanage_look_get_indexed (int index)
 
int IMB_colormanagement_look_get_named_index (const char *name)
 
const char * IMB_colormanagement_look_get_indexed_name (int index)
 
RNA Helper Functions
void IMB_colormanagement_display_items_add (EnumPropertyItem **items, int *totitem)
 
static void colormanagement_view_item_add (EnumPropertyItem **items, int *totitem, ColorManagedView *view)
 
void IMB_colormanagement_view_items_add (EnumPropertyItem **items, int *totitem, const char *display_name)
 
void IMB_colormanagement_look_items_add (struct EnumPropertyItem **items, int *totitem, const char *view_name)
 
void IMB_colormanagement_colorspace_items_add (EnumPropertyItem **items, int *totitem)
 
Pixel Processor Functions
ColormanageProcessorIMB_colormanagement_display_processor_new (const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings)
 
ColormanageProcessorIMB_colormanagement_colorspace_processor_new (const char *from_colorspace, const char *to_colorspace)
 
void IMB_colormanagement_processor_apply_v4 (ColormanageProcessor *cm_processor, float pixel[4])
 
void IMB_colormanagement_processor_apply_v4_predivide (ColormanageProcessor *cm_processor, float pixel[4])
 
void IMB_colormanagement_processor_apply_v3 (ColormanageProcessor *cm_processor, float pixel[3])
 
void IMB_colormanagement_processor_apply_pixel (struct ColormanageProcessor *cm_processor, float *pixel, int channels)
 
void IMB_colormanagement_processor_apply (ColormanageProcessor *cm_processor, float *buffer, int width, int height, int channels, bool predivide)
 
void IMB_colormanagement_processor_apply_byte (ColormanageProcessor *cm_processor, unsigned char *buffer, int width, int height, int channels)
 
void IMB_colormanagement_processor_free (ColormanageProcessor *cm_processor)
 
static void curve_mapping_to_ocio_settings (CurveMapping *curve_mapping, OCIO_CurveMappingSettings *curve_mapping_settings)
 
static OCIO_CurveMappingSettingsupdate_glsl_curve_mapping (const ColorManagedViewSettings *view_settings)
 
bool IMB_colormanagement_support_glsl_draw (const ColorManagedViewSettings *UNUSED(view_settings))
 
bool IMB_colormanagement_setup_glsl_draw_from_space (const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, struct ColorSpace *from_colorspace, float dither, bool predivide, bool do_overlay_merge)
 
bool IMB_colormanagement_setup_glsl_draw (const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, float dither, bool predivide)
 
bool IMB_colormanagement_setup_glsl_draw_from_space_ctx (const bContext *C, struct ColorSpace *from_colorspace, float dither, bool predivide)
 
bool IMB_colormanagement_setup_glsl_draw_ctx (const bContext *C, float dither, bool predivide)
 
void IMB_colormanagement_finish_glsl_draw (void)
 

Global declarations

#define DISPLAY_BUFFER_CHANNELS   4
 
typedef struct ColormanageProcessor ColormanageProcessor
 
static char global_role_data [MAX_COLORSPACE_NAME]
 
static char global_role_scene_linear [MAX_COLORSPACE_NAME]
 
static char global_role_color_picking [MAX_COLORSPACE_NAME]
 
static char global_role_texture_painting [MAX_COLORSPACE_NAME]
 
static char global_role_default_byte [MAX_COLORSPACE_NAME]
 
static char global_role_default_float [MAX_COLORSPACE_NAME]
 
static char global_role_default_sequencer [MAX_COLORSPACE_NAME]
 
static ListBase global_colorspaces = {NULL, NULL}
 
static ListBase global_displays = {NULL, NULL}
 
static ListBase global_views = {NULL, NULL}
 
static ListBase global_looks = {NULL, NULL}
 
static int global_tot_colorspace = 0
 
static int global_tot_display = 0
 
static int global_tot_view = 0
 
static int global_tot_looks = 0
 
float imbuf_luma_coefficients [3] = {0.0f}
 
float imbuf_xyz_to_rgb [3][3] = {{0.0f}}
 
float imbuf_rgb_to_xyz [3][3] = {{0.0f}}
 
static float imbuf_xyz_to_linear_srgb [3][3] = {{0.0f}}
 
static float imbuf_linear_srgb_to_xyz [3][3] = {{0.0f}}
 
static pthread_mutex_t processor_lock = BLI_MUTEX_INITIALIZER
 
static struct global_gpu_state global_gpu_state = {false}
 
static struct global_color_picking_state global_color_picking_state = {NULL}
 

Color Managed Cache

typedef struct ColormanageCacheViewSettings ColormanageCacheViewSettings
 
typedef struct ColormanageCacheDisplaySettings ColormanageCacheDisplaySettings
 
typedef struct ColormanageCacheKey ColormanageCacheKey
 
typedef struct ColormanageCacheData ColormanageCacheData
 
typedef struct ColormanageCache ColormanageCache
 
static struct MovieCachecolormanage_moviecache_get (const ImBuf *ibuf)
 
static ColormanageCacheDatacolormanage_cachedata_get (const ImBuf *ibuf)
 
static unsigned int colormanage_hashhash (const void *key_v)
 
static bool colormanage_hashcmp (const void *av, const void *bv)
 
static struct MovieCachecolormanage_moviecache_ensure (ImBuf *ibuf)
 
static void colormanage_cachedata_set (ImBuf *ibuf, ColormanageCacheData *data)
 
static void colormanage_view_settings_to_cache (ImBuf *ibuf, ColormanageCacheViewSettings *cache_view_settings, const ColorManagedViewSettings *view_settings)
 
static void colormanage_display_settings_to_cache (ColormanageCacheDisplaySettings *cache_display_settings, const ColorManagedDisplaySettings *display_settings)
 
static void colormanage_settings_to_key (ColormanageCacheKey *key, const ColormanageCacheViewSettings *view_settings, const ColormanageCacheDisplaySettings *display_settings)
 
static ImBufcolormanage_cache_get_ibuf (ImBuf *ibuf, ColormanageCacheKey *key, void **cache_handle)
 
static unsigned char * colormanage_cache_get (ImBuf *ibuf, const ColormanageCacheViewSettings *view_settings, const ColormanageCacheDisplaySettings *display_settings, void **cache_handle)
 
static void colormanage_cache_put (ImBuf *ibuf, const ColormanageCacheViewSettings *view_settings, const ColormanageCacheDisplaySettings *display_settings, unsigned char *display_buffer, void **cache_handle)
 
static void colormanage_cache_handle_release (void *cache_handle)
 

Threaded Display Buffer Transform Routines

typedef struct DisplayBufferThread DisplayBufferThread
 
typedef struct DisplayBufferInitData DisplayBufferInitData
 
static void display_buffer_init_handle (void *handle_v, int start_line, int tot_line, void *init_data_v)
 
static void display_buffer_apply_get_linear_buffer (DisplayBufferThread *handle, int height, float *linear_buffer, bool *is_straight_alpha)
 
static void * do_display_buffer_apply_thread (void *handle_v)
 
static void display_buffer_apply_threaded (ImBuf *ibuf, const float *buffer, unsigned char *byte_buffer, float *display_buffer, unsigned char *display_buffer_byte, ColormanageProcessor *cm_processor)
 
static bool is_ibuf_rect_in_display_space (ImBuf *ibuf, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings)
 
static void colormanage_display_buffer_process_ex (ImBuf *ibuf, float *display_buffer, unsigned char *display_buffer_byte, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings)
 
static void colormanage_display_buffer_process (ImBuf *ibuf, unsigned char *display_buffer, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings)
 

Threaded Processor Transform Routines

typedef struct ProcessorTransformThread ProcessorTransformThread
 
typedef struct ProcessorTransformInit ProcessorTransformInitData
 
static void processor_transform_init_handle (void *handle_v, int start_line, int tot_line, void *init_data_v)
 
static void * do_processor_transform_thread (void *handle_v)
 
static void processor_transform_apply_threaded (unsigned char *byte_buffer, float *float_buffer, const int width, const int height, const int channels, ColormanageProcessor *cm_processor, const bool predivide, const bool float_from_byte)
 

Partial Display Buffer Update

typedef struct PartialThreadData PartialThreadData
 
static void partial_buffer_update_rect (ImBuf *ibuf, unsigned char *display_buffer, const float *linear_buffer, const unsigned char *byte_buffer, int display_stride, int linear_stride, int linear_offset_x, int linear_offset_y, ColormanageProcessor *cm_processor, const int xmin, const int ymin, const int xmax, const int ymax)
 
static void partial_buffer_update_rect_thread_do (void *data_v, int start_scanline, int num_scanlines)
 
static void imb_partial_display_buffer_update_ex (ImBuf *ibuf, const float *linear_buffer, const unsigned char *byte_buffer, int stride, int offset_x, int offset_y, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, int xmin, int ymin, int xmax, int ymax, bool do_threads)
 
void IMB_partial_display_buffer_update (ImBuf *ibuf, const float *linear_buffer, const unsigned char *byte_buffer, int stride, int offset_x, int offset_y, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, int xmin, int ymin, int xmax, int ymax)
 
void IMB_partial_display_buffer_update_threaded (struct ImBuf *ibuf, const float *linear_buffer, const unsigned char *byte_buffer, int stride, int offset_x, int offset_y, const struct ColorManagedViewSettings *view_settings, const struct ColorManagedDisplaySettings *display_settings, int xmin, int ymin, int xmax, int ymax)
 
void IMB_partial_display_buffer_update_delayed (ImBuf *ibuf, int xmin, int ymin, int xmax, int ymax)
 

Macro Definition Documentation

◆ DISPLAY_BUFFER_CHANNELS

#define DISPLAY_BUFFER_CHANNELS   4

Definition at line 68 of file colormanagement.c.

Typedef Documentation

◆ ColormanageCache

◆ ColormanageCacheData

◆ ColormanageCacheDisplaySettings

◆ ColormanageCacheKey

◆ ColormanageCacheViewSettings

Cache Implementation Notes

All color management cache stuff is stored in two properties of image buffers:

  1. display_buffer_flags

    This is a bit field which used to mark calculated transformations for particular image buffer. Index inside of this array means index of a color managed display. Element with given index matches view transformations applied for a given display. So if bit B of array element B is set to 1, this means display buffer with display index of A and view transform of B was ever calculated for this imbuf.

    In contrast with indices in global lists of displays and views this indices are 0-based, not 1-based. This is needed to save some bytes of memory.

  2. colormanage_cache

    This is a pointer to a structure which holds all data which is needed for color management cache to work.

    It contains two parts:

    • data
    • moviecache

    Data field is used to store additional information about cached buffers which affects on whether cached buffer could be used. This data can't go to cache key because changes in this data shouldn't lead extra buffers adding to cache, it shall invalidate cached images.

    Currently such a data contains only exposure and gamma, but would likely extended further.

    data field is not null only for elements of cache, not used for original image buffers.

    Color management cache is using generic MovieCache implementation to make it easier to deal with memory limitation.

    Currently color management is using the same memory limitation pool as sequencer and clip editor are using which means color managed buffers would be removed from the cache as soon as new frames are loading for the movie clip and there's no space in cache.

    Every image buffer has got own movie cache instance, which means keys for color managed buffers could be really simple and look up in this cache would be fast and independent from overall amount of color managed images.

◆ ColormanageProcessor

◆ DisplayBufferInitData

◆ DisplayBufferThread

◆ PartialThreadData

◆ ProcessorTransformInitData

◆ ProcessorTransformThread

Function Documentation

◆ colormanage_cache_free()

void colormanage_cache_free ( ImBuf ibuf)

◆ colormanage_cache_get()

static unsigned char* colormanage_cache_get ( ImBuf ibuf,
const ColormanageCacheViewSettings view_settings,
const ColormanageCacheDisplaySettings display_settings,
void **  cache_handle 
)
static

◆ colormanage_cache_get_ibuf()

static ImBuf* colormanage_cache_get_ibuf ( ImBuf ibuf,
ColormanageCacheKey key,
void **  cache_handle 
)
static

Definition at line 330 of file colormanagement.c.

References colormanage_moviecache_get(), IMB_moviecache_get(), and NULL.

Referenced by colormanage_cache_get().

◆ colormanage_cache_handle_release()

static void colormanage_cache_handle_release ( void *  cache_handle)
static

Definition at line 449 of file colormanagement.c.

References IMB_freeImBuf().

Referenced by IMB_display_buffer_release().

◆ colormanage_cache_put()

static void colormanage_cache_put ( ImBuf ibuf,
const ColormanageCacheViewSettings view_settings,
const ColormanageCacheDisplaySettings display_settings,
unsigned char *  display_buffer,
void **  cache_handle 
)
static

◆ colormanage_cachedata_get()

static ColormanageCacheData* colormanage_cachedata_get ( const ImBuf ibuf)
static

◆ colormanage_cachedata_set()

static void colormanage_cachedata_set ( ImBuf ibuf,
ColormanageCacheData data 
)
static

Definition at line 288 of file colormanagement.c.

References ImBuf::colormanage_cache, data, ColormanageCache::data, and MEM_callocN.

Referenced by colormanage_cache_put().

◆ colormanage_check_colorspace_settings()

static void colormanage_check_colorspace_settings ( ColorManagedColorspaceSettings colorspace_settings,
const char *  what 
)
static

◆ colormanage_check_display_settings()

static void colormanage_check_display_settings ( ColorManagedDisplaySettings display_settings,
const char *  what,
const ColorManagedDisplay default_display 
)
static

◆ colormanage_check_view_settings()

static void colormanage_check_view_settings ( ColorManagedDisplaySettings display_settings,
ColorManagedViewSettings view_settings,
const char *  what 
)
static

◆ colormanage_colorspace_add()

ColorSpace* colormanage_colorspace_add ( const char *  name,
const char *  description,
bool  is_invertible,
bool  is_data 
)

◆ colormanage_colorspace_get_indexed()

ColorSpace* colormanage_colorspace_get_indexed ( int  index)

◆ colormanage_colorspace_get_named()

ColorSpace* colormanage_colorspace_get_named ( const char *  name)

◆ colormanage_colorspace_get_roled()

ColorSpace* colormanage_colorspace_get_roled ( int  role)

◆ colormanage_compatible_look()

static bool colormanage_compatible_look ( ColorManagedLook look,
const char *  view_name 
)
static

◆ colormanage_description_strip()

static void colormanage_description_strip ( char *  description)
static

Definition at line 3047 of file colormanagement.c.

References ELEM.

Referenced by colormanage_colorspace_add().

◆ colormanage_display_add()

ColorManagedDisplay* colormanage_display_add ( const char *  name)

◆ colormanage_display_buffer_process()

static void colormanage_display_buffer_process ( ImBuf ibuf,
unsigned char *  display_buffer,
const ColorManagedViewSettings view_settings,
const ColorManagedDisplaySettings display_settings 
)
static

Definition at line 1780 of file colormanagement.c.

References colormanage_display_buffer_process_ex(), and NULL.

Referenced by IMB_display_buffer_acquire().

◆ colormanage_display_buffer_process_ex()

static void colormanage_display_buffer_process_ex ( ImBuf ibuf,
float display_buffer,
unsigned char *  display_buffer_byte,
const ColorManagedViewSettings view_settings,
const ColorManagedDisplaySettings display_settings 
)
static

◆ colormanage_display_get_default()

ColorManagedDisplay* colormanage_display_get_default ( void  )

◆ colormanage_display_get_default_name()

const char* colormanage_display_get_default_name ( void  )

◆ colormanage_display_get_indexed()

ColorManagedDisplay* colormanage_display_get_indexed ( int  index)

Definition at line 2863 of file colormanagement.c.

References BLI_findlink(), and global_displays.

Referenced by IMB_colormanagement_display_get_indexed_name().

◆ colormanage_display_get_named()

ColorManagedDisplay* colormanage_display_get_named ( const char *  name)

◆ colormanage_display_settings_to_cache()

static void colormanage_display_settings_to_cache ( ColormanageCacheDisplaySettings cache_display_settings,
const ColorManagedDisplaySettings display_settings 
)
static

◆ colormanage_ensure_srgb_scene_linear_info()

static void colormanage_ensure_srgb_scene_linear_info ( ColorSpace colorspace)
static

◆ colormanage_free_config()

static void colormanage_free_config ( void  )
static

◆ colormanage_hashcmp()

static bool colormanage_hashcmp ( const void *  av,
const void *  bv 
)
static

◆ colormanage_hashhash()

static unsigned int colormanage_hashhash ( const void *  key_v)
static

◆ colormanage_imbuf_make_linear()

void colormanage_imbuf_make_linear ( ImBuf ibuf,
const char *  from_colorspace 
)

◆ colormanage_imbuf_set_default_spaces()

void colormanage_imbuf_set_default_spaces ( ImBuf ibuf)

◆ colormanage_load_config()

static void colormanage_load_config ( OCIO_ConstConfigRcPtr *  config)
static

◆ colormanage_look_add()

ColorManagedLook* colormanage_look_add ( const char *  name,
const char *  process_space,
bool  is_noop 
)

◆ colormanage_look_get_indexed()

ColorManagedLook* colormanage_look_get_indexed ( int  index)

Definition at line 3231 of file colormanagement.c.

References BLI_findlink(), and global_looks.

Referenced by IMB_colormanagement_look_get_indexed_name().

◆ colormanage_look_get_named()

ColorManagedLook* colormanage_look_get_named ( const char *  name)

◆ colormanage_moviecache_ensure()

static struct MovieCache* colormanage_moviecache_ensure ( ImBuf ibuf)
static

◆ colormanage_moviecache_get()

static struct MovieCache* colormanage_moviecache_get ( const ImBuf ibuf)
static

◆ colormanage_role_color_space_name_get()

static void colormanage_role_color_space_name_get ( OCIO_ConstConfigRcPtr *  config,
char *  colorspace_name,
const char *  role,
const char *  backup_role 
)
static

◆ colormanage_settings_to_key()

static void colormanage_settings_to_key ( ColormanageCacheKey key,
const ColormanageCacheViewSettings view_settings,
const ColormanageCacheDisplaySettings display_settings 
)
static

◆ colormanage_use_look()

static bool colormanage_use_look ( const char *  look,
const char *  view_name 
)
static

◆ colormanage_view_add()

ColorManagedView* colormanage_view_add ( const char *  name)

◆ colormanage_view_get_default()

ColorManagedView* colormanage_view_get_default ( const ColorManagedDisplay display)

◆ colormanage_view_get_default_name()

const char* colormanage_view_get_default_name ( const ColorManagedDisplay display)

◆ colormanage_view_get_indexed()

ColorManagedView* colormanage_view_get_indexed ( int  index)

Definition at line 2981 of file colormanagement.c.

References BLI_findlink(), and global_views.

Referenced by IMB_colormanagement_view_get_indexed_name().

◆ colormanage_view_get_named()

ColorManagedView* colormanage_view_get_named ( const char *  name)

◆ colormanage_view_get_named_for_display()

ColorManagedView* colormanage_view_get_named_for_display ( const char *  display_name,
const char *  name 
)

◆ colormanage_view_settings_to_cache()

static void colormanage_view_settings_to_cache ( ImBuf ibuf,
ColormanageCacheViewSettings cache_view_settings,
const ColorManagedViewSettings view_settings 
)
static

◆ colormanagement_exit()

void colormanagement_exit ( void  )

◆ colormanagement_imbuf_make_display_space()

static void colormanagement_imbuf_make_display_space ( ImBuf ibuf,
const ColorManagedViewSettings view_settings,
const ColorManagedDisplaySettings display_settings,
bool  make_byte 
)
static

◆ colormanagement_init()

void colormanagement_init ( void  )

◆ colormanagement_transform_ex()

static void colormanagement_transform_ex ( unsigned char *  byte_buffer,
float float_buffer,
int  width,
int  height,
int  channels,
const char *  from_colorspace,
const char *  to_colorspace,
bool  predivide,
bool  do_threaded 
)
static

◆ colormanagement_view_item_add()

static void colormanagement_view_item_add ( EnumPropertyItem **  items,
int *  totitem,
ColorManagedView view 
)
static

◆ colorspace_from_scene_linear_cpu_processor()

static OCIO_ConstCPUProcessorRcPtr* colorspace_from_scene_linear_cpu_processor ( ColorSpace colorspace)
static

◆ colorspace_set_default_role()

void colorspace_set_default_role ( char *  colorspace,
int  size,
int  role 
)

◆ colorspace_to_scene_linear_cpu_processor()

static OCIO_ConstCPUProcessorRcPtr* colorspace_to_scene_linear_cpu_processor ( ColorSpace colorspace)
static

◆ create_colorspace_transform_processor()

static OCIO_ConstProcessorRcPtr* create_colorspace_transform_processor ( const char *  from_colorspace,
const char *  to_colorspace 
)
static

◆ create_display_buffer_processor()

static OCIO_ConstCPUProcessorRcPtr* create_display_buffer_processor ( const char *  look,
const char *  view_transform,
const char *  display,
float  exposure,
float  gamma,
const char *  from_colorspace 
)
static

◆ curve_mapping_apply_pixel()

static void curve_mapping_apply_pixel ( CurveMapping curve_mapping,
float pixel,
int  channels 
)
static

◆ curve_mapping_to_ocio_settings()

static void curve_mapping_to_ocio_settings ( CurveMapping curve_mapping,
OCIO_CurveMappingSettings curve_mapping_settings 
)
static

◆ display_buffer_apply_get_linear_buffer()

static void display_buffer_apply_get_linear_buffer ( DisplayBufferThread handle,
int  height,
float linear_buffer,
bool *  is_straight_alpha 
)
static

◆ display_buffer_apply_threaded()

static void display_buffer_apply_threaded ( ImBuf ibuf,
const float buffer,
unsigned char *  byte_buffer,
float display_buffer,
unsigned char *  display_buffer_byte,
ColormanageProcessor cm_processor 
)
static

◆ display_buffer_init_handle()

static void display_buffer_init_handle ( void *  handle_v,
int  start_line,
int  tot_line,
void *  init_data_v 
)
static

◆ display_from_scene_linear_processor()

static OCIO_ConstCPUProcessorRcPtr* display_from_scene_linear_processor ( ColorManagedDisplay display)
static

◆ display_to_scene_linear_processor()

static OCIO_ConstCPUProcessorRcPtr* display_to_scene_linear_processor ( ColorManagedDisplay display)
static

◆ display_transform_get_colorspace()

static ColorSpace* display_transform_get_colorspace ( const ColorManagedViewSettings view_settings,
const ColorManagedDisplaySettings display_settings 
)
static

◆ do_display_buffer_apply_thread()

static void* do_display_buffer_apply_thread ( void *  handle_v)
static

◆ do_processor_transform_thread()

static void* do_processor_transform_thread ( void *  handle_v)
static

◆ IMB_colormanagegent_copy_settings()

void IMB_colormanagegent_copy_settings ( ImBuf ibuf_src,
ImBuf ibuf_dst 
)

◆ IMB_colormanagement_assign_float_colorspace()

void IMB_colormanagement_assign_float_colorspace ( ImBuf ibuf,
const char *  name 
)

◆ IMB_colormanagement_assign_rect_colorspace()

void IMB_colormanagement_assign_rect_colorspace ( ImBuf ibuf,
const char *  name 
)

◆ IMB_colormanagement_buffer_make_display_space()

void IMB_colormanagement_buffer_make_display_space ( float buffer,
unsigned char *  display_buffer,
int  width,
int  height,
int  channels,
float  dither,
const ColorManagedViewSettings view_settings,
const ColorManagedDisplaySettings display_settings 
)

◆ IMB_colormanagement_check_file_config()

void IMB_colormanagement_check_file_config ( Main bmain)

◆ IMB_colormanagement_check_is_data()

void IMB_colormanagement_check_is_data ( ImBuf ibuf,
const char *  name 
)

◆ IMB_colormanagement_color_picking_to_scene_linear_v3()

void IMB_colormanagement_color_picking_to_scene_linear_v3 ( float  pixel[3])

◆ IMB_colormanagement_colorspace_from_ibuf_ftype()

void IMB_colormanagement_colorspace_from_ibuf_ftype ( ColorManagedColorspaceSettings colorspace_settings,
ImBuf ibuf 
)

◆ IMB_colormanagement_colorspace_get_indexed_name()

const char* IMB_colormanagement_colorspace_get_indexed_name ( int  index)

Definition at line 3152 of file colormanagement.c.

References colormanage_colorspace_get_indexed(), and ColorSpace::name.

◆ IMB_colormanagement_colorspace_get_named_index()

int IMB_colormanagement_colorspace_get_named_index ( const char *  name)

Definition at line 3139 of file colormanagement.c.

References colormanage_colorspace_get_named(), and ColorSpace::index.

◆ IMB_colormanagement_colorspace_items_add()

void IMB_colormanagement_colorspace_items_add ( EnumPropertyItem **  items,
int *  totitem 
)

◆ IMB_colormanagement_colorspace_processor_new()

ColormanageProcessor* IMB_colormanagement_colorspace_processor_new ( const char *  from_colorspace,
const char *  to_colorspace 
)

◆ IMB_colormanagement_colorspace_to_scene_linear()

void IMB_colormanagement_colorspace_to_scene_linear ( float buffer,
int  width,
int  height,
int  channels,
struct ColorSpace colorspace,
bool  predivide 
)

◆ IMB_colormanagement_colorspace_to_scene_linear_v3()

void IMB_colormanagement_colorspace_to_scene_linear_v3 ( float  pixel[3],
ColorSpace colorspace 
)

◆ IMB_colormanagement_colorspace_to_scene_linear_v4()

void IMB_colormanagement_colorspace_to_scene_linear_v4 ( float  pixel[4],
bool  predivide,
ColorSpace colorspace 
)

◆ IMB_colormanagement_display_get_default_name()

const char* IMB_colormanagement_display_get_default_name ( void  )

◆ IMB_colormanagement_display_get_default_view_transform_name()

const char* IMB_colormanagement_display_get_default_view_transform_name ( struct ColorManagedDisplay display)

◆ IMB_colormanagement_display_get_indexed_name()

const char* IMB_colormanagement_display_get_indexed_name ( int  index)

◆ IMB_colormanagement_display_get_named()

ColorManagedDisplay* IMB_colormanagement_display_get_named ( const char *  name)

◆ IMB_colormanagement_display_get_named_index()

int IMB_colormanagement_display_get_named_index ( const char *  name)

◆ IMB_colormanagement_display_get_none_name()

const char* IMB_colormanagement_display_get_none_name ( void  )

◆ IMB_colormanagement_display_items_add()

void IMB_colormanagement_display_items_add ( EnumPropertyItem **  items,
int *  totitem 
)

◆ IMB_colormanagement_display_processor_new()

ColormanageProcessor* IMB_colormanagement_display_processor_new ( const ColorManagedViewSettings view_settings,
const ColorManagedDisplaySettings display_settings 
)

◆ IMB_colormanagement_display_settings_from_ctx()

void IMB_colormanagement_display_settings_from_ctx ( const bContext C,
ColorManagedViewSettings **  r_view_settings,
ColorManagedDisplaySettings **  r_display_settings 
)

◆ IMB_colormanagement_display_to_scene_linear_v3()

void IMB_colormanagement_display_to_scene_linear_v3 ( float  pixel[3],
ColorManagedDisplay display 
)

◆ IMB_colormanagement_finish_glsl_draw()

void IMB_colormanagement_finish_glsl_draw ( void  )

◆ IMB_colormanagement_get_display_colorspace_name()

const char* IMB_colormanagement_get_display_colorspace_name ( const ColorManagedViewSettings view_settings,
const ColorManagedDisplaySettings display_settings 
)

◆ IMB_colormanagement_get_float_colorspace()

const char* IMB_colormanagement_get_float_colorspace ( ImBuf ibuf)

◆ IMB_colormanagement_get_rect_colorspace()

const char* IMB_colormanagement_get_rect_colorspace ( ImBuf ibuf)

◆ IMB_colormanagement_imbuf_for_write()

ImBuf* IMB_colormanagement_imbuf_for_write ( ImBuf ibuf,
bool  save_as_render,
bool  allocate_result,
const ColorManagedViewSettings view_settings,
const ColorManagedDisplaySettings display_settings,
ImageFormatData image_format_data 
)

◆ IMB_colormanagement_imbuf_make_display_space()

void IMB_colormanagement_imbuf_make_display_space ( ImBuf ibuf,
const ColorManagedViewSettings view_settings,
const ColorManagedDisplaySettings display_settings 
)

Definition at line 2463 of file colormanagement.c.

References colormanagement_imbuf_make_display_space().

◆ IMB_colormanagement_imbuf_to_byte_texture()

void IMB_colormanagement_imbuf_to_byte_texture ( unsigned char *  out_buffer,
const int  offset_x,
const int  offset_y,
const int  width,
const int  height,
const struct ImBuf ibuf,
const bool  compress_as_srgb,
const bool  store_premultiplied 
)

◆ IMB_colormanagement_imbuf_to_float_texture()

void IMB_colormanagement_imbuf_to_float_texture ( float out_buffer,
const int  offset_x,
const int  offset_y,
const int  width,
const int  height,
const struct ImBuf ibuf,
const bool  store_premultiplied 
)

◆ IMB_colormanagement_init_default_view_settings()

void IMB_colormanagement_init_default_view_settings ( ColorManagedViewSettings view_settings,
const ColorManagedDisplaySettings display_settings 
)

◆ IMB_colormanagement_look_get_indexed_name()

const char* IMB_colormanagement_look_get_indexed_name ( int  index)

Definition at line 3250 of file colormanagement.c.

References colormanage_look_get_indexed(), ColorManagedLook::name, and NULL.

◆ IMB_colormanagement_look_get_named_index()

int IMB_colormanagement_look_get_named_index ( const char *  name)

◆ IMB_colormanagement_look_items_add()

void IMB_colormanagement_look_items_add ( struct EnumPropertyItem **  items,
int *  totitem,
const char *  view_name 
)

◆ IMB_colormanagement_pixel_to_display_space_v3()

void IMB_colormanagement_pixel_to_display_space_v3 ( float  result[3],
const float  pixel[3],
const ColorManagedViewSettings view_settings,
const ColorManagedDisplaySettings display_settings 
)

◆ IMB_colormanagement_pixel_to_display_space_v4()

void IMB_colormanagement_pixel_to_display_space_v4 ( float  result[4],
const float  pixel[4],
const ColorManagedViewSettings view_settings,
const ColorManagedDisplaySettings display_settings 
)

◆ IMB_colormanagement_processor_apply()

void IMB_colormanagement_processor_apply ( ColormanageProcessor cm_processor,
float buffer,
int  width,
int  height,
int  channels,
bool  predivide 
)

◆ IMB_colormanagement_processor_apply_byte()

void IMB_colormanagement_processor_apply_byte ( ColormanageProcessor cm_processor,
unsigned char *  buffer,
int  width,
int  height,
int  channels 
)

◆ IMB_colormanagement_processor_apply_pixel()

void IMB_colormanagement_processor_apply_pixel ( struct ColormanageProcessor cm_processor,
float pixel,
int  channels 
)

◆ IMB_colormanagement_processor_apply_v3()

void IMB_colormanagement_processor_apply_v3 ( ColormanageProcessor cm_processor,
float  pixel[3] 
)

◆ IMB_colormanagement_processor_apply_v4()

void IMB_colormanagement_processor_apply_v4 ( ColormanageProcessor cm_processor,
float  pixel[4] 
)

◆ IMB_colormanagement_processor_apply_v4_predivide()

void IMB_colormanagement_processor_apply_v4_predivide ( ColormanageProcessor cm_processor,
float  pixel[4] 
)

◆ IMB_colormanagement_processor_free()

void IMB_colormanagement_processor_free ( ColormanageProcessor cm_processor)

◆ IMB_colormanagement_role_colorspace_name_get()

const char* IMB_colormanagement_role_colorspace_name_get ( int  role)

◆ IMB_colormanagement_scene_linear_to_color_picking_v3()

void IMB_colormanagement_scene_linear_to_color_picking_v3 ( float  pixel[3])

◆ IMB_colormanagement_scene_linear_to_colorspace_v3()

void IMB_colormanagement_scene_linear_to_colorspace_v3 ( float  pixel[3],
ColorSpace colorspace 
)

◆ IMB_colormanagement_scene_linear_to_display_v3()

void IMB_colormanagement_scene_linear_to_display_v3 ( float  pixel[3],
ColorManagedDisplay display 
)

◆ IMB_colormanagement_scene_linear_to_srgb_v3()

void IMB_colormanagement_scene_linear_to_srgb_v3 ( float  pixel[3])

◆ IMB_colormanagement_setup_glsl_draw()

bool IMB_colormanagement_setup_glsl_draw ( const ColorManagedViewSettings view_settings,
const ColorManagedDisplaySettings display_settings,
float  dither,
bool  predivide 
)

Definition at line 4102 of file colormanagement.c.

References IMB_colormanagement_setup_glsl_draw_from_space(), and NULL.

◆ IMB_colormanagement_setup_glsl_draw_ctx()

bool IMB_colormanagement_setup_glsl_draw_ctx ( const bContext C,
float  dither,
bool  predivide 
)

Definition at line 4130 of file colormanagement.c.

References C, IMB_colormanagement_setup_glsl_draw_from_space_ctx(), and NULL.

◆ IMB_colormanagement_setup_glsl_draw_from_space()

bool IMB_colormanagement_setup_glsl_draw_from_space ( const ColorManagedViewSettings view_settings,
const ColorManagedDisplaySettings display_settings,
struct ColorSpace from_colorspace,
float  dither,
bool  predivide,
bool  do_overlay_merge 
)

Configures GLSL shader for conversion from specified to display color space

Will create appropriate OCIO processor and setup GLSL shader, so further 2D texture usage will use this conversion.

When there's no need to apply transform on 2D textures, use IMB_colormanagement_finish_glsl_draw().

This is low-level function, use ED_draw_imbuf_ctx if you only need to display given image buffer

Definition at line 4044 of file colormanagement.c.

References colormanage_use_look(), ColorManagedDisplaySettings::display_device, ColorManagedViewSettings::exposure, ColorManagedViewSettings::gamma, global_role_scene_linear, global_gpu_state::gpu_shader_bound, IMB_colormanagement_init_default_view_settings(), ColorManagedViewSettings::look, max_ff(), ColorSpace::name, OCIO_configRelease(), OCIO_getCurrentConfig(), OCIO_gpuDisplayShaderBind(), powf, update_glsl_curve_mapping(), view, and ColorManagedViewSettings::view_transform.

Referenced by IMB_colormanagement_setup_glsl_draw(), and IMB_colormanagement_setup_glsl_draw_from_space_ctx().

◆ IMB_colormanagement_setup_glsl_draw_from_space_ctx()

bool IMB_colormanagement_setup_glsl_draw_from_space_ctx ( const bContext C,
struct ColorSpace from_colorspace,
float  dither,
bool  predivide 
)

Same as setup_glsl_draw_from_space, but color management settings are guessing from a given context.

Definition at line 4115 of file colormanagement.c.

References C, IMB_colormanagement_display_settings_from_ctx(), and IMB_colormanagement_setup_glsl_draw_from_space().

Referenced by IMB_colormanagement_setup_glsl_draw_ctx().

◆ IMB_colormanagement_space_is_data()

bool IMB_colormanagement_space_is_data ( ColorSpace colorspace)

Definition at line 1370 of file colormanagement.c.

◆ IMB_colormanagement_space_is_scene_linear()

bool IMB_colormanagement_space_is_scene_linear ( ColorSpace colorspace)

Definition at line 1394 of file colormanagement.c.

◆ IMB_colormanagement_space_is_srgb()

bool IMB_colormanagement_space_is_srgb ( ColorSpace colorspace)

◆ IMB_colormanagement_space_name_is_data()

bool IMB_colormanagement_space_name_is_data ( const char *  name)

◆ IMB_colormanagement_srgb_to_scene_linear_v3()

void IMB_colormanagement_srgb_to_scene_linear_v3 ( float  pixel[3])

◆ IMB_colormanagement_support_glsl_draw()

bool IMB_colormanagement_support_glsl_draw ( const ColorManagedViewSettings UNUSEDview_settings)

Definition at line 4026 of file colormanagement.c.

References OCIO_supportGPUShader().

◆ IMB_colormanagement_transform()

void IMB_colormanagement_transform ( float buffer,
int  width,
int  height,
int  channels,
const char *  from_colorspace,
const char *  to_colorspace,
bool  predivide 
)

◆ IMB_colormanagement_transform_byte()

void IMB_colormanagement_transform_byte ( unsigned char *  buffer,
int  width,
int  height,
int  channels,
const char *  from_colorspace,
const char *  to_colorspace 
)

Definition at line 2000 of file colormanagement.c.

References buffer, colormanagement_transform_ex(), height, NULL, and width.

◆ IMB_colormanagement_transform_byte_threaded()

void IMB_colormanagement_transform_byte_threaded ( unsigned char *  buffer,
int  width,
int  height,
int  channels,
const char *  from_colorspace,
const char *  to_colorspace 
)

Definition at line 2010 of file colormanagement.c.

References buffer, colormanagement_transform_ex(), height, NULL, and width.

Referenced by seq_imbuf_to_sequencer_space().

◆ IMB_colormanagement_transform_from_byte()

void IMB_colormanagement_transform_from_byte ( float float_buffer,
unsigned char *  byte_buffer,
int  width,
int  height,
int  channels,
const char *  from_colorspace,
const char *  to_colorspace 
)

◆ IMB_colormanagement_transform_from_byte_threaded()

void IMB_colormanagement_transform_from_byte_threaded ( float float_buffer,
unsigned char *  byte_buffer,
int  width,
int  height,
int  channels,
const char *  from_colorspace,
const char *  to_colorspace 
)

◆ IMB_colormanagement_transform_threaded()

void IMB_colormanagement_transform_threaded ( float buffer,
int  width,
int  height,
int  channels,
const char *  from_colorspace,
const char *  to_colorspace,
bool  predivide 
)

◆ IMB_colormanagement_transform_v4()

void IMB_colormanagement_transform_v4 ( float  pixel[4],
const char *  from_colorspace,
const char *  to_colorspace 
)

◆ IMB_colormanagement_validate_settings()

void IMB_colormanagement_validate_settings ( const ColorManagedDisplaySettings display_settings,
ColorManagedViewSettings view_settings 
)

◆ IMB_colormanagement_view_get_default_name()

const char* IMB_colormanagement_view_get_default_name ( const char *  display_name)

◆ IMB_colormanagement_view_get_indexed_name()

const char* IMB_colormanagement_view_get_indexed_name ( int  index)

Definition at line 3014 of file colormanagement.c.

References colormanage_view_get_indexed(), NULL, and view.

◆ IMB_colormanagement_view_get_named_index()

int IMB_colormanagement_view_get_named_index ( const char *  name)

Definition at line 3003 of file colormanagement.c.

References colormanage_view_get_named(), and view.

Referenced by colormanage_view_settings_to_cache().

◆ IMB_colormanagement_view_items_add()

void IMB_colormanagement_view_items_add ( EnumPropertyItem **  items,
int *  totitem,
const char *  display_name 
)

◆ IMB_colormangement_get_xyz_to_rgb()

const float* IMB_colormangement_get_xyz_to_rgb ( void  )

Definition at line 1412 of file colormanagement.c.

References imbuf_xyz_to_rgb.

Referenced by get_XYZ_to_RGB_for_gpu().

◆ IMB_display_buffer_acquire()

unsigned char* IMB_display_buffer_acquire ( ImBuf ibuf,
const ColorManagedViewSettings view_settings,
const ColorManagedDisplaySettings display_settings,
void **  cache_handle 
)

◆ IMB_display_buffer_acquire_ctx()

unsigned char* IMB_display_buffer_acquire_ctx ( const bContext C,
ImBuf ibuf,
void **  cache_handle 
)

◆ IMB_display_buffer_release()

void IMB_display_buffer_release ( void *  cache_handle)

◆ IMB_display_buffer_transform_apply()

void IMB_display_buffer_transform_apply ( unsigned char *  display_buffer,
float linear_buffer,
int  width,
int  height,
int  channels,
const ColorManagedViewSettings view_settings,
const ColorManagedDisplaySettings display_settings,
bool  predivide 
)

◆ IMB_partial_display_buffer_update()

void IMB_partial_display_buffer_update ( ImBuf ibuf,
const float linear_buffer,
const unsigned char *  byte_buffer,
int  stride,
int  offset_x,
int  offset_y,
const ColorManagedViewSettings view_settings,
const ColorManagedDisplaySettings display_settings,
int  xmin,
int  ymin,
int  xmax,
int  ymax 
)

Definition at line 3673 of file colormanagement.c.

References imb_partial_display_buffer_update_ex(), and stride.

◆ IMB_partial_display_buffer_update_delayed()

void IMB_partial_display_buffer_update_delayed ( ImBuf ibuf,
int  xmin,
int  ymin,
int  xmax,
int  ymax 
)

◆ imb_partial_display_buffer_update_ex()

static void imb_partial_display_buffer_update_ex ( ImBuf ibuf,
const float linear_buffer,
const unsigned char *  byte_buffer,
int  stride,
int  offset_x,
int  offset_y,
const ColorManagedViewSettings view_settings,
const ColorManagedDisplaySettings display_settings,
int  xmin,
int  ymin,
int  xmax,
int  ymax,
bool  do_threads 
)
static

◆ IMB_partial_display_buffer_update_threaded()

void IMB_partial_display_buffer_update_threaded ( struct ImBuf ibuf,
const float linear_buffer,
const unsigned char *  byte_buffer,
int  stride,
int  offset_x,
int  offset_y,
const struct ColorManagedViewSettings view_settings,
const struct ColorManagedDisplaySettings display_settings,
int  xmin,
int  ymin,
int  xmax,
int  ymax 
)

Definition at line 3701 of file colormanagement.c.

References height, imb_partial_display_buffer_update_ex(), stride, and width.

Referenced by IMB_display_buffer_acquire().

◆ is_ibuf_rect_in_display_space()

static bool is_ibuf_rect_in_display_space ( ImBuf ibuf,
const ColorManagedViewSettings view_settings,
const ColorManagedDisplaySettings display_settings 
)
static

◆ partial_buffer_update_rect()

static void partial_buffer_update_rect ( ImBuf ibuf,
unsigned char *  display_buffer,
const float linear_buffer,
const unsigned char *  byte_buffer,
int  display_stride,
int  linear_stride,
int  linear_offset_x,
int  linear_offset_y,
ColormanageProcessor cm_processor,
const int  xmin,
const int  ymin,
const int  xmax,
const int  ymax 
)
static

◆ partial_buffer_update_rect_thread_do()

static void partial_buffer_update_rect_thread_do ( void *  data_v,
int  start_scanline,
int  num_scanlines 
)
static

Definition at line 3542 of file colormanagement.c.

References data, and partial_buffer_update_rect().

Referenced by imb_partial_display_buffer_update_ex().

◆ processor_transform_apply_threaded()

static void processor_transform_apply_threaded ( unsigned char *  byte_buffer,
float float_buffer,
const int  width,
const int  height,
const int  channels,
ColormanageProcessor cm_processor,
const bool  predivide,
const bool  float_from_byte 
)
static

◆ processor_transform_init_handle()

static void processor_transform_init_handle ( void *  handle_v,
int  start_line,
int  tot_line,
void *  init_data_v 
)
static

◆ update_glsl_curve_mapping()

static OCIO_CurveMappingSettings* update_glsl_curve_mapping ( const ColorManagedViewSettings view_settings)
static

Variable Documentation

◆ global_color_picking_state

◆ global_colorspaces

ListBase global_colorspaces = {NULL, NULL}
static

◆ global_displays

ListBase global_displays = {NULL, NULL}
static

◆ global_gpu_state

struct global_gpu_state global_gpu_state = {false}
static

◆ global_looks

ListBase global_looks = {NULL, NULL}
static

◆ global_role_color_picking

char global_role_color_picking[MAX_COLORSPACE_NAME]
static

◆ global_role_data

char global_role_data[MAX_COLORSPACE_NAME]
static

◆ global_role_default_byte

char global_role_default_byte[MAX_COLORSPACE_NAME]
static

◆ global_role_default_float

char global_role_default_float[MAX_COLORSPACE_NAME]
static

◆ global_role_default_sequencer

char global_role_default_sequencer[MAX_COLORSPACE_NAME]
static

◆ global_role_scene_linear

char global_role_scene_linear[MAX_COLORSPACE_NAME]
static

◆ global_role_texture_painting

char global_role_texture_painting[MAX_COLORSPACE_NAME]
static

◆ global_tot_colorspace

int global_tot_colorspace = 0
static

Definition at line 84 of file colormanagement.c.

Referenced by colormanage_colorspace_add(), and colormanage_free_config().

◆ global_tot_display

int global_tot_display = 0
static

◆ global_tot_looks

int global_tot_looks = 0
static

Definition at line 87 of file colormanagement.c.

Referenced by colormanage_free_config(), and colormanage_look_add().

◆ global_tot_view

int global_tot_view = 0
static

◆ global_views

ListBase global_views = {NULL, NULL}
static

◆ imbuf_linear_srgb_to_xyz

float imbuf_linear_srgb_to_xyz[3][3] = {{0.0f}}
static

◆ imbuf_luma_coefficients

float imbuf_luma_coefficients[3] = {0.0f}

◆ imbuf_rgb_to_xyz

float imbuf_rgb_to_xyz[3][3] = {{0.0f}}

◆ imbuf_xyz_to_linear_srgb

float imbuf_xyz_to_linear_srgb[3][3] = {{0.0f}}
static

◆ imbuf_xyz_to_rgb

float imbuf_xyz_to_rgb[3][3] = {{0.0f}}

◆ processor_lock

pthread_mutex_t processor_lock = BLI_MUTEX_INITIALIZER
static