|
Blender
V2.93
|
Go to the source code of this file.
Macros | |
| #define | BLI_YCC_ITU_BT601 0 |
| #define | BLI_YCC_ITU_BT709 1 |
| #define | BLI_YCC_JFIF_0_255 2 |
| #define | BLI_YUV_ITU_BT601 0 |
| #define | BLI_YUV_ITU_BT709 1 |
| #define | rgba_char_args_set_fl(col, r, g, b, a) rgba_char_args_set(col, (r)*255, (g)*255, (b)*255, (a)*255) |
| #define | rgba_float_args_set_ch(col, r, g, b, a) rgba_float_args_set(col, (r) / 255.0f, (g) / 255.0f, (b) / 255.0f, (a) / 255.0f) |
Functions | |
| void | hsv_to_rgb (float h, float s, float v, float *r_r, float *r_g, float *r_b) |
| void | hsv_to_rgb_v (const float hsv[3], float r_rgb[3]) |
| void | hsl_to_rgb (float h, float s, float l, float *r_r, float *r_g, float *r_b) |
| void | hsl_to_rgb_v (const float hsl[3], float r_rgb[3]) |
| void | hex_to_rgb (const char *hexcol, float *r_r, float *r_g, float *r_b) |
| void | yuv_to_rgb (float y, float u, float v, float *r_r, float *r_g, float *r_b, int colorspace) |
| void | ycc_to_rgb (float y, float cb, float cr, float *r_r, float *r_g, float *r_b, int colorspace) |
| void | cpack_to_rgb (unsigned int col, float *r_r, float *r_g, float *r_b) |
| void | rgb_to_yuv (float r, float g, float b, float *r_y, float *r_u, float *r_v, int colorspace) |
| void | rgb_to_ycc (float r, float g, float b, float *r_y, float *r_cb, float *r_cr, int colorspace) |
| void | rgb_to_hsv (float r, float g, float b, float *r_h, float *r_s, float *r_v) |
| void | rgb_to_hsv_v (const float rgb[3], float r_hsv[3]) |
| void | rgb_to_hsl (float r, float g, float b, float *r_h, float *r_s, float *r_l) |
| void | rgb_to_hsl_v (const float rgb[3], float r_hsl[3]) |
| void | rgb_to_hsl_compat (float r, float g, float b, float *r_h, float *r_s, float *r_l) |
| void | rgb_to_hsl_compat_v (const float rgb[3], float r_hsl[3]) |
| void | rgb_to_hsv_compat (float r, float g, float b, float *r_h, float *r_s, float *r_v) |
| void | rgb_to_hsv_compat_v (const float rgb[3], float r_hsv[3]) |
| unsigned int | rgb_to_cpack (float r, float g, float b) |
| unsigned int | hsv_to_cpack (float h, float s, float v) |
| float | srgb_to_linearrgb (float c) |
| float | linearrgb_to_srgb (float c) |
| MINLINE void | srgb_to_linearrgb_v3_v3 (float linear[3], const float srgb[3]) |
| MINLINE void | linearrgb_to_srgb_v3_v3 (float srgb[3], const float linear[3]) |
| MINLINE void | srgb_to_linearrgb_v4 (float linear[4], const float srgb[4]) |
| MINLINE void | linearrgb_to_srgb_v4 (float srgb[4], const float linear[4]) |
| MINLINE void | srgb_to_linearrgb_predivide_v4 (float linear[4], const float srgb[4]) |
| MINLINE void | linearrgb_to_srgb_predivide_v4 (float srgb[4], const float linear[4]) |
| MINLINE unsigned short | to_srgb_table_lookup (const float f) |
| MINLINE void | linearrgb_to_srgb_ushort4 (unsigned short srgb[4], const float linear[4]) |
| MINLINE void | srgb_to_linearrgb_uchar4 (float linear[4], const unsigned char srgb[4]) |
| MINLINE void | srgb_to_linearrgb_uchar4_predivide (float linear[4], const unsigned char srgb[4]) |
| MINLINE void | linearrgb_to_srgb_uchar3 (unsigned char srgb[3], const float linear[3]) |
| MINLINE void | linearrgb_to_srgb_uchar4 (unsigned char srgb[4], const float linear[4]) |
| void | BLI_init_srgb_conversion (void) |
| MINLINE void | premul_to_straight_v4_v4 (float straight[4], const float premul[4]) |
| MINLINE void | premul_to_straight_v4 (float color[4]) |
| MINLINE void | straight_to_premul_v4_v4 (float premul[4], const float straight[4]) |
| MINLINE void | straight_to_premul_v4 (float color[4]) |
| MINLINE void | straight_uchar_to_premul_float (float result[4], const unsigned char color[4]) |
| MINLINE void | premul_float_to_straight_uchar (unsigned char *result, const float color[4]) |
| int | constrain_rgb (float *r, float *g, float *b) |
| void | minmax_rgb (short c[3]) |
| void | hsv_clamp_v (float hsv[3], float v_max) |
| void | rgb_float_set_hue_float_offset (float *rgb, float hue_offset) |
| void | rgb_byte_set_hue_float_offset (unsigned char *rgb, float hue_offset) |
| void | rgb_uchar_to_float (float r_col[3], const unsigned char col_ub[3]) |
| void | rgba_uchar_to_float (float r_col[4], const unsigned char col_ub[4]) |
| void | rgb_float_to_uchar (unsigned char r_col[3], const float col_f[3]) |
| void | rgba_float_to_uchar (unsigned char r_col[4], const float col_f[4]) |
| MINLINE float | rgb_to_grayscale (const float rgb[3]) |
| MINLINE unsigned char | rgb_to_grayscale_byte (const unsigned char rgb[3]) |
| MINLINE int | compare_rgb_uchar (const unsigned char a[3], const unsigned char b[3], const int limit) |
| MINLINE float | dither_random_value (float s, float t) |
| MINLINE void | float_to_byte_dither_v3 (unsigned char b[3], const float f[3], float dither, float s, float t) |
| MINLINE void | rgba_uchar_args_set (unsigned char col[4], const unsigned char r, const unsigned char g, const unsigned char b, const unsigned char a) |
| MINLINE void | rgba_float_args_set (float col[4], const float r, const float g, const float b, const float a) |
| MINLINE void | rgba_uchar_args_test_set (unsigned char col[4], const unsigned char r, const unsigned char g, const unsigned char b, const unsigned char a) |
| MINLINE void | cpack_cpy_3ub (unsigned char r_col[3], const unsigned int pack) |
| void | blackbody_temperature_to_rgb_table (float *r_table, int width, float min, float max) |
| void | lift_gamma_gain_to_asc_cdl (const float *lift, const float *gamma, const float *gain, float *offset, float *slope, float *power) |
| #define BLI_YCC_ITU_BT601 0 |
Definition at line 35 of file BLI_math_color.h.
| #define BLI_YCC_ITU_BT709 1 |
Definition at line 36 of file BLI_math_color.h.
| #define BLI_YCC_JFIF_0_255 2 |
Definition at line 37 of file BLI_math_color.h.
| #define BLI_YUV_ITU_BT601 0 |
Definition at line 40 of file BLI_math_color.h.
| #define BLI_YUV_ITU_BT709 1 |
Definition at line 41 of file BLI_math_color.h.
| #define rgba_char_args_set_fl | ( | col, | |
| r, | |||
| g, | |||
| b, | |||
| a | |||
| ) | rgba_char_args_set(col, (r)*255, (g)*255, (b)*255, (a)*255) |
Definition at line 125 of file BLI_math_color.h.
| #define rgba_float_args_set_ch | ( | col, | |
| r, | |||
| g, | |||
| b, | |||
| a | |||
| ) | rgba_float_args_set(col, (r) / 255.0f, (g) / 255.0f, (b) / 255.0f, (a) / 255.0f) |
Definition at line 128 of file BLI_math_color.h.
Definition at line 704 of file math_color.c.
References blackbody_temperature_to_rgb(), copy_v3_v3(), float(), max, min, and width.
Referenced by node_shader_gpu_blackbody(), and node_shader_gpu_volume_principled().
| void BLI_init_srgb_conversion | ( | void | ) |
Definition at line 606 of file math_color.c.
References BLI_color_from_srgb_table, BLI_color_to_srgb_table, hipart(), index_to_float(), initialized, linearrgb_to_srgb(), and srgb_to_linearrgb().
Referenced by colormanagement_init().
| MINLINE int compare_rgb_uchar | ( | const unsigned char | a[3], |
| const unsigned char | b[3], | ||
| const int | limit | ||
| ) |
Definition at line 302 of file math_color_inline.c.
Definition at line 482 of file math_color.c.
References min_ffff(), r, and w().
| MINLINE void cpack_cpy_3ub | ( | unsigned char | r_col[3], |
| const unsigned int | pack | ||
| ) |
Definition at line 256 of file math_color_inline.c.
Definition at line 400 of file math_color.c.
Referenced by BKE_palette_from_hash().
Definition at line 323 of file math_color_inline.c.
References floorf, sinf, and t.
Referenced by float_to_byte_dither_v3(), float_to_byte_dither_v4(), and ushort_to_byte_dither_v4().
| MINLINE void float_to_byte_dither_v3 | ( | unsigned char | b[3], |
| const float | f[3], | ||
| float | dither, | ||
| float | s, | ||
| float | t | ||
| ) |
Definition at line 337 of file math_color_inline.c.
References dither_random_value(), t, and unit_float_to_uchar_clamp().
Referenced by do_projectpaint_draw(), and do_projectpaint_thread().
Definition at line 198 of file math_color.c.
References CLAMP, and float().
Referenced by BKE_gpencil_palette_ensure(), and ui_colorpicker_hex_rna_cb().
Definition at line 48 of file math_color.c.
References CLAMP, fabsf, and l.
Referenced by BKE_icon_geom_invert_lightness(), and hsl_to_rgb_v().
Definition at line 74 of file math_color.c.
References hsl_to_rgb().
Referenced by BKE_colorband_evaluate(), color_mul_hsl_v3(), TEST(), ui_color_picker_hsv_to_rgb(), and ui_color_picker_to_rgb_HSVCUBE_v().
Definition at line 348 of file math_color.c.
We define a 'cpack' here as a (3 byte color code) number that can be expressed like 0xFFAA66 or so. For that reason it is sensitive for endianness... with this function it works correctly.
Definition at line 363 of file math_color.c.
References col, hsv_to_rgb(), r, and v.
Definition at line 31 of file math_color.c.
References CLAMP, fabsf, and v.
Referenced by BKE_paint_face_set_overlay_color_get(), blend_color_color_byte(), blend_color_color_float(), blend_color_hue_byte(), blend_color_hue_float(), blend_color_luminosity_byte(), blend_color_luminosity_float(), blend_color_saturation_byte(), blend_color_saturation_float(), CombineHSVNode::constant_fold(), do_hue_sat_fac(), blender::compositor::MixColorOperation::executePixelSampled(), blender::compositor::MixHueOperation::executePixelSampled(), blender::compositor::MixSaturationOperation::executePixelSampled(), blender::compositor::MixValueOperation::executePixelSampled(), hsv_to_cpack(), hsv_to_rgb_v(), hue_correct_apply_threaded(), IMB_saturation(), mcol_hue(), mcol_luminosity(), mcol_saturation(), node_shader_exec_combhsv(), ramp_blend(), rgb_float_set_hue_float_offset(), svm_mix_color(), svm_mix_hue(), svm_mix_sat(), svm_mix_val(), svm_node_combine_hsv(), svm_node_hsv(), and ui_draw_gradient().
Definition at line 68 of file math_color.c.
References hsv_to_rgb().
Referenced by BKE_colorband_evaluate(), checker_board_color_fill(), Color_channel_hsv_set(), color_filter_task_cb(), Color_hsv_set(), deformStroke(), DRW_evaluate_weight_to_color(), blender::compositor::ConvertHSVToRGBOperation::executePixelSampled(), getcolor_fcurve_rainbow(), gpencil_layer_random_color_get(), gpencil_sbuffer_vertex_color_random(), gpencil_vertexpaint_hsv_exec(), graph_refresh_fcurve_colors(), image_buf_fill_checker_slice(), rgb_tint(), TEST(), ui_color_picker_hsv_to_rgb(), ui_color_picker_to_rgb_HSVCUBE_v(), ui_do_but_COLOR(), ui_do_but_HSVCIRCLE(), vpaint_tx_hsv(), and workbench_material_ubo_data().
| void lift_gamma_gain_to_asc_cdl | ( | const float * | lift, |
| const float * | gamma, | ||
| const float * | gain, | ||
| float * | offset, | ||
| float * | slope, | ||
| float * | power | ||
| ) |
Definition at line 501 of file math_color.c.
References Freestyle::c.
Definition at line 443 of file math_color.c.
References Freestyle::c, and powf.
Referenced by BLI_init_srgb_conversion(), blender::compositor::colorbalance_lgg(), ibuftoimage(), imb_savepng(), imb_savetiff(), linearrgb_to_srgb_v3_v3(), studiolight_irradiance_preview(), studiolight_matcap_preview(), studiolight_radiance_preview(), and TEST().
Definition at line 151 of file math_color_inline.c.
References alpha, and linearrgb_to_srgb_v3_v3().
Referenced by IMB_buffer_byte_from_byte(), IMB_buffer_float_from_byte(), and IMB_buffer_float_from_float().
Definition at line 107 of file math_color_inline.c.
References linearrgb_to_srgb_v3_v3(), and unit_float_to_uchar_clamp_v3.
Referenced by paint_2d_bucket_fill(), and project_paint_uvpixel_init().
Definition at line 115 of file math_color_inline.c.
References linearrgb_to_srgb_v4(), and unit_float_to_uchar_clamp_v4.
Referenced by bake_targets_output_vertex_colors(), BKE_node_preview_set_pixel(), Freestyle::BlenderStrokeRenderer::GenerateStrokeMesh(), and blender::bke::set_loop_color().
Definition at line 194 of file math_color_inline.c.
References to_srgb_table_lookup(), and unit_float_to_ushort_clamp().
Referenced by IMB_buffer_byte_from_float().
Definition at line 87 of file math_color_inline.c.
References linearrgb_to_srgb().
Referenced by FallbackTransform::applyRGB(), BKE_palette_from_hash(), do_projectpaint_draw(), do_projectpaint_thread(), IMB_buffer_byte_from_float(), IMB_buffer_float_from_float(), IMB_colormanagement_imbuf_to_byte_texture(), IMB_colormanagement_scene_linear_to_srgb_v3(), imb_savetiff(), linearrgb_to_srgb_predivide_v4(), linearrgb_to_srgb_uchar3(), linearrgb_to_srgb_v4(), paint_2d_gradient_fill(), paint_get_tex_pixel_col(), paint_sample_color(), ui_but_paste_color(), and ui_draw_but_CURVE().
Definition at line 101 of file math_color_inline.c.
References linearrgb_to_srgb_v3_v3().
Referenced by create_mono_icon_with_border(), IMB_buffer_byte_from_byte(), IMB_buffer_float_from_byte(), IMB_buffer_float_from_float(), and linearrgb_to_srgb_uchar4().
| void minmax_rgb | ( | short | c[3] | ) |
Definition at line 452 of file math_color.c.
References Freestyle::c.
Definition at line 396 of file math_color_inline.c.
References result, and unit_float_to_uchar_clamp().
Referenced by color_balance_byte_byte(), curves_apply_threaded(), do_alphaover_effect_byte(), do_alphaunder_effect_byte(), do_gammacross_effect_byte(), do_projectpaint_soften(), do_wipe_effect_byte(), paint_2d_ibuf_rgb_set(), project_paint_PickColor(), tonemapmodifier_apply_threaded_photoreceptor(), tonemapmodifier_apply_threaded_simple(), and whiteBalance_apply_threaded().
Definition at line 366 of file math_color_inline.c.
References premul_to_straight_v4_v4().
Referenced by blender::compositor::BrightnessOperation::executePixelSampled(), IMB_buffer_float_unpremultiply(), and project_paint_uvpixel_init().
Definition at line 349 of file math_color_inline.c.
Referenced by copy_original_alpha_channel(), ibuftoimage(), IMB_buffer_byte_from_float(), IMB_buffer_byte_from_float_mask(), IMB_colormanagement_imbuf_to_float_texture(), imb_savepng(), partial_buffer_update_rect(), and premul_to_straight_v4().
| void rgb_byte_set_hue_float_offset | ( | unsigned char * | rgb, |
| float | hue_offset | ||
| ) |
Referenced by color3ubv_from_seq().
| void rgb_float_to_uchar | ( | unsigned char | r_col[3], |
| const float | col_f[3] | ||
| ) |
Definition at line 422 of file math_color.c.
References unit_float_to_uchar_clamp_v3.
Referenced by apply_tangmat_callback(), BKE_icon_geom_invert_lightness(), brush_painter_imbuf_new(), color_mul_hsl_v3(), do_projectpaint_thread(), draw_channel_strips(), draw_color_strip_band(), draw_seq_background(), drawmeta_contents(), ED_vpaint_color_transform(), hue_correct_apply_threaded(), IMB_buffer_byte_from_float(), IMB_buffer_byte_from_float_mask(), IMB_saturation(), partial_buffer_update_rect(), project_paint_uvpixel_init(), rgb_byte_set_hue_float_offset(), tex_color_alpha_ubyte(), ui_block_colorpicker(), ui_tooltip_region_draw_cb(), ui_update_color_picker_buts_rgb(), and vpaint_get_current_col().
Definition at line 379 of file math_color.c.
References floorf, max_ff(), and r.
Referenced by create_mono_icon_with_border(), gpencil_extract_palette_from_vertex(), palette_extract_img_exec(), studiolight_irradiance_preview(), studiolight_matcap_preview(), and studiolight_radiance_preview().
ITU-R BT.709 primaries https://en.wikipedia.org/wiki/Relative_luminance
Real values are: Y = 0.2126390059(R) + 0.7151686788(G) + 0.0721923154(B) according to: "Derivation of Basic Television Color Equations", RP 177-1993
As this sums slightly above 1.0, the document recommends to use: 0.2126(R) + 0.7152(G) + 0.0722(B), as used here.
The high precision values are used to calculate the rounded byte weights so they add up to 255: 54(R) + 182(G) + 19(B)
Definition at line 288 of file math_color_inline.c.
Referenced by button2d_draw_intern(), blender::nodes::color_to_bool(), blender::nodes::color_to_float(), blender::nodes::color_to_int(), file_draw_preview(), ui_tooltip_region_draw_cb(), and widget_swatch().
| MINLINE unsigned char rgb_to_grayscale_byte | ( | const unsigned char | rgb[3] | ) |
Definition at line 293 of file math_color_inline.c.
Referenced by color_ensure_contrast_v3(), icon_draw_size(), widget_active_color(), and widget_state_numslider().
Definition at line 259 of file math_color.c.
References l, max_fff(), min_ff(), min_fff(), and r.
Referenced by rgb_to_hsl_compat(), and rgb_to_hsl_v().
Definition at line 288 of file math_color.c.
References r, and rgb_to_hsl().
Referenced by rgb_to_hsl_compat_v().
Definition at line 309 of file math_color.c.
References rgb_to_hsl_compat().
Referenced by ui_color_picker_rgb_to_hsv_compat(), and ui_rgb_to_color_picker_HSVCUBE_compat_v().
Definition at line 315 of file math_color.c.
References rgb_to_hsl().
Referenced by BKE_colorband_evaluate(), BKE_icon_geom_invert_lightness(), color_mul_hsl_v3(), TEST(), ui_color_picker_rgb_to_hsv(), ui_draw_but_HSV_v(), and ui_rgb_to_color_picker_HSVCUBE_v().
Definition at line 229 of file math_color.c.
References fabsf, min_ff(), r, and SWAP.
Referenced by BKE_palette_from_hash(), blend_color_color_byte(), blend_color_color_float(), blend_color_hue_byte(), blend_color_hue_float(), blend_color_luminosity_byte(), blend_color_luminosity_float(), blend_color_saturation_byte(), blend_color_saturation_float(), Color_channel_hsv_get(), Color_hsv_get(), SeparateHSVNode::constant_fold(), do_hue_sat_fac(), ED_image_draw_info(), blender::compositor::MixColorOperation::executePixelSampled(), blender::compositor::MixHueOperation::executePixelSampled(), blender::compositor::MixSaturationOperation::executePixelSampled(), blender::compositor::MixValueOperation::executePixelSampled(), hue_correct_apply_threaded(), mcol_hue(), mcol_luminosity(), mcol_saturation(), node_shader_exec_sephsv(), palette_sort_exec(), ramp_blend(), rgb_float_set_hue_float_offset(), rgb_to_hsv_compat(), rgb_to_hsv_v(), svm_mix_color(), svm_mix_hue(), svm_mix_sat(), svm_mix_val(), svm_node_hsv(), and svm_node_separate_hsv().
Definition at line 320 of file math_color.c.
References e, r, and rgb_to_hsv().
Referenced by rgb_to_hsv_compat_v().
Definition at line 342 of file math_color.c.
References rgb_to_hsv_compat().
Referenced by BKE_gpencil_merge_materials_table_get(), gpencil_select_vertex_color_exec(), gpencil_selected_hue_table(), ui_color_picker_rgb_to_hsv_compat(), ui_do_but_COLOR(), ui_draw_but_HSVCUBE(), and ui_rgb_to_color_picker_HSVCUBE_compat_v().
Definition at line 254 of file math_color.c.
References rgb_to_hsv().
Referenced by BKE_colorband_evaluate(), Color_channel_hsv_set(), color_filter_task_cb(), deformStroke(), blender::compositor::ConvertRGBToHSVOperation::executePixelSampled(), gpencil_check_same_material_color(), gpencil_sbuffer_vertex_color_random(), gpencil_vertexpaint_hsv_exec(), graph_refresh_fcurve_colors(), IMB_saturation(), rgb_tint(), TEST(), ui_color_picker_rgb_to_hsv(), ui_draw_but_CURVE(), ui_draw_but_HSV_v(), ui_rgb_to_color_picker_HSVCUBE_v(), vpaint_tx_hsv(), and weightvg_do_mask().
| void rgb_to_ycc | ( | float | r, |
| float | g, | ||
| float | b, | ||
| float * | r_y, | ||
| float * | r_cb, | ||
| float * | r_cr, | ||
| int | colorspace | ||
| ) |
Definition at line 130 of file math_color.c.
References BLI_assert, BLI_YCC_ITU_BT601, BLI_YCC_ITU_BT709, BLI_YCC_JFIF_0_255, r, and y.
Referenced by blender::compositor::ConvertRGBToYCCOperation::executePixelSampled(), scopes_update_cb(), and TEST().
| void rgb_to_yuv | ( | float | r, |
| float | g, | ||
| float | b, | ||
| float * | r_y, | ||
| float * | r_u, | ||
| float * | r_v, | ||
| int | colorspace | ||
| ) |
Definition at line 79 of file math_color.c.
References BLI_assert, BLI_YUV_ITU_BT601, BLI_YUV_ITU_BT709, r, v, and y.
Referenced by blender::compositor::CalculateMeanOperation::calculateMean(), ED_image_draw_info(), blender::compositor::ConvertRGBToYUVOperation::executePixelSampled(), blender::compositor::CalculateStandardDeviationOperation::initializeTileData(), save_sample_line(), TEST(), and vectorscope_draw_target().
| void rgb_uchar_to_float | ( | float | r_col[3], |
| const unsigned char | col_ub[3] | ||
| ) |
Definition at line 407 of file math_color.c.
References float().
Referenced by acf_generic_channel_color(), acf_group_color(), BKE_icon_geom_invert_lightness(), color_mul_hsl_v3(), curves_apply_threaded(), display_buffer_apply_get_linear_buffer(), ED_space_clip_color_sample(), ED_space_image_color_sample(), ED_space_node_color_sample(), ED_vpaint_color_transform(), gl_shaded_color_get_fl(), hue_correct_apply_threaded(), IMB_colormanagement_get_luminance_byte(), IMB_saturation(), paint_sample_color(), pointdensity_cache_vertex_color(), rgb_byte_set_hue_float_offset(), set_pchan_color(), tex_color_alpha_ubyte(), tonemapmodifier_apply_threaded_photoreceptor(), tonemapmodifier_apply_threaded_simple(), ui_draw_but_CURVE(), ui_draw_but_CURVEPROFILE(), ui_tooltip_region_draw_cb(), and whiteBalance_apply_threaded().
| MINLINE void rgba_float_args_set | ( | float | col[4], |
| const float | r, | ||
| const float | g, | ||
| const float | b, | ||
| const float | a | ||
| ) |
Definition at line 236 of file math_color_inline.c.
References Freestyle::a, col, and r.
Referenced by node_draw_basis(), node_draw_frame(), and proj_paint_default_color().
| void rgba_float_to_uchar | ( | unsigned char | r_col[4], |
| const float | col_f[4] | ||
| ) |
Definition at line 427 of file math_color.c.
References unit_float_to_uchar_clamp_v4.
Referenced by BKE_node_preview_set_pixel(), BKE_paint_face_set_overlay_color_get(), BLF_color4fv(), blf_draw_buffer__start(), BLF_shadow(), brush_painter_imbuf_update(), blender::Color4b::Color4b(), dynamic_paint_apply_surface_vpaint_cb(), blender::compositor::PreviewOperation::executeRegion(), image_buf_fill_color_slice(), IMB_buffer_byte_from_byte(), IMB_buffer_byte_from_float(), IMB_buffer_byte_from_float_mask(), IMB_colormanagement_imbuf_to_byte_texture(), IMB_colormanagement_processor_apply_byte(), mloopcol_from_float(), paint_2d_gradient_fill(), partial_buffer_update_rect(), snap_gizmo_draw(), UI_but_node_link_set(), ui_draw_box_opaque(), ui_draw_widget_back_color(), uiTemplateNodeSocket(), and widget_swatch().
| MINLINE void rgba_uchar_args_set | ( | unsigned char | col[4], |
| const unsigned char | r, | ||
| const unsigned char | g, | ||
| const unsigned char | b, | ||
| const unsigned char | a | ||
| ) |
Definition at line 227 of file math_color_inline.c.
References Freestyle::a, col, and r.
Referenced by action_group_colors_sync().
| MINLINE void rgba_uchar_args_test_set | ( | unsigned char | col[4], |
| const unsigned char | r, | ||
| const unsigned char | g, | ||
| const unsigned char | b, | ||
| const unsigned char | a | ||
| ) |
Definition at line 245 of file math_color_inline.c.
References Freestyle::a, col, and r.
| void rgba_uchar_to_float | ( | float | r_col[4], |
| const unsigned char | col_ub[4] | ||
| ) |
Definition at line 414 of file math_color.c.
References float().
Referenced by accessor_get_ibuf(), display_buffer_apply_get_linear_buffer(), draw_columnheader_columns(), dynamic_paint_set_init_color_vcol_to_imseq_cb(), dynamicPaint_setInitialColor(), blender::bke::get_loop_color(), icon_draw_size(), image_sample_apply(), image_sample_pixel_color_ubyte(), IMB_buffer_byte_from_byte(), IMB_buffer_float_from_byte(), IMB_colormanagement_imbuf_to_byte_texture(), IMB_colormanagement_processor_apply_byte(), IMB_sampleImageAtLocation(), knifetool_draw(), mask_draw_curve_type(), mloopcol_to_float(), blender::Color4b::operator Color4f(), paint_2d_bucket_fill(), paint_2d_fill_add_pixel_byte(), panel_draw_aligned_widgets(), partial_buffer_update_rect(), project_paint_uvpixel_init(), blender::compositor::sampleImageAtLocation(), textview_draw_string(), ui_draw_box_opaque(), ui_draw_but_IMAGE(), widget_draw_node_link_socket(), and widget_draw_submenu_tria().
Definition at line 434 of file math_color.c.
References Freestyle::c, and powf.
Referenced by BLI_init_srgb_conversion(), blender::compositor::KeyingScreenOperation::buildVoronoiTriangulation(), blender::compositor::colorbalance_lgg(), image_buf_fill_checker_slice(), imb_save_openexr_half(), srgb_to_linearrgb_v3_v3(), and TEST().
Definition at line 128 of file math_color_inline.c.
References alpha, and srgb_to_linearrgb_v3_v3().
Referenced by IMB_buffer_byte_from_byte(), IMB_buffer_byte_from_float(), IMB_buffer_float_from_float(), and srgb_to_linearrgb_uchar4_predivide().
Definition at line 202 of file math_color_inline.c.
References BLI_color_from_srgb_table.
Referenced by create_mono_icon_with_border(), IMB_buffer_float_from_byte(), project_paint_uvpixel_init(), and srgb_to_linearrgb_uchar4_predivide().
Definition at line 210 of file math_color_inline.c.
References srgb_to_linearrgb_predivide_v4(), and srgb_to_linearrgb_uchar4().
Referenced by IMB_buffer_float_from_byte().
Definition at line 80 of file math_color_inline.c.
References srgb_to_linearrgb().
Referenced by FallbackTransform::applyRGB(), blo_do_versions_250(), blo_do_versions_280(), camera_view3d_reconstruction(), drop_color_invoke(), gpencil_vertexpaint_brush_init(), image_buf_fill_checker_slice(), IMB_buffer_byte_from_float(), IMB_buffer_float_from_float(), IMB_colormanagement_srgb_to_scene_linear_v3(), paint_proj_stroke_ps(), paint_stroke_done(), srgb_to_linearrgb_predivide_v4(), srgb_to_linearrgb_v4(), and ui_but_copy_color().
Definition at line 95 of file math_color_inline.c.
References srgb_to_linearrgb_v3_v3().
Referenced by add_ibuf_size(), blf_draw_buffer__start(), blo_do_versions_280(), buf_rectfill_area(), create_mono_icon_with_border(), DRW_globals_update(), ED_gpencil_fill_vertex_color_set(), ED_gpencil_point_vertex_color_set(), ED_gpencil_sbuffer_vertex_color_set(), blender::bke::get_loop_color(), gpencil_lineart_material(), gpencil_monkey_color(), gpencil_stroke_material(), IMB_buffer_byte_from_byte(), IMB_buffer_byte_from_float(), IMB_buffer_float_from_float(), OVERLAY_edit_uv_cache_init(), OVERLAY_fade_cache_init(), OVERLAY_grid_cache_init(), SEQ_render_pixel_from_sequencer_space_v4(), and set_pchan_color().
Definition at line 380 of file math_color_inline.c.
References straight_to_premul_v4_v4().
Referenced by do_display_buffer_apply_thread(), blender::compositor::BrightnessOperation::executePixelSampled(), IMB_buffer_float_premultiply(), paint_2d_bucket_fill(), paint_2d_fill_add_pixel_byte(), paint_sample_color(), and partial_buffer_update_rect().
Definition at line 371 of file math_color_inline.c.
References alpha.
Referenced by copy_original_alpha_channel(), project_paint_uvpixel_init(), and straight_to_premul_v4().
Definition at line 385 of file math_color_inline.c.
Referenced by color_balance_byte_byte(), curves_apply_threaded(), do_alphaover_effect_byte(), do_alphaunder_effect_byte(), do_gammacross_effect_byte(), do_projectpaint_soften(), do_wipe_effect_byte(), paint_2d_ibuf_rgb_get(), project_paint_PickColor(), tonemapmodifier_apply(), tonemapmodifier_apply_threaded_photoreceptor(), tonemapmodifier_apply_threaded_simple(), and whiteBalance_apply_threaded().
Definition at line 179 of file math_color_inline.c.
References BLI_color_to_srgb_table.
Referenced by linearrgb_to_srgb_ushort4().
| void ycc_to_rgb | ( | float | y, |
| float | cb, | ||
| float | cr, | ||
| float * | r_r, | ||
| float * | r_g, | ||
| float * | r_b, | ||
| int | colorspace | ||
| ) |
Definition at line 169 of file math_color.c.
References BLI_assert, BLI_YCC_ITU_BT601, BLI_YCC_ITU_BT709, BLI_YCC_JFIF_0_255, r, and y.
Referenced by blender::compositor::ConvertYCCToRGBOperation::executePixelSampled(), imb_load_openexr(), and TEST().
| void yuv_to_rgb | ( | float | y, |
| float | u, | ||
| float | v, | ||
| float * | r_r, | ||
| float * | r_g, | ||
| float * | r_b, | ||
| int | colorspace | ||
| ) |
Definition at line 103 of file math_color.c.
References BLI_assert, BLI_YUV_ITU_BT601, BLI_YUV_ITU_BT709, r, v, and y.
Referenced by blender::compositor::ConvertYUVToRGBOperation::executePixelSampled(), and TEST().