|
Blender V4.5
|
Go to the source code of this file.
Macros | |
Defines | |
| #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 |
Functions | |
Conversion to RGB | |
| 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) |
Conversion to RGBA | |
| void | hex_to_rgba (const char *hexcol, float *r_r, float *r_g, float *r_b, float *r_a) |
Conversion from RGB | |
| 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) |
Profile Transformations | |
| float | srgb_to_linearrgb (float c) |
| float | linearrgb_to_srgb (float c) |
| void | srgb_to_linearrgb_v3_v3 (float linear[3], const float srgb[3]) |
| 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 (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) |
Alpha Transformations | |
| 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]) |
Other | |
| #define | rgba_char_args_set_fl(col, r, g, b, a) |
| #define | rgba_float_args_set_ch(col, r, g, b, a) |
| void | hsv_clamp_v (float hsv[3], float v_max) |
| void | rgb_float_set_hue_float_offset (float rgb[3], float hue_offset) |
| void | rgb_byte_set_hue_float_offset (unsigned char rgb[3], 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 | srgb_to_grayscale (const float rgb[3]) |
| MINLINE unsigned char | srgb_to_grayscale_byte (const unsigned char rgb[3]) |
| MINLINE int | compare_rgb_uchar (const unsigned char col_a[3], const unsigned char col_b[3], int limit) |
| MINLINE float | dither_random_value (int x, int y) |
| MINLINE void | float_to_byte_dither_v3 (unsigned char b[3], const float f[3], float dither, int x, int y) |
| MINLINE void | rgba_uchar_args_set (unsigned char col[4], unsigned char r, unsigned char g, unsigned char b, unsigned char a) |
| MINLINE void | rgba_float_args_set (float col[4], float r, float g, float b, float a) |
| MINLINE void | rgba_uchar_args_test_set (unsigned char col[4], unsigned char r, unsigned char g, unsigned char b, unsigned char a) |
| MINLINE void | cpack_cpy_3ub (unsigned char r_col[3], unsigned int pack) |
| #define BLI_YCC_ITU_BT601 0 |
Definition at line 18 of file BLI_math_color.h.
Referenced by BKE_scopes_update(), blender::nodes::node_composite_combine_color_cc::node_build_multi_function(), blender::nodes::node_composite_combine_ycca_cc::node_build_multi_function(), blender::nodes::node_composite_separate_color_cc::node_build_multi_function(), blender::nodes::node_composite_separate_ycca_cc::node_build_multi_function(), blender::nodes::node_composite_combine_color_cc::node_gpu_material(), blender::nodes::node_composite_combine_ycca_cc::node_gpu_material(), blender::nodes::node_composite_separate_color_cc::node_gpu_material(), blender::nodes::node_composite_separate_ycca_cc::node_gpu_material(), rgb_to_ycc(), TEST(), and ycc_to_rgb().
| #define BLI_YCC_ITU_BT709 1 |
Definition at line 19 of file BLI_math_color.h.
Referenced by BKE_scopes_update(), blender::nodes::node_composite_channel_matte_cc::channel_key(), blender::nodes::node_composite_chroma_matte_cc::chroma_matte(), blender::nodes::node_composite_distance_matte_cc::distance_key_ycca(), imb_load_openexr(), blender::nodes::node_composite_combine_color_cc::node_build_multi_function(), blender::nodes::node_composite_combine_ycca_cc::node_build_multi_function(), blender::nodes::node_composite_separate_color_cc::node_build_multi_function(), blender::nodes::node_composite_separate_ycca_cc::node_build_multi_function(), node_cmp_combsep_color_init(), blender::nodes::node_composite_combine_color_cc::node_gpu_material(), blender::nodes::node_composite_combine_ycca_cc::node_gpu_material(), blender::nodes::node_composite_separate_color_cc::node_gpu_material(), blender::nodes::node_composite_separate_ycca_cc::node_gpu_material(), rgb_to_ycc(), TEST(), and ycc_to_rgb().
| #define BLI_YCC_JFIF_0_255 2 |
Definition at line 20 of file BLI_math_color.h.
Referenced by BKE_scopes_update(), blender::nodes::node_composite_combine_color_cc::node_build_multi_function(), blender::nodes::node_composite_combine_ycca_cc::node_build_multi_function(), blender::nodes::node_composite_separate_color_cc::node_build_multi_function(), blender::nodes::node_composite_separate_ycca_cc::node_build_multi_function(), blender::nodes::node_composite_combine_color_cc::node_gpu_material(), blender::nodes::node_composite_combine_ycca_cc::node_gpu_material(), blender::nodes::node_composite_separate_color_cc::node_gpu_material(), blender::nodes::node_composite_separate_ycca_cc::node_gpu_material(), rgb_to_ycc(), TEST(), and ycc_to_rgb().
| #define BLI_YUV_ITU_BT601 0 |
Definition at line 23 of file BLI_math_color.h.
Referenced by rgb_to_yuv(), and yuv_to_rgb().
| #define BLI_YUV_ITU_BT709 1 |
Definition at line 24 of file BLI_math_color.h.
Referenced by blender::nodes::node_composite_channel_matte_cc::channel_key(), blender::ed::vse::draw_vectorscope_graticule(), ED_image_draw_info(), blender::nodes::node_composite_combine_color_cc::node_build_multi_function(), blender::nodes::node_composite_combine_yuva_cc::node_build_multi_function(), blender::nodes::node_composite_separate_color_cc::node_build_multi_function(), blender::nodes::node_composite_separate_yuva_cc::node_build_multi_function(), blender::ed::vse::rgb_to_uv_scaled(), rgb_to_yuv(), save_sample_line(), TEST(), ui_draw_but_VECTORSCOPE(), vectorscope_draw_target(), and yuv_to_rgb().
Definition at line 168 of file BLI_math_color.h.
Definition at line 171 of file BLI_math_color.h.
Referenced by widgetbase_set_uniform_colors_ubv().
| void BLI_init_srgb_conversion | ( | void | ) |
Definition at line 762 of file math_color.cc.
References b, BLI_color_from_srgb_table, BLI_color_to_srgb_table, hipart(), i, index_to_float(), initialized, linearrgb_to_srgb(), and srgb_to_linearrgb().
Referenced by colormanagement_init(), blender::gpu::GPUTest::SetUpTestSuite(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), and blender::tests::TEST().
| MINLINE int compare_rgb_uchar | ( | const unsigned char | col_a[3], |
| const unsigned char | col_b[3], | ||
| int | limit ) |
Definition at line 218 of file math_color_inline.cc.
Definition at line 180 of file math_color_inline.cc.
References MINLINE.
| void cpack_to_rgb | ( | unsigned int | col, |
| float * | r_r, | ||
| float * | r_g, | ||
| float * | r_b ) |
Definition at line 389 of file math_color.cc.
References col.
Referenced by BKE_palette_from_hash().
| MINLINE float dither_random_value | ( | int | x, |
| int | y ) |
Returns triangle noise in [-1..+1) range, given integer pixel coordinates. Triangle distribution which gives a more final uniform noise, see "Banding in Games: A Noisy Rant" by Mikkel Gjoel (slide 27) https://loopit.dk/banding_in_games.pdf
Definition at line 246 of file math_color_inline.cc.
References fabsf, hash_iqint3_f(), MINLINE, signf(), sqrtf, v, x, and y.
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, | ||
| int | x, | ||
| int | y ) |
Definition at line 256 of file math_color_inline.cc.
References b, dither_random_value(), MINLINE, unit_float_to_uchar_clamp(), x, and y.
Referenced by do_projectpaint_draw(), and do_projectpaint_thread().
| void hex_to_rgb | ( | const char * | hexcol, |
| float * | r_r, | ||
| float * | r_g, | ||
| float * | r_b ) |
Definition at line 185 of file math_color.cc.
References hex_to_rgba().
Referenced by BKE_gpencil_palette_ensure().
| void hex_to_rgba | ( | const char * | hexcol, |
| float * | r_r, | ||
| float * | r_g, | ||
| float * | r_b, | ||
| float * | r_a ) |
Definition at line 190 of file math_color.cc.
References CLAMP.
Referenced by hex_to_rgb(), and ui_colorpicker_hex_rna_cb().
| void hsl_to_rgb | ( | float | h, |
| float | s, | ||
| float | l, | ||
| float * | r_r, | ||
| float * | r_g, | ||
| float * | r_b ) |
Definition at line 38 of file math_color.cc.
References CLAMP, fabsf, and l.
Referenced by BKE_icon_geom_invert_lightness(), blender::nodes::node_fn_combine_color_cc::get_multi_function(), hsl_to_rgb_v(), blender::nodes::node_composite_combine_color_cc::node_build_multi_function(), and svm_combine_color().
| void hsl_to_rgb_v | ( | const float | hsl[3], |
| float | r_rgb[3] ) |
Definition at line 62 of file math_color.cc.
References hsl_to_rgb().
Referenced by BKE_colorband_evaluate(), color_mul_hsl_v3(), colorfn(), TEST(), ui_color_picker_hsv_to_rgb(), and ui_color_picker_to_rgb_HSVCUBE_v().
| void hsv_clamp_v | ( | float | hsv[3], |
| float | v_max ) |
Clamp hsv to usable values.
Definition at line 349 of file math_color.cc.
| unsigned int hsv_to_cpack | ( | float | h, |
| float | s, | ||
| float | v ) |
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 358 of file math_color.cc.
References b, col, hsv_to_rgb(), and v.
| void hsv_to_rgb | ( | float | h, |
| float | s, | ||
| float | v, | ||
| float * | r_r, | ||
| float * | r_g, | ||
| float * | r_b ) |
Definition at line 21 of file math_color.cc.
References CLAMP, fabsf, and v.
Referenced by blender::seq::HueCorrectApplyOp::apply(), 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::nodes::node_fn_combine_color_cc::get_multi_function(), hsv_to_cpack(), hsv_to_rgb_v(), IMB_saturation(), blender::color::mix_color(), blender::color::mix_hue(), blender::color::mix_luminosity(), blender::color::mix_saturation(), blender::nodes::node_composite_combine_color_cc::node_build_multi_function(), blender::nodes::node_composite_combine_hsva_cc::node_build_multi_function(), node_mix_color(), node_mix_hue(), node_mix_sat(), node_mix_val(), ramp_blend(), rgb_float_set_hue_float_offset(), svm_combine_color(), svm_mix_color(), svm_mix_hue(), svm_mix_sat(), svm_mix_val(), svm_node_combine_hsv(), svm_node_hsv(), and ui_draw_gradient().
| void hsv_to_rgb_v | ( | const float | hsv[3], |
| float | r_rgb[3] ) |
Definition at line 57 of file math_color.cc.
References hsv_to_rgb().
Referenced by blender::apply_color_factor(), BKE_colorband_evaluate(), BKE_paint_randomize_color(), checker_board_color_fill(), Color_channel_hsv_set(), blender::ed::sculpt_paint::color::color_filter_task(), Color_hsv_set(), colorfn(), ED_scene_draw_fps(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_highlights_cpu(), getcolor_fcurve_rainbow(), graph_refresh_fcurve_colors(), blender::ed::greasepencil::grease_pencil_vertex_paint_hsv_exec(), blender::nodes::node_composite_huecorrect_cc::hue_correct(), image_buf_fill_checker_slice(), blender::draw::gpencil::list_sort_do(), blender::workbench::Material::Material(), blender::nodes::node_composite_hue_sat_val_cc::node_build_multi_function(), TEST(), ui_color_picker_hsv_to_rgb(), ui_color_picker_to_rgb_HSVCUBE_v(), ui_do_but_COLOR(), ui_do_but_HSVCIRCLE(), vertex_color_hsv_exec(), and blender::nodes::node_composite_glare_cc::GlareOperation::write_glare_output_cpu().
| float linearrgb_to_srgb | ( | float | c | ) |
Definition at line 432 of file math_color.cc.
References powf.
Referenced by BLI_init_srgb_conversion(), ibuftoimage(), studiolight_irradiance_preview(), studiolight_matcap_preview(), studiolight_radiance_preview(), TEST(), TEST(), and TEST().
| MINLINE void linearrgb_to_srgb_predivide_v4 | ( | float | srgb[4], |
| const float | linear[4] ) |
Definition at line 75 of file math_color_inline.cc.
References linearrgb_to_srgb_v3_v3(), and MINLINE.
Referenced by IMB_buffer_byte_from_byte(), IMB_buffer_float_from_byte(), and IMB_buffer_float_from_float().
Definition at line 31 of file math_color_inline.cc.
References linearrgb_to_srgb_v3_v3(), MINLINE, and unit_float_to_uchar_clamp_v3.
Referenced by project_paint_uvpixel_init().
Definition at line 39 of file math_color_inline.cc.
References linearrgb_to_srgb_v4(), MINLINE, and unit_float_to_uchar_clamp_v4.
Referenced by blender::BLI_color_convert_to_theme4b(), blender::ed::object::convert_float_color_to_byte_color(), blender::ColorSceneLinear4f< eAlpha::Premultiplied >::encode(), and Freestyle::BlenderStrokeRenderer::GenerateStrokeMesh().
Definition at line 118 of file math_color_inline.cc.
References MINLINE, to_srgb_table_lookup(), and unit_float_to_ushort_clamp().
Referenced by IMB_buffer_byte_from_float().
| void linearrgb_to_srgb_v3_v3 | ( | float | srgb[3], |
| const float | linear[3] ) |
Definition at line 670 of file math_color.cc.
References linearrgb_to_srgb_approx().
Referenced by BKE_palette_from_hash(), blender::nodes::node_composite_colorbalance_cc::color_balance_lgg(), do_projectpaint_draw(), do_projectpaint_thread(), drop_color_invoke(), blender::ed::sculpt_paint::color::from_float(), IMB_buffer_byte_from_float(), IMB_buffer_float_from_float(), IMB_colormanagement_scene_linear_to_srgb_v3(), linearrgb_to_srgb_predivide_v4(), linearrgb_to_srgb_uchar3(), linearrgb_to_srgb_v4(), blender::ed::sculpt_paint::load_tex_task_cb_ex(), paint_2d_gradient_fill(), paint_sample_color(), TEST(), ui_but_paste_color(), ui_draw_but_CURVE(), blender::io::grease_pencil::write_fill_color_attribute(), blender::io::grease_pencil::write_stroke_color_attribute(), blender::io::grease_pencil::PDFExporter::write_stroke_to_polyline(), and blender::io::obj::OBJWriter::write_vertex_coords().
| MINLINE void linearrgb_to_srgb_v4 | ( | float | srgb[4], |
| const float | linear[4] ) |
Definition at line 25 of file math_color_inline.cc.
References linearrgb_to_srgb_v3_v3(), and MINLINE.
Referenced by blender::BLI_color_convert_to_theme4f(), IMB_buffer_byte_from_byte(), IMB_buffer_float_from_byte(), IMB_buffer_float_from_float(), linearrgb_to_srgb_uchar4(), and blender::io::ply::load_plydata().
Definition at line 315 of file math_color_inline.cc.
References MINLINE, result, and unit_float_to_uchar_clamp().
Referenced by do_projectpaint_soften(), IMB_buffer_byte_from_float(), IMB_buffer_byte_from_float_mask(), paint_2d_ibuf_rgb_set(), project_paint_PickColor(), blender::seq::scene_linear_to_image_chunk_byte(), blender::seq::store_pixel_premul(), blender::imbuf::transform::store_premul_float_sample(), and blender::seq::store_premul_pixel().
| MINLINE void premul_to_straight_v4 | ( | float | color[4] | ) |
Definition at line 285 of file math_color_inline.cc.
References MINLINE, and premul_to_straight_v4_v4().
Referenced by project_paint_uvpixel_init().
| MINLINE void premul_to_straight_v4_v4 | ( | float | straight[4], |
| const float | premul[4] ) |
Definition at line 268 of file math_color_inline.cc.
References MINLINE.
Referenced by copy_original_alpha_channel(), ibuftoimage(), IMB_buffer_byte_from_float(), IMB_buffer_byte_from_float_mask(), IMB_colormanagement_imbuf_to_float_texture(), partial_buffer_update_rect(), premul_to_straight_v4(), and blender::ColorSceneLinear4f< eAlpha::Premultiplied >::unpremultiply_alpha().
| void rgb_byte_set_hue_float_offset | ( | unsigned char | rgb[3], |
| float | hue_offset ) |
Applies an HUE offset to a byte RGB color.
Definition at line 698 of file math_color.cc.
References rgb_float_set_hue_float_offset(), rgb_float_to_uchar(), and rgb_uchar_to_float().
Referenced by blender::ed::vse::color3ubv_from_seq().
| void rgb_float_set_hue_float_offset | ( | float | rgb[3], |
| float | hue_offset ) |
Applies an HUE offset to a float RGB color.
Definition at line 681 of file math_color.cc.
References hsv_to_rgb(), and rgb_to_hsv().
Referenced by rgb_byte_set_hue_float_offset().
| void rgb_float_to_uchar | ( | unsigned char | r_col[3], |
| const float | col_f[3] ) |
Definition at line 411 of file math_color.cc.
References unit_float_to_uchar_clamp_v3.
Referenced by acf_gpl_channel_color(), apply_tangmat_callback(), BKE_icon_geom_invert_lightness(), brush_painter_imbuf_new(), color_mul_hsl_v3(), do_projectpaint_thread(), blender::ed::vse::draw_strips_background(), blender::ed::vse::draw_vectorscope_graticule(), blender::ed::vse::drawmeta_contents(), IMB_buffer_byte_from_float(), IMB_buffer_byte_from_float_mask(), IMB_saturation(), blender::ed::animation::greasepencil::layer_channel_color(), paint_2d_bucket_fill(), partial_buffer_update_rect(), rgb_byte_set_hue_float_offset(), and ui_tooltip_region_draw_cb().
| unsigned int rgb_to_cpack | ( | float | r, |
| float | g, | ||
| float | b ) |
Definition at line 374 of file math_color.cc.
References b, floorf, and max_ff().
Referenced by palette_extract_img_exec(), studiolight_irradiance_preview(), studiolight_matcap_preview(), and studiolight_radiance_preview().
| void rgb_to_hsl | ( | float | r, |
| float | g, | ||
| float | b, | ||
| float * | r_h, | ||
| float * | r_s, | ||
| float * | r_l ) |
Definition at line 263 of file math_color.cc.
References b, l, max_fff(), min_ff(), and min_fff().
Referenced by blender::nodes::node_fn_separate_color_cc::SeparateHSLAFunction::call(), blender::nodes::node_composite_separate_color_cc::node_build_multi_function(), rgb_to_hsl_compat(), rgb_to_hsl_v(), and svm_separate_color().
| void rgb_to_hsl_compat | ( | float | r, |
| float | g, | ||
| float | b, | ||
| float * | r_h, | ||
| float * | r_s, | ||
| float * | r_l ) |
Definition at line 292 of file math_color.cc.
References b, and rgb_to_hsl().
Referenced by rgb_to_hsl_compat_v().
| void rgb_to_hsl_compat_v | ( | const float | rgb[3], |
| float | r_hsl[3] ) |
Definition at line 313 of file math_color.cc.
References rgb_to_hsl_compat().
Referenced by ui_color_picker_rgb_to_hsv_compat(), and ui_rgb_to_color_picker_HSVCUBE_compat_v().
| void rgb_to_hsl_v | ( | const float | rgb[3], |
| float | r_hsl[3] ) |
Definition at line 318 of file math_color.cc.
References rgb_to_hsl().
Referenced by apply_color_space(), 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().
| void rgb_to_hsv | ( | float | r, |
| float | g, | ||
| float | b, | ||
| float * | r_h, | ||
| float * | r_s, | ||
| float * | r_v ) |
Definition at line 234 of file math_color.cc.
References b, fabsf, min_ff(), and SWAP.
Referenced by blender::seq::HueCorrectApplyOp::apply(), 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(), blender::nodes::node_fn_separate_color_cc::SeparateHSVAFunction::call(), Color_channel_hsv_get(), Color_hsv_get(), SeparateHSVNode::constant_fold(), do_hue_sat_fac(), ED_image_draw_info(), blender::color::mix_color(), blender::color::mix_hue(), blender::color::mix_luminosity(), blender::color::mix_saturation(), blender::nodes::node_composite_separate_color_cc::node_build_multi_function(), blender::nodes::node_composite_separate_hsva_cc::node_build_multi_function(), node_mix_color(), node_mix_hue(), node_mix_sat(), node_mix_val(), 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(), svm_node_separate_hsv(), and svm_separate_color().
| void rgb_to_hsv_compat | ( | float | r, |
| float | g, | ||
| float | b, | ||
| float * | r_h, | ||
| float * | r_s, | ||
| float * | r_v ) |
Definition at line 323 of file math_color.cc.
References b, e, and rgb_to_hsv().
Referenced by rgb_to_hsv_compat_v().
| void rgb_to_hsv_compat_v | ( | const float | rgb[3], |
| float | r_hsv[3] ) |
Definition at line 344 of file math_color.cc.
References rgb_to_hsv_compat().
Referenced by ui_color_picker_rgb_to_hsv_compat(), ui_do_but_COLOR(), ui_draw_but_HSVCUBE(), and ui_rgb_to_color_picker_HSVCUBE_compat_v().
| void rgb_to_hsv_v | ( | const float | rgb[3], |
| float | r_hsv[3] ) |
Definition at line 258 of file math_color.cc.
References rgb_to_hsv().
Referenced by blender::apply_color_factor(), apply_color_space(), BKE_colorband_evaluate(), BKE_paint_randomize_color(), blender::nodes::node_composite_channel_matte_cc::channel_key(), Color_channel_hsv_set(), blender::ed::sculpt_paint::color::color_filter_task(), blender::nodes::node_composite_color_matte_cc::color_matte(), ED_scene_draw_fps(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_highlights_cpu(), graph_refresh_fcurve_colors(), blender::ed::greasepencil::grease_pencil_vertex_paint_hsv_exec(), blender::nodes::node_composite_huecorrect_cc::hue_correct(), IMB_saturation(), blender::nodes::node_composite_hue_sat_val_cc::node_build_multi_function(), TEST(), ui_color_picker_rgb_to_hsv(), ui_draw_but_CURVE(), ui_draw_but_HSV_v(), ui_rgb_to_color_picker_HSVCUBE_v(), ui_tooltip_data_from_button_or_extra_icon(), vertex_color_hsv_exec(), weightvg_do_mask(), and blender::nodes::node_composite_glare_cc::GlareOperation::write_glare_output_cpu().
| void rgb_to_ycc | ( | float | r, |
| float | g, | ||
| float | b, | ||
| float * | r_y, | ||
| float * | r_cb, | ||
| float * | r_cr, | ||
| int | colorspace ) |
The RGB inputs are supposed gamma corrected and in the range 0 - 1.0f
Output YCC have a range of 16-235 and 16-240 except with JFIF_0_255 where the range is 0-255.
Definition at line 115 of file math_color.cc.
References b, BLI_assert_msg, BLI_YCC_ITU_BT601, BLI_YCC_ITU_BT709, BLI_YCC_JFIF_0_255, and y.
Referenced by blender::nodes::node_composite_channel_matte_cc::channel_key(), blender::nodes::node_composite_chroma_matte_cc::chroma_matte(), blender::nodes::node_composite_distance_matte_cc::distance_key_ycca(), blender::nodes::node_composite_separate_color_cc::node_build_multi_function(), blender::nodes::node_composite_separate_ycca_cc::node_build_multi_function(), 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 67 of file math_color.cc.
References b, BLI_assert, BLI_YUV_ITU_BT601, BLI_YUV_ITU_BT709, v, and y.
Referenced by blender::nodes::node_composite_channel_matte_cc::channel_key(), ED_image_draw_info(), blender::nodes::node_composite_separate_color_cc::node_build_multi_function(), blender::nodes::node_composite_separate_yuva_cc::node_build_multi_function(), blender::ed::vse::rgb_to_uv_scaled(), 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 396 of file math_color.cc.
Referenced by blender::seq::apply_and_advance_mask(), BKE_icon_geom_invert_lightness(), color_mul_hsl_v3(), display_buffer_apply_get_linear_buffer(), ED_space_clip_color_sample(), ED_space_image_color_sample(), ED_space_node_color_sample(), gl_shaded_color_get_fl(), IMB_colormanagement_get_luminance_byte(), IMB_saturation(), paint_sample_color(), pointdensity_cache_vertex_color(), rgb_byte_set_hue_float_offset(), blender::seq::tonemap_rd_photoreceptor(), blender::seq::tonemap_simple(), ui_draw_but_CURVE(), ui_draw_but_CURVEPROFILE(), and ui_tooltip_region_draw_cb().
| MINLINE void rgba_float_args_set | ( | float | col[4], |
| float | r, | ||
| float | g, | ||
| float | b, | ||
| float | a ) |
Definition at line 160 of file math_color_inline.cc.
References b, col, and MINLINE.
Referenced by default_paint_slot_color_get(), blender::ed::space_node::frame_node_draw_background(), blender::ed::space_node::node_draw_basis(), and blender::ed::space_node::node_draw_hidden().
| void rgba_float_to_uchar | ( | unsigned char | r_col[4], |
| const float | col_f[4] ) |
Definition at line 416 of file math_color.cc.
References unit_float_to_uchar_clamp_v4.
Referenced by BKE_image_buf_fill_color(), BKE_paint_face_set_overlay_color_get(), BLF_color4fv(), blf_draw_buffer__start(), blf_draw_svg_icon(), BLF_shadow(), blender::BLI_color_convert_to_theme4b(), brush_painter_imbuf_update(), dynamic_paint_apply_surface_vpaint_cb(), file_draw_special_image(), blender::ed::sculpt_paint::color::from_float(), IMB_buffer_byte_from_byte(), IMB_buffer_byte_from_float(), IMB_buffer_byte_from_float_mask(), IMB_colormanagement_processor_apply_byte(), blender::io::fbx::import_colors(), mloopcol_from_float(), paint_2d_gradient_fill(), partial_buffer_update_rect(), blender::seq::store_pixel_raw(), ui_block_colorpicker(), UI_but_node_link_set(), ui_draw_widget_back_color(), ui_tooltip_color_string(), ui_update_color_picker_buts_rgba(), uiTemplateNodeSocket(), widget_swatch(), blender::bke::image::ImageBufferAccessor< T, Channels >::write_pixel(), and blender::ed::sculpt_paint::paint::image::ImageBufferByte4::write_pixel().
| MINLINE void rgba_uchar_args_set | ( | unsigned char | col[4], |
| unsigned char | r, | ||
| unsigned char | g, | ||
| unsigned char | b, | ||
| unsigned char | a ) |
Definition at line 151 of file math_color_inline.cc.
References b, col, and MINLINE.
Referenced by action_group_colors_sync().
| MINLINE void rgba_uchar_args_test_set | ( | unsigned char | col[4], |
| unsigned char | r, | ||
| unsigned char | g, | ||
| unsigned char | b, | ||
| unsigned char | a ) |
Definition at line 169 of file math_color_inline.cc.
| void rgba_uchar_to_float | ( | float | r_col[4], |
| const unsigned char | col_ub[4] ) |
Definition at line 403 of file math_color.cc.
Referenced by accessor_get_ibuf(), blender::BLI_color_convert_to_theme4f(), display_buffer_apply_get_linear_buffer(), draw_columnheader_columns(), draw_disk_shaded(), dynamic_paint_set_init_color_vcol_to_imseq_cb(), eyedropper_draw_cursor_text_region(), 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_float_texture(), IMB_colormanagement_processor_apply_byte(), IMB_sampleImageAtLocation(), knifetool_draw(), blender::seq::load_pixel_raw(), mask_draw_curve_type(), mloopcol_to_float(), paint_2d_bucket_fill(), paint_2d_fill_add_pixel_byte(), partial_buffer_update_rect(), blender::bke::image::ImageBufferAccessor< T, Channels >::read_pixel(), blender::ed::sculpt_paint::paint::image::ImageBufferByte4::read_pixel(), screen_draw_area_drag_tip(), textview_draw_string(), blender::ed::sculpt_paint::color::to_float(), ui_draw_but_IMAGE(), ui_tooltip_from_vfont(), blender::draw::overlay::Resources::update_theme_settings(), use_bone_color(), widget_draw_node_link_socket(), widget_draw_submenu_tria(), wm_drop_operator_draw(), and wm_drop_redalert_draw().
| MINLINE float srgb_to_grayscale | ( | const float | rgb[3] | ) |
Compute luminance using Rec.709 primaries, for sRGB and linear Rec.709.
Only use for colors known to be in sRGB space, like user interface and themes. Scene colors should use IMB_colormanagement_get_luminance instead.
Definition at line 196 of file math_color_inline.cc.
References MINLINE.
Referenced by button2d_draw_intern(), ED_view3d_text_colors_get(), file_draw_preview(), file_draw_special_image(), ui_tooltip_region_draw_cb(), and widget_swatch().
Definition at line 207 of file math_color_inline.cc.
References MINLINE.
Referenced by blf_glyph_cache_add_svg(), color_ensure_contrast_v3(), drw_text_cache_draw_ex(), icon_draw_size(), UI_draw_widget_scroll(), widget_active_color(), and widget_state_numslider().
| float srgb_to_linearrgb | ( | float | c | ) |
Definition at line 423 of file math_color.cc.
References powf.
Referenced by BLI_init_srgb_conversion(), image_buf_fill_checker_slice(), imb_save_openexr_half(), and TEST().
| MINLINE void srgb_to_linearrgb_predivide_v4 | ( | float | linear[4], |
| const float | srgb[4] ) |
Definition at line 52 of file math_color_inline.cc.
References MINLINE, 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 126 of file math_color_inline.cc.
References BLI_color_from_srgb_table, and MINLINE.
Referenced by blender::BLI_color_convert_to_scene_linear(), blender::compositor::compute_marker_points(), blender::ColorSceneLinearByteEncoded4b< eAlpha::Premultiplied >::decode(), blender::io::obj::geom_add_mrgb_colors(), IMB_buffer_float_from_byte(), project_paint_uvpixel_init(), and srgb_to_linearrgb_uchar4_predivide().
Definition at line 134 of file math_color_inline.cc.
References i, MINLINE, srgb_to_linearrgb_predivide_v4(), and srgb_to_linearrgb_uchar4().
Referenced by IMB_buffer_float_from_byte().
| void srgb_to_linearrgb_v3_v3 | ( | float | linear[3], |
| const float | srgb[3] ) |
Definition at line 663 of file math_color.cc.
References srgb_to_linearrgb_approx().
Referenced by blo_do_versions_250(), blo_do_versions_280(), blender::ed::greasepencil::boundary_to_curves(), blender::nodes::node_composite_colorbalance_cc::color_balance_lgg(), blender::io::obj::geom_add_vertex(), blender::ed::greasepencil::grease_pencil_primitive_invoke(), blender::ed::greasepencil::grease_pencil_vertex_paint_set_exec(), image_buf_fill_checker_slice(), IMB_buffer_byte_from_float(), IMB_buffer_float_from_float(), IMB_colormanagement_imbuf_to_float_texture(), IMB_colormanagement_srgb_to_scene_linear_v3(), blender::ed::sculpt_paint::paint::image::PaintingKernel< ImageBuffer >::init_brush_color(), blender::ed::sculpt_paint::greasepencil::TintOperation::on_stroke_begin(), blender::ed::sculpt_paint::greasepencil::VertexPaintOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexReplaceOperation::on_stroke_extended(), paint_2d_bucket_fill(), paint_proj_stroke_ps(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::PaintOperationExecutor(), srgb_to_linearrgb_predivide_v4(), srgb_to_linearrgb_v4(), TEST(), blender::ed::sculpt_paint::color::to_float(), and ui_but_copy_color().
| MINLINE void srgb_to_linearrgb_v4 | ( | float | linear[4], |
| const float | srgb[4] ) |
Definition at line 19 of file math_color_inline.cc.
References MINLINE, and srgb_to_linearrgb_v3_v3().
Referenced by add_ibuf_for_tile(), blender::ed::greasepencil::add_material_from_template(), blender::draw::overlay::Fade::begin_sync(), blender::draw::overlay::Grid::begin_sync(), blender::draw::overlay::MeshUVs::begin_sync(), blender::draw::overlay::ModeTransfer::begin_sync(), blender::draw::overlay::Text::begin_sync(), blf_draw_buffer__start(), blender::BLI_color_convert_to_scene_linear(), blo_do_versions_280(), buf_rectfill_area(), blender::io::ply::convert_ply_to_mesh(), blender::draw::overlay::MeshUVs::end_sync(), IMB_buffer_byte_from_byte(), IMB_buffer_byte_from_float(), IMB_buffer_float_from_float(), blender::ed::object::mesh_to_grease_pencil_add_material(), blender::seq::render_pixel_from_sequencer_space_v4(), blender::io::grease_pencil::unpack_nano_color(), blender::draw::overlay::Resources::update_theme_settings(), and use_bone_color().
| MINLINE void straight_to_premul_v4 | ( | float | color[4] | ) |
Definition at line 299 of file math_color_inline.cc.
References MINLINE, and straight_to_premul_v4_v4().
Referenced by blender::nodes::node_geo_image_texture_cc::ImageFieldsFunction::call(), do_display_buffer_apply_thread(), paint_2d_bucket_fill(), paint_2d_fill_add_pixel_byte(), paint_sample_color(), and partial_buffer_update_rect().
| MINLINE void straight_to_premul_v4_v4 | ( | float | premul[4], |
| const float | straight[4] ) |
Definition at line 290 of file math_color_inline.cc.
References MINLINE.
Referenced by copy_original_alpha_channel(), blender::seq::fill_rect_alpha_under(), blender::ColorSceneLinear4f< eAlpha::Premultiplied >::premultiply_alpha(), project_paint_uvpixel_init(), and straight_to_premul_v4().
Definition at line 304 of file math_color_inline.cc.
References MINLINE, and result.
Referenced by blender::imbuf::transform::add_subsample(), do_projectpaint_soften(), blender::seq::load_pixel_premul(), blender::seq::load_premul_pixel(), paint_2d_ibuf_rgb_get(), blender::seq::pixels_to_scene_linear_byte(), and project_paint_PickColor().
Definition at line 103 of file math_color_inline.cc.
References BLI_color_to_srgb_table, and MINLINE.
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 150 of file math_color.cc.
References b, BLI_assert_unreachable, BLI_YCC_ITU_BT601, BLI_YCC_ITU_BT709, BLI_YCC_JFIF_0_255, and y.
Referenced by imb_load_openexr(), blender::nodes::node_composite_combine_color_cc::node_build_multi_function(), blender::nodes::node_composite_combine_ycca_cc::node_build_multi_function(), 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 91 of file math_color.cc.
References b, BLI_assert, BLI_YUV_ITU_BT601, BLI_YUV_ITU_BT709, v, and y.
Referenced by blender::ed::vse::draw_vectorscope_graticule(), blender::nodes::node_composite_combine_color_cc::node_build_multi_function(), blender::nodes::node_composite_combine_yuva_cc::node_build_multi_function(), TEST(), and ui_draw_but_VECTORSCOPE().