53 #define DISPLAY_BUFFER_CHANNELS 4
242 unsigned int rval = (key->
display << 16) | (key->
view % 0xffff);
252 return ((
a->view !=
b->view) || (
a->display !=
b->display));
291 cache_view_settings->
look = look;
294 cache_view_settings->
gamma = view_settings->
gamma;
296 cache_view_settings->
flag = view_settings->
flag;
306 cache_display_settings->
display = display;
330 *cache_handle =
NULL;
334 *cache_handle = cache_ibuf;
347 int view_flag = 1 << (view_settings->
view - 1);
349 int curve_mapping_timestamp = curve_mapping ? curve_mapping->
changed_timestamp : 0;
374 if (cache_data->
look != view_settings->
look ||
379 *cache_handle =
NULL;
386 return (
unsigned char *)cache_ibuf->
rect;
395 unsigned char *display_buffer,
401 int view_flag = 1 << (view_settings->
view - 1);
404 int curve_mapping_timestamp = curve_mapping ? curve_mapping->
changed_timestamp : 0;
413 cache_ibuf->
rect = (
unsigned int *)display_buffer;
421 cache_data->
look = view_settings->
look;
425 cache_data->
flag = view_settings->
flag;
431 *cache_handle = cache_ibuf;
438 ImBuf *cache_ibuf = cache_handle;
450 char *colorspace_name,
452 const char *backup_role)
454 OCIO_ConstColorSpaceRcPtr *ociocs;
458 if (!ociocs && backup_role) {
470 printf(
"Color management: Error could not find role %s role.\n", role);
476 int tot_colorspace, tot_display, tot_display_view, tot_looks;
477 int index, viewindex, viewindex2;
497 for (index = 0; index < tot_colorspace; index++) {
498 OCIO_ConstColorSpaceRcPtr *ocio_colorspace;
499 const char *description;
500 bool is_invertible, is_data;
514 "ColorSpace aliases");
515 for (
int i = 0; i < colorspace->
num_aliases; i++) {
529 for (index = 0; index < tot_display; index++) {
530 const char *displayname;
539 for (viewindex = 0; viewindex < tot_display_view; viewindex++, viewindex2++) {
540 const char *viewname;
564 for (index = 0; index < tot_looks; index++) {
565 OCIO_ConstLookRcPtr *ocio_look;
566 const char *process_space;
612 colorspace = colorspace_next;
634 display = display_next;
652 const char *ocio_env;
653 const char *configdir;
655 OCIO_ConstConfigRcPtr *config =
NULL;
661 if (ocio_env && ocio_env[0] !=
'\0') {
663 if (config !=
NULL) {
664 printf(
"Color management: Using %s as a configuration file\n", ocio_env);
668 if (config ==
NULL) {
678 char short_name[256];
679 BLI_get_short_name(short_name, configfile);
688 if (config ==
NULL) {
689 printf(
"Color management: using fallback mode for management\n");
704 printf(
"Color management: no displays/views in the config, using fallback mode instead\n");
756 return (look->
view[0] == 0 || (view_name &&
STREQ(look->
view, view_name)));
798 if (sima && sima->
image) {
800 *r_view_settings =
NULL;
812 const char *colorspace_name;
818 return colorspace_name;
827 if (colorspace_name) {
835 const char *view_transform,
839 const char *from_colorspace)
843 const float scale = (exposure == 0.0f) ? 1.0f :
powf(2.0f, exposure);
844 const float exponent = (gamma == 1.0f) ? 1.0f : 1.0f /
max_ff(FLT_EPSILON, gamma);
850 (use_look) ? look :
"",
857 if (processor ==
NULL) {
864 return cpu_processor;
868 const char *to_colorspace)
871 OCIO_ConstProcessorRcPtr *processor;
890 if (processor !=
NULL) {
913 if (processor !=
NULL) {
935 OCIO_ConstProcessorRcPtr *processor =
NULL;
937 if (view_name && config) {
944 if (processor !=
NULL) {
965 OCIO_ConstProcessorRcPtr *processor =
NULL;
967 if (view_name && config) {
974 if (processor !=
NULL) {
995 if (default_view ==
NULL) {
997 if (display !=
NULL) {
1001 if (default_view !=
NULL) {
1011 view_settings->
flag = 0;
1012 view_settings->
gamma = 1.0f;
1033 if (colorspace && colorspace[0] ==
'\0') {
1034 const char *role_colorspace;
1051 if (colorspace && colorspace->
is_data) {
1086 default_display->
name,
1094 "Color management: display \"%s\" used by %s not found, setting to default (\"%s\").\n",
1097 default_display->
name);
1100 default_display->
name,
1138 printf(
"Color management: %s view \"%s\" not found, setting default \"%s\".\n",
1141 default_view->
name);
1150 if (view_settings->
look[0] ==
'\0') {
1156 printf(
"Color management: %s look \"%s\" not found, setting default \"%s\".\n",
1158 view_settings->
look,
1159 default_look->
name);
1166 if (view_settings->
exposure == 0.0f && view_settings->
gamma == 0.0f) {
1168 view_settings->
gamma = 1.0f;
1175 if (colorspace_settings->
name[0] ==
'\0') {
1182 printf(
"Color management: %s colorspace \"%s\" not found, will use default instead.\n",
1184 colorspace_settings->
name);
1211 if (!default_display) {
1227 if (sequencer_colorspace_settings->
name[0] ==
'\0') {
1260 for (view_link = display->
views.
first; view_link; view_link = view_link->
next) {
1268 if (view_link ==
NULL && default_view) {
1292 printf(
"Unknown role was passed to %s\n", __func__);
1304 if (colorspace && colorspace->
is_data) {
1335 if (colorspace && colorspace->
is_data) {
1349 if (colorspace && colorspace->
is_data) {
1377 return (colorspace && colorspace->
is_data);
1387 bool is_scene_linear, is_srgb;
1414 return (colorspace && colorspace->
is_data);
1487 float dither = ibuf->
dither;
1529 float *linear_buffer,
1530 bool *is_straight_alpha)
1537 bool is_data = handle->
is_data;
1553 for (i = 0, fp = linear_buffer, cp = byte_buffer; i != i_last;
1562 BLI_assert_msg(0,
"Buffers of 3 or 4 channels are only supported here");
1566 if (!is_data && !is_data_display) {
1572 *is_straight_alpha =
true;
1584 memcpy(linear_buffer, handle->
buffer, buffer_size *
sizeof(
float));
1586 if (!is_data && !is_data_display) {
1591 *is_straight_alpha =
false;
1600 memcpy(linear_buffer, handle->
buffer, buffer_size *
sizeof(
float));
1602 *is_straight_alpha =
false;
1615 float dither = handle->
dither;
1616 bool is_data = handle->
is_data;
1618 if (cm_processor ==
NULL) {
1619 if (display_buffer_byte && display_buffer_byte != handle->
byte_buffer) {
1631 if (display_buffer) {
1644 bool is_straight_alpha;
1646 "color conversion linear buffer");
1650 bool predivide = handle->
predivide && (is_straight_alpha ==
false);
1664 if (display_buffer_byte) {
1679 if (display_buffer) {
1680 memcpy(display_buffer, linear_buffer, ((
size_t)
width) *
height *
channels *
sizeof(
float));
1682 if (is_straight_alpha &&
channels == 4) {
1687 for (i = 0, fp = display_buffer; i != i_last; i++, fp +=
channels) {
1701 unsigned char *byte_buffer,
1702 float *display_buffer,
1703 unsigned char *display_buffer_byte,
1712 init_data.display_buffer = display_buffer;
1713 init_data.display_buffer_byte = display_buffer_byte;
1745 view_settings->
exposure == 0.0f && view_settings->
gamma == 1.0f) {
1753 if (to_colorspace &&
STREQ(from_colorspace, to_colorspace)) {
1763 float *display_buffer,
1764 unsigned char *display_buffer_byte,
1769 bool skip_transform =
false;
1780 if (skip_transform ==
false) {
1786 (
unsigned char *)ibuf->
rect,
1788 display_buffer_byte,
1797 unsigned char *display_buffer,
1802 ibuf,
NULL, display_buffer, view_settings, display_settings);
1844 const bool predivide =
init_data->predivide;
1845 const bool float_from_byte =
init_data->float_from_byte;
1879 const bool predivide = handle->
predivide;
1882 if (float_from_byte) {
1897 if (byte_buffer !=
NULL) {
1901 if (float_buffer !=
NULL) {
1911 float *float_buffer,
1916 const bool predivide,
1917 const bool float_from_byte)
1928 init_data.float_from_byte = float_from_byte;
1946 float *float_buffer,
1950 const char *from_colorspace,
1951 const char *to_colorspace,
1957 if (from_colorspace[0] ==
'\0') {
1961 if (
STREQ(from_colorspace, to_colorspace)) {
1975 if (byte_buffer !=
NULL) {
1978 if (float_buffer !=
NULL) {
1991 const char *from_colorspace,
1992 const char *to_colorspace,
2003 const char *from_colorspace,
2004 const char *to_colorspace,
2015 const char *from_colorspace,
2016 const char *to_colorspace)
2025 const char *from_colorspace,
2026 const char *to_colorspace)
2033 unsigned char *byte_buffer,
2037 const char *from_colorspace,
2038 const char *to_colorspace)
2053 unsigned char *byte_buffer,
2057 const char *from_colorspace,
2058 const char *to_colorspace)
2061 if (from_colorspace ==
NULL || from_colorspace[0] ==
'\0') {
2064 if (
STREQ(from_colorspace, to_colorspace)) {
2088 const char *from_colorspace,
2089 const char *to_colorspace)
2093 if (from_colorspace[0] ==
'\0') {
2097 if (
STREQ(from_colorspace, to_colorspace)) {
2113 OCIO_ConstCPUProcessorRcPtr *processor;
2117 printf(
"%s: perform conversion from unknown color space\n", __func__);
2123 if (processor !=
NULL) {
2130 OCIO_ConstCPUProcessorRcPtr *processor;
2134 printf(
"%s: perform conversion from unknown color space\n", __func__);
2140 if (processor !=
NULL) {
2149 OCIO_ConstCPUProcessorRcPtr *processor;
2153 printf(
"%s: perform conversion from unknown color space\n", __func__);
2159 if (processor !=
NULL) {
2176 OCIO_ConstCPUProcessorRcPtr *processor;
2180 printf(
"%s: perform conversion from unknown color space\n", __func__);
2186 if (processor !=
NULL) {
2187 OCIO_PackedImageDesc *img;
2213 const struct ImBuf *ibuf,
2214 const bool store_premultiplied)
2223 const unsigned char *in_buffer = (
unsigned char *)ibuf->
rect;
2227 const size_t in_offset = (offset_y +
y) * ibuf->
x + offset_x;
2228 const size_t out_offset =
y *
width;
2229 const unsigned char *in = in_buffer + in_offset * 4;
2230 unsigned char *
out = out_buffer + out_offset * 4;
2232 if (use_premultiply) {
2234 for (
int x = 0;
x <
width;
x++, in += 4,
out += 4) {
2235 out[0] = (in[0] * in[3]) >> 8;
2236 out[1] = (in[1] * in[3]) >> 8;
2237 out[2] = (in[2] * in[3]) >> 8;
2243 for (
int x = 0;
x <
width;
x++, in += 4,
out += 4) {
2258 const struct ImBuf *ibuf,
2259 const bool store_premultiplied)
2266 const int in_channels = ibuf->
channels;
2270 const size_t in_offset = (offset_y +
y) * ibuf->
x + offset_x;
2271 const size_t out_offset =
y *
width;
2272 const float *in = in_buffer + in_offset * in_channels;
2273 float *
out = out_buffer + out_offset * 4;
2275 if (in_channels == 1) {
2277 for (
int x = 0;
x <
width;
x++, in += 1,
out += 4) {
2284 else if (in_channels == 3) {
2286 for (
int x = 0;
x <
width;
x++, in += 3,
out += 4) {
2293 else if (in_channels == 4) {
2295 if (use_unpremultiply) {
2296 for (
int x = 0;
x <
width;
x++, in += 4,
out += 4) {
2301 memcpy(
out, in,
sizeof(
float[4]) *
width);
2308 const unsigned char *in_buffer = (
unsigned char *)ibuf->
rect;
2318 const size_t in_offset = (offset_y +
y) * ibuf->
x + offset_x;
2319 const size_t out_offset =
y *
width;
2320 const unsigned char *in = in_buffer + in_offset * 4;
2321 float *
out = out_buffer + out_offset * 4;
2324 for (
int x = 0;
x <
width;
x++, in += 4,
out += 4) {
2333 if (use_premultiply) {
2343 const float scene_linear[3])
2353 if (processor !=
NULL) {
2373 const float color_picking[3])
2383 if (processor !=
NULL) {
2406 if (processor !=
NULL) {
2415 if (processor !=
NULL) {
2422 const float pixel[4],
2437 const float pixel[3],
2456 if (!ibuf->
rect && make_byte) {
2461 ibuf, ibuf->
rect_float, (
unsigned char *)ibuf->
rect, view_settings, display_settings);
2474 if (colormanaged_ibuf != ibuf) {
2476 return colormanaged_ibuf;
2479 if (allocate_result) {
2483 return colormanaged_ibuf;
2503 bool save_as_render,
2504 bool allocate_result,
2507 ImBuf *colormanaged_ibuf = ibuf;
2524 BLI_assert(!(byte_output && linear_float_output));
2538 float color[3] = {0, 0, 0};
2544 colormanaged_ibuf->
rect_float, colormanaged_ibuf->
x, colormanaged_ibuf->
y,
color);
2547 if (colormanaged_ibuf->
rect) {
2549 colormanaged_ibuf->
x,
2550 colormanaged_ibuf->
y,
2555 if (save_as_render && !linear_float_output) {
2579 const char *from_colorspace = (ibuf->
rect_float && !(byte_output && ibuf->
rect)) ?
2590 if (to_colorspace[0] ==
'\0' ||
STREQ(from_colorspace, to_colorspace)) {
2592 if (byte_output && !ibuf->
rect) {
2604 if (colormanaged_ibuf->
rect) {
2607 colormanaged_ibuf->
x,
2608 colormanaged_ibuf->
y,
2631 colormanaged_ibuf->
x,
2632 colormanaged_ibuf->
y,
2644 return colormanaged_ibuf;
2656 void **cache_handle)
2658 unsigned char *display_buffer;
2665 *cache_handle =
NULL;
2667 if (!ibuf->
x || !ibuf->
y) {
2671 if (view_settings) {
2672 applied_view_settings = view_settings;
2678 applied_view_settings = &default_view_settings;
2686 return (
unsigned char *)ibuf->
rect;
2697 (
unsigned char *)ibuf->
rect,
2701 applied_view_settings,
2717 "imbuf display_buffer_flags");
2729 ibuf, &cache_view_settings, &cache_display_settings, cache_handle);
2731 if (display_buffer) {
2733 return display_buffer;
2737 display_buffer =
MEM_callocN(buffer_size,
"imbuf display buffer");
2740 ibuf, display_buffer, applied_view_settings, display_settings);
2743 ibuf, &cache_view_settings, &cache_display_settings, display_buffer, cache_handle);
2747 return display_buffer;
2761 float *linear_buffer,
2774 "display transform temp buffer");
2816 const char *display_name;
2822 return display_name;
2829 if (display_name[0] ==
'\0') {
2844 index = last_display->
index;
2849 display->
index = index + 1;
2884 return display->
index;
2897 return display->
name;
2907 return display->
name;
2952 if (!name || name[0] ==
'\0') {
2965 view->index = index + 1;
2998 if (display ==
NULL) {
3058 for (i = (
int)strlen(description) - 1; i >= 0; i--) {
3059 if (
ELEM(description[i],
'\r',
'\n')) {
3060 description[i] =
'\0';
3067 for (i = 0, n = strlen(description); i < n; i++) {
3068 if (
ELEM(description[i],
'\r',
'\n')) {
3069 description[i] =
' ';
3075 const char *description,
3093 colorspace->
is_data = is_data;
3111 for (; prev_space; prev_space = prev_space->
next) {
3129 for (
int i = 0; i < colorspace->
num_aliases; i++) {
3159 return colorspace->
index;
3172 return colorspace->
name;
3180 return colorspace->
name;
3189 if (colorspace && colorspace->
is_data) {
3198 type->default_save_role);
3199 BLI_strncpy(colorspace_settings->
name, role_colorspace,
sizeof(colorspace_settings->
name));
3216 look->
index = index + 1;
3223 const char *separator_offset = strstr(look->
name,
" - ");
3224 if (separator_offset) {
3321 const char *display_name)
3329 for (display_view = display->
views.
first; display_view; display_view = display_view->
next) {
3339 const char *view_name)
3399 unsigned char *display_buffer,
3400 const float *linear_buffer,
3401 const unsigned char *byte_buffer,
3404 int linear_offset_x,
3405 int linear_offset_y,
3414 float dither = ibuf->
dither;
3416 float *display_buffer_float =
NULL;
3417 const int width = xmax - xmin;
3418 const int height = ymax - ymin;
3421 if (dither != 0.0f) {
3429 if (!cm_processor) {
3434 "display buffer for dither");
3438 for (
y = ymin;
y < ymax;
y++) {
3439 for (
x = xmin;
x < xmax;
x++) {
3440 size_t display_index = ((size_t)
y * display_stride +
x) * 4;
3441 size_t linear_index = ((size_t)(
y - linear_offset_y) * linear_stride +
3442 (
x - linear_offset_x)) *
3446 if (linear_buffer) {
3448 copy_v4_v4(pixel, (
float *)linear_buffer + linear_index);
3451 copy_v3_v3(pixel, (
float *)linear_buffer + linear_index);
3455 pixel[0] = linear_buffer[linear_index];
3458 BLI_assert_msg(0,
"Unsupported number of channels in partial buffer update");
3461 else if (byte_buffer) {
3471 if (display_buffer_float) {
3475 copy_v4_v4(display_buffer_float + index, pixel);
3478 copy_v3_v3(display_buffer_float + index, pixel);
3481 display_buffer_float[index] = pixel[0];
3486 float pixel_straight[4];
3492 display_buffer[display_index + 3] = 255;
3495 display_buffer[display_index] = display_buffer[display_index + 1] =
3496 display_buffer[display_index + 2] = display_buffer[display_index + 3] =
3504 if (display_buffer_float) {
3519 for (i = ymin; i < ymax; i++) {
3520 size_t byte_offset = ((size_t)linear_stride * i + xmin) * 4;
3521 size_t display_offset = ((size_t)display_stride * i + xmin) * 4;
3524 display_buffer + display_offset, byte_buffer + byte_offset,
sizeof(
char[4]) *
width);
3529 if (display_buffer_float) {
3530 size_t display_index = ((size_t)ymin * display_stride + xmin) *
channels;
3533 display_buffer_float,
3563 int ymin =
data->ymin + scanline;
3564 const int num_scanlines = 1;
3566 data->display_buffer,
3567 data->linear_buffer,
3569 data->display_stride,
3570 data->linear_stride,
3571 data->linear_offset_x,
3572 data->linear_offset_y,
3577 ymin + num_scanlines);
3582 const float *linear_buffer,
3583 const unsigned char *byte_buffer,
3597 void *cache_handle =
NULL;
3598 unsigned char *display_buffer =
NULL;
3599 int buffer_width = ibuf->
x;
3602 int view_flag, display_index;
3607 view_flag = 1 << (cache_view_settings.
view - 1);
3608 display_index = cache_display_settings.
display - 1;
3614 ibuf, &cache_view_settings, &cache_display_settings, &cache_handle);
3621 buffer_width = ibuf->
x;
3630 if (display_buffer) {
3632 bool skip_transform =
false;
3641 if (linear_buffer ==
NULL && byte_buffer !=
NULL) {
3645 if (!skip_transform) {
3652 data.display_buffer = display_buffer;
3653 data.linear_buffer = linear_buffer;
3654 data.byte_buffer = byte_buffer;
3655 data.display_stride = buffer_width;
3657 data.linear_offset_x = offset_x;
3658 data.linear_offset_y = offset_y;
3659 data.cm_processor = cm_processor;
3691 const float *linear_buffer,
3692 const unsigned char *byte_buffer,
3720 const float *linear_buffer,
3721 const unsigned char *byte_buffer,
3732 int width = xmax - xmin;
3733 int height = ymax - ymin;
3734 bool do_threads = (((size_t)
width) *
height >= 64 * 64);
3779 if (view_settings) {
3780 applied_view_settings = view_settings;
3784 applied_view_settings = &default_view_settings;
3788 if (display_space) {
3793 applied_view_settings->
look,
3797 applied_view_settings->
gamma,
3805 return cm_processor;
3809 const char *to_colorspace)
3821 if (processor !=
NULL) {
3826 return cm_processor;
3880 !
"Incorrect number of channels passed to IMB_colormanagement_processor_apply_pixel");
3905 OCIO_PackedImageDesc *img;
3967 curve_mapping, &curve_mapping_settings->
lut, &curve_mapping_settings->
lut_size);
3972 for (i = 0; i < 4; i++) {
3974 curve_mapping_settings->
range[i] = cuma->
range;
3997 if (!use_curve_mapping) {
4006 return curve_mapping_settings;
4015 if (use_curve_mapping) {
4023 curve_mapping_settings->
lut =
NULL;
4027 if (use_curve_mapping) {
4040 return curve_mapping_settings;
4054 bool do_overlay_merge)
4059 if (view_settings) {
4060 applied_view_settings = view_settings;
4066 applied_view_settings = &default_view_settings;
4071 applied_view_settings);
4079 const char *look = (use_look) ? applied_view_settings->
look :
"";
4080 const float exposure = applied_view_settings->
exposure;
4081 const float gamma = applied_view_settings->
gamma;
4082 const float scale = (exposure == 0.0f) ? 1.0f :
powf(2.0f, exposure);
4083 const float exponent = (gamma == 1.0f) ? 1.0f : 1.0f /
max_ff(FLT_EPSILON, gamma);
4093 curve_mapping_settings,
4111 view_settings, display_settings,
NULL, dither, predivide,
false);
4125 view_settings, display_settings, from_colorspace, dither, predivide,
false);
4154 {2.48845471e+03f, -1.11330907e-03f, 3.22621544e+00f},
4155 {3.34143193e+03f, -4.86551192e-04f, 1.76486769e+00f},
4156 {4.09461742e+03f, -1.27446582e-04f, 7.25731635e-01f},
4157 {4.67028036e+03f, 2.91258199e-05f, 1.26703442e-01f},
4158 {4.59509185e+03f, 2.87495649e-05f, 1.50345020e-01f},
4159 {3.78717450e+03f, 9.35907826e-06f, 3.99075871e-01f}};
4162 {-4.88999748e+02f, 6.04330754e-04f, -7.55807526e-02f},
4163 {-7.55994277e+02f, 3.16730098e-04f, 4.78306139e-01f},
4164 {-1.02363977e+03f, 1.20223470e-04f, 9.36662319e-01f},
4165 {-1.26571316e+03f, 4.87340896e-06f, 1.27054498e+00f},
4166 {-1.42529332e+03f, -4.01150431e-05f, 1.43972784e+00f},
4167 {-1.17554822e+03f, -2.16378048e-05f, 1.30408023e+00f},
4168 {-5.00799571e+02f, -4.59832026e-06f, 1.09098763e+00f}};
4171 {5.96945309e-11f, -4.85742887e-08f, -9.70622247e-05f, -4.07936148e-03f},
4172 {2.40430366e-11f, 5.55021075e-08f, -1.98503712e-04f, 2.89312858e-02f},
4173 {-1.40949732e-11f, 1.89878968e-07f, -3.56632824e-04f, 9.10767778e-02f},
4174 {-3.61460868e-11f, 2.84822009e-07f, -4.93211319e-04f, 1.56723440e-01f},
4175 {-1.97075738e-11f, 1.75359352e-07f, -2.50542825e-04f, -2.22783266e-02f},
4176 {-1.61997957e-13f, -1.64216008e-08f, 3.86216271e-04f, -7.38077418e-01f},
4177 {6.72650283e-13f, -2.73078809e-08f, 4.24098264e-04f, -7.52335691e-01f}};
4181 if (
t >= 12000.0f) {
4182 rec709[0] = 0.8262954810464208f;
4183 rec709[1] = 0.9945080501520986f;
4184 rec709[2] = 1.566307710274283f;
4186 else if (
t < 800.0f) {
4187 rec709[0] = 5.413294490189271f;
4188 rec709[1] = -0.20319390035873933f;
4189 rec709[2] = -0.0822535242887164f;
4192 int i = (
t >= 6365.0f) ? 6 :
4193 (
t >= 3315.0f) ? 5 :
4194 (
t >= 1902.0f) ? 4 :
4195 (
t >= 1449.0f) ? 3 :
4196 (
t >= 1167.0f) ? 2 :
4204 const float t_inv = 1.0f /
t;
4205 rec709[0] =
r[0] * t_inv +
r[1] *
t +
r[2];
4206 rec709[1] =
g[0] * t_inv +
g[1] *
t +
g[2];
4207 rec709[2] = ((
b[0] *
t +
b[1]) *
t +
b[2]) *
t +
b[3];
4216 for (
int i = 0; i <
width; i++) {
4227 r_table[i * 4 + 3] = 0.0f;
4244 {0.0014f, 0.0000f, 0.0065f}, {0.0022f, 0.0001f, 0.0105f}, {0.0042f, 0.0001f, 0.0201f},
4245 {0.0076f, 0.0002f, 0.0362f}, {0.0143f, 0.0004f, 0.0679f}, {0.0232f, 0.0006f, 0.1102f},
4246 {0.0435f, 0.0012f, 0.2074f}, {0.0776f, 0.0022f, 0.3713f}, {0.1344f, 0.0040f, 0.6456f},
4247 {0.2148f, 0.0073f, 1.0391f}, {0.2839f, 0.0116f, 1.3856f}, {0.3285f, 0.0168f, 1.6230f},
4248 {0.3483f, 0.0230f, 1.7471f}, {0.3481f, 0.0298f, 1.7826f}, {0.3362f, 0.0380f, 1.7721f},
4249 {0.3187f, 0.0480f, 1.7441f}, {0.2908f, 0.0600f, 1.6692f}, {0.2511f, 0.0739f, 1.5281f},
4250 {0.1954f, 0.0910f, 1.2876f}, {0.1421f, 0.1126f, 1.0419f}, {0.0956f, 0.1390f, 0.8130f},
4251 {0.0580f, 0.1693f, 0.6162f}, {0.0320f, 0.2080f, 0.4652f}, {0.0147f, 0.2586f, 0.3533f},
4252 {0.0049f, 0.3230f, 0.2720f}, {0.0024f, 0.4073f, 0.2123f}, {0.0093f, 0.5030f, 0.1582f},
4253 {0.0291f, 0.6082f, 0.1117f}, {0.0633f, 0.7100f, 0.0782f}, {0.1096f, 0.7932f, 0.0573f},
4254 {0.1655f, 0.8620f, 0.0422f}, {0.2257f, 0.9149f, 0.0298f}, {0.2904f, 0.9540f, 0.0203f},
4255 {0.3597f, 0.9803f, 0.0134f}, {0.4334f, 0.9950f, 0.0087f}, {0.5121f, 1.0000f, 0.0057f},
4256 {0.5945f, 0.9950f, 0.0039f}, {0.6784f, 0.9786f, 0.0027f}, {0.7621f, 0.9520f, 0.0021f},
4257 {0.8425f, 0.9154f, 0.0018f}, {0.9163f, 0.8700f, 0.0017f}, {0.9786f, 0.8163f, 0.0014f},
4258 {1.0263f, 0.7570f, 0.0011f}, {1.0567f, 0.6949f, 0.0010f}, {1.0622f, 0.6310f, 0.0008f},
4259 {1.0456f, 0.5668f, 0.0006f}, {1.0026f, 0.5030f, 0.0003f}, {0.9384f, 0.4412f, 0.0002f},
4260 {0.8544f, 0.3810f, 0.0002f}, {0.7514f, 0.3210f, 0.0001f}, {0.6424f, 0.2650f, 0.0000f},
4261 {0.5419f, 0.2170f, 0.0000f}, {0.4479f, 0.1750f, 0.0000f}, {0.3608f, 0.1382f, 0.0000f},
4262 {0.2835f, 0.1070f, 0.0000f}, {0.2187f, 0.0816f, 0.0000f}, {0.1649f, 0.0610f, 0.0000f},
4263 {0.1212f, 0.0446f, 0.0000f}, {0.0874f, 0.0320f, 0.0000f}, {0.0636f, 0.0232f, 0.0000f},
4264 {0.0468f, 0.0170f, 0.0000f}, {0.0329f, 0.0119f, 0.0000f}, {0.0227f, 0.0082f, 0.0000f},
4265 {0.0158f, 0.0057f, 0.0000f}, {0.0114f, 0.0041f, 0.0000f}, {0.0081f, 0.0029f, 0.0000f},
4266 {0.0058f, 0.0021f, 0.0000f}, {0.0041f, 0.0015f, 0.0000f}, {0.0029f, 0.0010f, 0.0000f},
4267 {0.0020f, 0.0007f, 0.0000f}, {0.0014f, 0.0005f, 0.0000f}, {0.0010f, 0.0004f, 0.0000f},
4268 {0.0007f, 0.0002f, 0.0000f}, {0.0005f, 0.0002f, 0.0000f}, {0.0003f, 0.0001f, 0.0000f},
4269 {0.0002f, 0.0001f, 0.0000f}, {0.0002f, 0.0001f, 0.0000f}, {0.0001f, 0.0000f, 0.0000f},
4270 {0.0001f, 0.0000f, 0.0000f}, {0.0001f, 0.0000f, 0.0000f}, {0.0000f, 0.0000f, 0.0000f}};
4274 float ii = (lambda_nm - 380.0f) * (1.0f / 5.0f);
4277 if (i < 0 || i >= 80) {
4285 xyz[0] =
c[0] + ii * (
c[3] -
c[0]);
4286 xyz[1] =
c[1] + ii * (
c[4] -
c[1]);
4287 xyz[2] =
c[2] + ii * (
c[5] -
c[2]);
4293 for (
int i = 0; i <
width; i++) {
4294 float temperature = 380 + 400 / (
float)
width * (
float)i;
4304 r_table[i * 4 + 3] = 0.0f;
typedef float(TangentPoint)[2]
const char * BKE_appdir_folder_id(int folder_id, const char *subfolder)
struct Scene * CTX_data_scene(const bContext *C)
struct SpaceImage * CTX_wm_space_image(const bContext *C)
#define BLI_assert_msg(a, msg)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
struct LinkData * BLI_genericNodeN(void *data)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_insertlinkbefore(struct ListBase *listbase, void *vnextlink, void *vnewlink) ATTR_NONNULL(1)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE float max_ff(float a, float b)
MINLINE void srgb_to_linearrgb_v3_v3(float linear[3], const float srgb[3])
MINLINE void straight_to_premul_v4(float color[4])
void BLI_init_srgb_conversion(void)
void rgba_uchar_to_float(float r_col[4], const unsigned char col_ub[4])
void rgba_float_to_uchar(unsigned char r_col[4], const float col_f[4])
MINLINE void premul_to_straight_v4_v4(float straight[4], const float premul[4])
void rgb_uchar_to_float(float r_col[3], const unsigned char col_ub[3])
void rgb_float_to_uchar(unsigned char r_col[3], const float col_f[3])
bool invert_m3_m3(float R[3][3], const float A[3][3])
void mul_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3])
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void clamp_v3(float vec[3], float min, float max)
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
const char * BLI_getenv(const char *env) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
void BLI_join_dirfile(char *__restrict dst, size_t maxlen, const char *__restrict dir, const char *__restrict file) ATTR_NONNULL()
void BLI_rcti_union(struct rcti *rct_a, const struct rcti *rct_b)
void BLI_rcti_init(struct rcti *rect, int xmin, int xmax, int ymin, int ymax)
int BLI_strcasecmp(const char *s1, const char *s2) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
void BLI_thread_unlock(int type)
void BLI_thread_lock(int type)
#define BLI_MUTEX_INITIALIZER
void BLI_mutex_lock(ThreadMutex *mutex)
void BLI_mutex_unlock(ThreadMutex *mutex)
@ CUMA_EXTEND_EXTRAPOLATE
@ COLORMANAGE_VIEW_USE_CURVES
#define R_IMF_PLANES_RGBA
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei stride
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
@ COLOR_ROLE_DEFAULT_FLOAT
@ COLOR_ROLE_DEFAULT_BYTE
@ COLOR_ROLE_SCENE_LINEAR
@ COLOR_ROLE_COLOR_PICKING
@ COLOR_ROLE_DEFAULT_SEQUENCER
@ COLOR_ROLE_TEXTURE_PAINTING
BLI_INLINE void IMB_colormanagement_xyz_to_scene_linear(float scene_linear[3], const float xyz[3])
BLI_INLINE void IMB_colormanagement_rec709_to_scene_linear(float scene_linear[3], const float rec709[3])
#define MAX_COLORSPACE_NAME
Function declarations for filter.c.
void IMB_float_from_rect(struct ImBuf *ibuf)
struct ImBuf * IMB_allocImBuf(unsigned int x, unsigned int y, unsigned char planes, unsigned int flags)
struct ImBuf * IMB_dupImBuf(const struct ImBuf *ibuf1)
void IMB_rect_from_float(struct ImBuf *ibuf)
void imb_freerectImBuf(struct ImBuf *ibuf)
void IMB_processor_apply_threaded(int buffer_lines, int handle_size, void *init_customdata, void(init_handle)(void *handle, int start_line, int tot_line, void *customdata), void *(do_thread)(void *))
void IMB_buffer_byte_from_byte(unsigned char *rect_to, const unsigned char *rect_from, int profile_to, int profile_from, bool predivide, int width, int height, int stride_to, int stride_from)
void IMB_buffer_float_from_byte(float *rect_to, const unsigned char *rect_from, int profile_to, int profile_from, bool predivide, int width, int height, int stride_to, int stride_from)
void IMB_processor_apply_threaded_scanlines(int total_scanlines, ScanlineThreadFunc do_thread, void *custom_data)
void IMB_buffer_byte_from_float(unsigned char *rect_to, const float *rect_from, int channels_from, float dither, int profile_to, int profile_from, bool predivide, int width, int height, int stride_to, int stride_from)
bool IMB_alpha_affects_rgb(const struct ImBuf *ibuf)
void IMB_alpha_under_color_float(float *rect_float, int x, int y, float backcol[3])
void IMB_alpha_under_color_byte(unsigned char *rect, int x, int y, const float backcol[3])
bool imb_addrectImBuf(struct ImBuf *ibuf)
Contains defines and structs used throughout the imbuf module.
@ IMB_COLORMANAGE_IS_DATA
@ IB_DISPLAY_BUFFER_INVALID
@ IB_alphamode_channel_packed
struct MovieCache * IMB_moviecache_create(const char *name, int keysize, GHashHashFP hashfp, GHashCmpFP cmpfp)
struct ImBuf * IMB_moviecache_get(struct MovieCache *cache, void *userkey, bool *r_is_cached_empty)
void IMB_moviecache_put(struct MovieCache *cache, void *userkey, struct ImBuf *ibuf)
void IMB_moviecache_free(struct MovieCache *cache)
Read Guarded memory(de)allocation.
static void init_data(ModifierData *md)
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a producing a negative Combine Generate a color from its and blue channels(Deprecated)") DefNode(ShaderNode
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
const char * IMB_colormanagement_colorspace_get_indexed_name(int index)
static char global_role_data[MAX_COLORSPACE_NAME]
static void * do_processor_transform_thread(void *handle_v)
ColorManagedView * colormanage_view_get_default(const ColorManagedDisplay *display)
static float cie_colour_match[81][3]
static ListBase global_colorspaces
static void display_buffer_apply_get_linear_buffer(DisplayBufferThread *handle, int height, float *linear_buffer, bool *is_straight_alpha)
void IMB_colormanagement_pixel_to_display_space_v3(float result[3], const float pixel[3], const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings)
unsigned char * IMB_display_buffer_acquire(ImBuf *ibuf, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, void **cache_handle)
static const float blackbody_table_r[7][3]
void IMB_colormanagement_display_to_scene_linear_v3(float pixel[3], ColorManagedDisplay *display)
float imbuf_scene_linear_to_aces[3][3]
static void blackbody_temperature_to_rec709(float rec709[3], float t)
void IMB_colormanagement_processor_apply_byte(ColormanageProcessor *cm_processor, unsigned char *buffer, int width, int height, int channels)
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)
static void display_buffer_init_handle(void *handle_v, int start_line, int tot_line, void *init_data_v)
bool IMB_colormanagement_space_is_data(ColorSpace *colorspace)
void IMB_colormanagement_colorspace_items_add(EnumPropertyItem **items, int *totitem)
float imbuf_luma_coefficients[3]
static void curve_mapping_to_ocio_settings(CurveMapping *curve_mapping, OCIO_CurveMappingSettings *curve_mapping_settings)
void IMB_colormanagement_processor_apply_pixel(struct ColormanageProcessor *cm_processor, float *pixel, int channels)
void colormanagement_init(void)
ColormanageProcessor * IMB_colormanagement_colorspace_processor_new(const char *from_colorspace, const char *to_colorspace)
struct ColormanageCache ColormanageCache
void colormanage_cache_free(ImBuf *ibuf)
static void curve_mapping_apply_pixel(CurveMapping *curve_mapping, float *pixel, int channels)
void IMB_colormanagement_colorspace_to_scene_linear(float *buffer, int width, int height, int channels, struct ColorSpace *colorspace, bool predivide)
ColorManagedView * colormanage_view_get_named_for_display(const char *display_name, const char *name)
void IMB_colormanagement_assign_float_colorspace(ImBuf *ibuf, const char *name)
const char * IMB_colormanagement_get_rect_colorspace(ImBuf *ibuf)
static void colormanage_check_colorspace_settings(ColorManagedColorspaceSettings *colorspace_settings, const char *what)
bool IMB_colormanagement_space_is_srgb(ColorSpace *colorspace)
static OCIO_ConstProcessorRcPtr * create_colorspace_transform_processor(const char *from_colorspace, const char *to_colorspace)
void IMB_colormanagement_pixel_to_display_space_v4(float result[4], const float pixel[4], const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings)
const char * IMB_colormanagement_colorspace_get_name(const ColorSpace *colorspace)
static void colormanage_cachedata_set(ImBuf *ibuf, ColormanageCacheData *data)
static void colormanagement_imbuf_make_display_space(ImBuf *ibuf, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, bool make_byte)
static void colormanage_role_color_space_name_get(OCIO_ConstConfigRcPtr *config, char *colorspace_name, const char *role, const char *backup_role)
bool IMB_colormanagement_space_is_scene_linear(ColorSpace *colorspace)
static OCIO_ConstCPUProcessorRcPtr * colorspace_to_scene_linear_cpu_processor(ColorSpace *colorspace)
float imbuf_rec709_to_scene_linear[3][3]
void IMB_colormanagement_color_picking_to_scene_linear_v3(float scene_linear[3], const float color_picking[3])
void IMB_colormanagement_view_items_add(EnumPropertyItem **items, int *totitem, const char *display_name)
static unsigned char * colormanage_cache_get(ImBuf *ibuf, const ColormanageCacheViewSettings *view_settings, const ColormanageCacheDisplaySettings *display_settings, void **cache_handle)
static ColorSpace * display_transform_get_colorspace(const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings)
static char global_role_default_sequencer[MAX_COLORSPACE_NAME]
static void * do_display_buffer_apply_thread(void *handle_v)
void IMB_colormanagement_check_is_data(ImBuf *ibuf, const char *name)
static void processor_transform_init_handle(void *handle_v, int start_line, int tot_line, void *init_data_v)
bool IMB_colormanagement_setup_glsl_draw(const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, float dither, bool predivide)
static OCIO_ConstCPUProcessorRcPtr * colorspace_from_scene_linear_cpu_processor(ColorSpace *colorspace)
float imbuf_scene_linear_to_rec709[3][3]
bool IMB_colormanagement_space_name_is_srgb(const char *name)
void IMB_colormanagement_colorspace_to_scene_linear_v3(float pixel[3], ColorSpace *colorspace)
void IMB_colormanagement_look_items_add(struct EnumPropertyItem **items, int *totitem, const char *view_name)
const char * IMB_colormanagement_view_get_default_name(const char *display_name)
ColorSpace * colormanage_colorspace_add(const char *name, const char *description, bool is_invertible, bool is_data)
bool IMB_colormanagement_space_name_is_scene_linear(const char *name)
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)
void IMB_colormanagement_imbuf_make_display_space(ImBuf *ibuf, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings)
struct ProcessorTransformThread ProcessorTransformThread
void colormanagement_exit(void)
bool IMB_colormanagement_setup_glsl_draw_from_space_ctx(const bContext *C, struct ColorSpace *from_colorspace, float dither, bool predivide)
static pthread_mutex_t processor_lock
static bool is_ibuf_rect_in_display_space(ImBuf *ibuf, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings)
static ColormanageCacheData * colormanage_cachedata_get(const ImBuf *ibuf)
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)
struct PartialThreadData PartialThreadData
ColorManagedLook * colormanage_look_get_indexed(int index)
static struct MovieCache * colormanage_moviecache_get(const ImBuf *ibuf)
unsigned char * IMB_display_buffer_acquire_ctx(const bContext *C, ImBuf *ibuf, void **cache_handle)
int IMB_colormanagement_view_get_named_index(const char *name)
static void colormanage_check_display_settings(ColorManagedDisplaySettings *display_settings, const char *what, const ColorManagedDisplay *default_display)
const char * colormanage_view_get_default_name(const ColorManagedDisplay *display)
void IMB_colormanagement_check_file_config(Main *bmain)
struct DisplayBufferThread DisplayBufferThread
struct ColormanageProcessor ColormanageProcessor
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)
bool IMB_colormanagement_space_name_is_data(const char *name)
float imbuf_scene_linear_to_xyz[3][3]
static ImBuf * imbuf_ensure_editable(ImBuf *ibuf, ImBuf *colormanaged_ibuf, bool allocate_result)
static bool colormanage_hashcmp(const void *av, const void *bv)
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_init_default_view_settings(ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings)
static bool colormanage_use_look(const char *look, const char *view_name)
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_validate_settings(const ColorManagedDisplaySettings *display_settings, ColorManagedViewSettings *view_settings)
void IMB_colormanagement_wavelength_to_rgb_table(float *r_table, const int width)
static void colormanage_ensure_srgb_scene_linear_info(ColorSpace *colorspace)
void IMB_colormanagement_colorspace_from_ibuf_ftype(ColorManagedColorspaceSettings *colorspace_settings, ImBuf *ibuf)
void IMB_colormanagement_processor_apply_v3(ColormanageProcessor *cm_processor, float pixel[3])
static void colormanage_free_config(void)
static const float blackbody_table_g[7][3]
void IMB_colormanagegent_copy_settings(ImBuf *ibuf_src, ImBuf *ibuf_dst)
void IMB_colormanagement_processor_apply(ColormanageProcessor *cm_processor, float *buffer, int width, int height, int channels, bool predivide)
void IMB_colormanagement_transform_byte_threaded(unsigned char *buffer, int width, int height, int channels, const char *from_colorspace, const char *to_colorspace)
static int global_tot_view
bool IMB_colormanagement_setup_glsl_draw_ctx(const bContext *C, float dither, bool predivide)
bool IMB_colormanagement_support_glsl_draw(const ColorManagedViewSettings *UNUSED(view_settings))
static ImBuf * colormanage_cache_get_ibuf(ImBuf *ibuf, ColormanageCacheKey *key, void **cache_handle)
void IMB_display_buffer_release(void *cache_handle)
ColorManagedLook * colormanage_look_add(const char *name, const char *process_space, bool is_noop)
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)
void IMB_colormanagement_display_settings_from_ctx(const bContext *C, ColorManagedViewSettings **r_view_settings, ColorManagedDisplaySettings **r_display_settings)
ColorManagedLook * colormanage_look_get_named(const char *name)
static void colormanage_display_buffer_process(ImBuf *ibuf, unsigned char *display_buffer, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings)
void IMB_colormanagement_scene_linear_to_colorspace_v3(float pixel[3], ColorSpace *colorspace)
static void colormanage_cache_handle_release(void *cache_handle)
struct ColormanageCacheDisplaySettings ColormanageCacheDisplaySettings
static ListBase global_looks
float imbuf_xyz_to_scene_linear[3][3]
static ListBase global_views
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)
#define DISPLAY_BUFFER_CHANNELS
void IMB_colormanagement_assign_rect_colorspace(ImBuf *ibuf, const char *name)
float imbuf_aces_to_scene_linear[3][3]
const char * IMB_colormanagement_display_get_default_name(void)
void colormanage_imbuf_set_default_spaces(ImBuf *ibuf)
static const float blackbody_table_b[7][4]
const float * IMB_colormanagement_get_xyz_to_scene_linear()
const char * IMB_colormanagement_display_get_none_name(void)
static void colormanage_description_strip(char *description)
const char * IMB_colormanagement_view_get_indexed_name(int index)
int IMB_colormanagement_look_get_named_index(const char *name)
const char * IMB_colormanagement_role_colorspace_name_get(int role)
ColorManagedDisplay * colormanage_display_get_named(const char *name)
static void colormanage_display_settings_to_cache(ColormanageCacheDisplaySettings *cache_display_settings, const ColorManagedDisplaySettings *display_settings)
ColorManagedDisplay * colormanage_display_get_indexed(int index)
void colorspace_set_default_role(char *colorspace, int size, int role)
static ListBase global_displays
static bool colormanage_compatible_look(ColorManagedLook *look, const char *view_name)
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)
static int global_tot_display
void IMB_colormanagement_transform_byte(unsigned char *buffer, int width, int height, int channels, const char *from_colorspace, const char *to_colorspace)
ColorManagedDisplay * colormanage_display_get_default(void)
static void partial_buffer_update_rect_thread_do(void *data_v, int scanline)
ColorSpace * colormanage_colorspace_get_indexed(int index)
const char * colormanage_display_get_default_name(void)
void IMB_colormanagement_display_items_add(EnumPropertyItem **items, int *totitem)
struct ColormanageCacheData ColormanageCacheData
void IMB_colormanagement_blackbody_temperature_to_rgb_table(float *r_table, const int width, const float min, const float max)
void IMB_colormanagement_finish_glsl_draw(void)
void IMB_colormanagement_scene_linear_to_color_picking_v3(float color_picking[3], const float scene_linear[3])
static int global_tot_colorspace
static char global_role_scene_linear[MAX_COLORSPACE_NAME]
static void colormanagement_view_item_add(EnumPropertyItem **items, int *totitem, ColorManagedView *view)
int IMB_colormanagement_colorspace_get_named_index(const char *name)
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 char global_role_texture_painting[MAX_COLORSPACE_NAME]
ColorSpace * colormanage_colorspace_get_named(const char *name)
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)
static const char * get_display_colorspace_name(const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings)
static void colormanage_settings_to_key(ColormanageCacheKey *key, const ColormanageCacheViewSettings *view_settings, const ColormanageCacheDisplaySettings *display_settings)
void colormanage_imbuf_make_linear(ImBuf *ibuf, const char *from_colorspace)
static unsigned int colormanage_hashhash(const void *key_v)
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_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 store_premultiplied)
const char * IMB_colormanagement_get_float_colorspace(ImBuf *ibuf)
void IMB_colormanagement_processor_apply_v4_predivide(ColormanageProcessor *cm_processor, float pixel[4])
static OCIO_CurveMappingSettings * update_glsl_curve_mapping(const ColorManagedViewSettings *view_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_cache_put(ImBuf *ibuf, const ColormanageCacheViewSettings *view_settings, const ColormanageCacheDisplaySettings *display_settings, unsigned char *display_buffer, void **cache_handle)
const char * IMB_colormanagement_look_get_indexed_name(int index)
struct DisplayBufferInitData DisplayBufferInitData
static int global_tot_looks
ColorManagedDisplay * IMB_colormanagement_display_get_named(const char *name)
static OCIO_ConstCPUProcessorRcPtr * display_to_scene_linear_processor(ColorManagedDisplay *display)
struct ProcessorTransformInit ProcessorTransformInitData
struct ColormanageCacheViewSettings ColormanageCacheViewSettings
static char global_role_default_byte[MAX_COLORSPACE_NAME]
static char global_role_default_float[MAX_COLORSPACE_NAME]
void IMB_colormanagement_processor_free(ColormanageProcessor *cm_processor)
const char * IMB_colormanagement_display_get_default_view_transform_name(struct ColorManagedDisplay *display)
void IMB_partial_display_buffer_update_delayed(ImBuf *ibuf, int xmin, int ymin, int xmax, int ymax)
void IMB_colormanagement_transform_v4(float pixel[4], const char *from_colorspace, const char *to_colorspace)
ColorManagedDisplay * colormanage_display_add(const char *name)
void IMB_colormanagement_colorspace_to_scene_linear_v4(float pixel[4], bool predivide, ColorSpace *colorspace)
const char * IMB_colormanagement_display_get_indexed_name(int index)
void IMB_colormanagement_scene_linear_to_display_v3(float pixel[3], ColorManagedDisplay *display)
static void colormanage_view_settings_to_cache(ImBuf *ibuf, ColormanageCacheViewSettings *cache_view_settings, const ColorManagedViewSettings *view_settings)
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_processor_apply_v4(ColormanageProcessor *cm_processor, float pixel[4])
int IMB_colormanagement_display_get_named_index(const char *name)
static char global_role_color_picking[MAX_COLORSPACE_NAME]
ImBuf * IMB_colormanagement_imbuf_for_write(ImBuf *ibuf, bool save_as_render, bool allocate_result, const ImageFormatData *image_format)
static bool seq_callback(Sequence *seq, void *UNUSED(user_data))
static void colormanage_check_view_settings(ColorManagedDisplaySettings *display_settings, ColorManagedViewSettings *view_settings, const char *what)
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 void wavelength_to_xyz(float xyz[3], float lambda_nm)
static void colormanage_load_config(OCIO_ConstConfigRcPtr *config)
struct ColormanageCacheKey ColormanageCacheKey
ColorManagedView * colormanage_view_get_named(const char *name)
ColorSpace * colormanage_colorspace_get_roled(int role)
ColorManagedView * colormanage_view_add(const char *name)
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)
ColorManagedView * colormanage_view_get_indexed(int index)
ColormanageProcessor * IMB_colormanagement_display_processor_new(const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings)
static OCIO_ConstCPUProcessorRcPtr * display_from_scene_linear_processor(ColorManagedDisplay *display)
static struct MovieCache * colormanage_moviecache_ensure(ImBuf *ibuf)
SyclQueue void void size_t num_bytes void
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx in_weight_img image(1, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D_ARRAY, "out_weight_img") .image(3
const ImFileType * IMB_file_type_from_ibuf(const ImBuf *ibuf)
void IMB_premultiply_rect_float(float *rect_float, int channels, int w, int h)
void IMB_freeImBuf(ImBuf *UNUSED(ibuf))
void SEQ_for_each_callback(ListBase *seqbase, SeqForEachFunc callback, void *user_data)
ccl_global float * buffer
ccl_gpu_kernel_postfix ccl_global int * counter
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
ccl_global KernelShaderEvalInput * input
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
MINLINE unsigned char unit_float_to_uchar_clamp(float val)
static const pxr::TfToken out("out", pxr::TfToken::Immortal)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
static const pxr::TfToken g("g", pxr::TfToken::Immortal)
static const pxr::TfToken rgb("rgb", pxr::TfToken::Immortal)
void OCIO_cpuProcessorApplyRGB(OCIO_ConstCPUProcessorRcPtr *cpu_processor, float *pixel)
void OCIO_cpuProcessorApplyRGBA(OCIO_ConstCPUProcessorRcPtr *cpu_processor, float *pixel)
const char * OCIO_configGetDefaultView(OCIO_ConstConfigRcPtr *config, const char *display)
void OCIO_configGetXYZtoSceneLinear(OCIO_ConstConfigRcPtr *config, float xyz_to_scene_linear[3][3])
const char * OCIO_configGetColorSpaceNameByIndex(OCIO_ConstConfigRcPtr *config, int index)
OCIO_ConstCPUProcessorRcPtr * OCIO_processorGetCPUProcessor(OCIO_ConstProcessorRcPtr *processor)
void OCIO_lookRelease(OCIO_ConstLookRcPtr *look)
const char * OCIO_lookGetProcessSpace(OCIO_ConstLookRcPtr *look)
void OCIO_cpuProcessorApply(OCIO_ConstCPUProcessorRcPtr *cpu_processor, OCIO_PackedImageDesc *img)
void OCIO_gpuDisplayShaderUnbind()
void OCIO_colorSpaceIsBuiltin(OCIO_ConstConfigRcPtr *config, OCIO_ConstColorSpaceRcPtr *cs, bool *is_scene_linear, bool *is_srgb)
void OCIO_colorSpaceRelease(OCIO_ConstColorSpaceRcPtr *cs)
const char * OCIO_configGetView(OCIO_ConstConfigRcPtr *config, const char *display, int index)
OCIO_PackedImageDesc * OCIO_createOCIO_PackedImageDesc(float *data, long width, long height, long numChannels, long chanStrideBytes, long xStrideBytes, long yStrideBytes)
int OCIO_colorSpaceGetNumAliases(OCIO_ConstColorSpaceRcPtr *cs)
OCIO_ConstConfigRcPtr * OCIO_getCurrentConfig()
const char * OCIO_colorSpaceGetName(OCIO_ConstColorSpaceRcPtr *cs)
const char * OCIO_configGetLookNameByIndex(OCIO_ConstConfigRcPtr *config, int index)
void OCIO_cpuProcessorApply_predivide(OCIO_ConstCPUProcessorRcPtr *cpu_processor, OCIO_PackedImageDesc *img)
void OCIO_setCurrentConfig(const OCIO_ConstConfigRcPtr *config)
int OCIO_configGetNumColorSpaces(OCIO_ConstConfigRcPtr *config)
void OCIO_configRelease(OCIO_ConstConfigRcPtr *config)
OCIO_ConstColorSpaceRcPtr * OCIO_configGetColorSpace(OCIO_ConstConfigRcPtr *config, const char *name)
int OCIO_configGetNumViews(OCIO_ConstConfigRcPtr *config, const char *display)
OCIO_ConstConfigRcPtr * OCIO_configCreateFromEnv()
bool OCIO_gpuDisplayShaderBind(OCIO_ConstConfigRcPtr *config, const char *input, const char *view, const char *display, const char *look, OCIO_CurveMappingSettings *curve_mapping_settings, const float scale, const float exponent, const float dither, const bool use_predivide, const bool use_overlay)
const char * OCIO_colorSpaceGetDescription(OCIO_ConstColorSpaceRcPtr *cs)
void OCIO_cpuProcessorRelease(OCIO_ConstCPUProcessorRcPtr *cpu_processor)
OCIO_ConstProcessorRcPtr * OCIO_configGetProcessorWithNames(OCIO_ConstConfigRcPtr *config, const char *srcName, const char *dstName)
void OCIO_cpuProcessorApplyRGBA_predivide(OCIO_ConstCPUProcessorRcPtr *processor, float *pixel)
int OCIO_colorSpaceIsInvertible(OCIO_ConstColorSpaceRcPtr *cs)
bool OCIO_supportGPUShader()
OCIO_ConstProcessorRcPtr * OCIO_createDisplayProcessor(OCIO_ConstConfigRcPtr *config, const char *input, const char *view, const char *display, const char *look, const float scale, const float exponent, const bool inverse)
void OCIO_PackedImageDescRelease(OCIO_PackedImageDesc *id)
const char * OCIO_configGetDisplayColorSpaceName(OCIO_ConstConfigRcPtr *config, const char *display, const char *view)
OCIO_ConstLookRcPtr * OCIO_configGetLook(OCIO_ConstConfigRcPtr *config, const char *name)
const char * OCIO_configGetDisplay(OCIO_ConstConfigRcPtr *config, int index)
const char * OCIO_colorSpaceGetAlias(OCIO_ConstColorSpaceRcPtr *cs, const int index)
int OCIO_configGetNumLooks(OCIO_ConstConfigRcPtr *config)
void OCIO_processorRelease(OCIO_ConstProcessorRcPtr *processor)
const char * OCIO_configGetDefaultDisplay(OCIO_ConstConfigRcPtr *config)
OCIO_ConstConfigRcPtr * OCIO_configCreateFromFile(const char *filename)
int OCIO_configGetNumDisplays(OCIO_ConstConfigRcPtr *config)
OCIO_ConstConfigRcPtr * OCIO_configCreateFallback()
int OCIO_colorSpaceIsData(OCIO_ConstColorSpaceRcPtr *cs)
void OCIO_configGetDefaultLumaCoefs(OCIO_ConstConfigRcPtr *config, float *rgb)
#define OCIO_ROLE_COLOR_PICKING
#define OCIO_ROLE_TEXTURE_PAINT
static const float OCIO_XYZ_TO_REC709[3][3]
#define OCIO_ROLE_DEFAULT_FLOAT
#define OCIO_ROLE_DEFAULT_SEQUENCER
#define OCIO_ROLE_DEFAULT_BYTE
static const float OCIO_ACES_TO_XYZ[3][3]
#define OCIO_ROLE_SCENE_LINEAR
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
struct OCIO_ConstCPUProcessorRcPtr * to_scene_linear
char name[MAX_COLORSPACE_NAME]
struct ColorManagedDisplay * next
struct OCIO_ConstCPUProcessorRcPtr * from_scene_linear
char ui_name[MAX_COLORSPACE_NAME]
char view[MAX_COLORSPACE_NAME]
struct ColorManagedLook * next
char process_space[MAX_COLORSPACE_NAME]
char name[MAX_COLORSPACE_NAME]
struct CurveMapping * curve_mapping
char name[MAX_COLORSPACE_NAME]
struct OCIO_ConstCPUProcessorRcPtr * to_scene_linear
struct OCIO_ConstCPUProcessorRcPtr * from_scene_linear
char(* aliases)[MAX_COLORSPACE_NAME]
char name[MAX_COLORSPACE_NAME]
char description[MAX_COLORSPACE_DESCRIPTION]
struct ColorSpace::@711 info
int curve_mapping_timestamp
CurveMapping * curve_mapping
CurveMapping * curve_mapping
struct MovieCache * moviecache
ColormanageCacheData * data
CurveMapping * curve_mapping
OCIO_ConstCPUProcessorRcPtr * cpu_processor
ColormanageProcessor * cm_processor
unsigned char * byte_buffer
const char * float_colorspace
const char * byte_colorspace
unsigned char * display_buffer_byte
const char * byte_colorspace
ColormanageProcessor * cm_processor
const char * float_colorspace
unsigned char * byte_buffer
unsigned char * display_buffer_byte
struct ColorSpace * rect_colorspace
struct ColorSpace * float_colorspace
unsigned int * display_buffer_flags
struct ColormanageCache * colormanage_cache
ColorManagedColorspaceSettings colorspace_settings
int use_extend_extrapolate
ColormanageProcessor * cm_processor
const unsigned char * byte_buffer
unsigned char * display_buffer
const float * linear_buffer
ColorManagedViewSettings view_settings
ColorManagedColorspaceSettings sequencer_colorspace_settings
ColorManagedDisplaySettings display_settings
ColorManagedColorspaceSettings colorspace_settings
OCIO_ConstCPUProcessorRcPtr * cpu_processor_to
OCIO_ConstCPUProcessorRcPtr * cpu_processor_from
CurveMapping * orig_curve_mapping
int curve_mapping_timestamp
OCIO_CurveMappingSettings curve_mapping_settings
CurveMapping * curve_mapping