|
Blender
V2.93
|
Go to the source code of this file.
Functions | |
| void | hsv_to_rgb (float h, float s, float v, float *r_r, float *r_g, float *r_b) |
| void | hsl_to_rgb (float h, float s, float l, 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_v (const float hsl[3], float r_rgb[3]) |
| void | rgb_to_yuv (float r, float g, float b, float *r_y, float *r_u, float *r_v, int colorspace) |
| void | yuv_to_rgb (float y, float u, float v, float *r_r, float *r_g, float *r_b, int colorspace) |
| void | rgb_to_ycc (float r, float g, float b, float *r_y, float *r_cb, float *r_cr, int colorspace) |
| void | ycc_to_rgb (float y, float cb, float cr, float *r_r, float *r_g, float *r_b, int colorspace) |
| void | hex_to_rgb (const char *hexcol, float *r_r, float *r_g, float *r_b) |
| 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_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_hsl_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]) |
| void | hsv_clamp_v (float hsv[3], float v_max) |
| unsigned int | hsv_to_cpack (float h, float s, float v) |
| unsigned int | rgb_to_cpack (float r, float g, float b) |
| void | cpack_to_rgb (unsigned int col, float *r_r, float *r_g, float *r_b) |
| 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]) |
| float | srgb_to_linearrgb (float c) |
| float | linearrgb_to_srgb (float c) |
| void | minmax_rgb (short c[3]) |
| int | constrain_rgb (float *r, float *g, float *b) |
| void | lift_gamma_gain_to_asc_cdl (const float *lift, const float *gamma, const float *gain, float *offset, float *slope, float *power) |
| 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) |
| static unsigned short | hipart (const float f) |
| static float | index_to_float (const unsigned short i) |
| void | BLI_init_srgb_conversion (void) |
| static void | blackbody_temperature_to_rgb (float rgb[3], float t) |
| void | blackbody_temperature_to_rgb_table (float *r_table, int width, float min, float max) |
Variables | |
| float | BLI_color_from_srgb_table [256] |
| unsigned short | BLI_color_to_srgb_table [0x10000] |
| static const float | blackbody_table_r [6][3] |
| static const float | blackbody_table_g [6][3] |
| static const float | blackbody_table_b [6][4] |
Definition at line 675 of file math_color.c.
References blackbody_table_b, blackbody_table_g, blackbody_table_r, r, and t.
Referenced by blackbody_temperature_to_rgb_table().
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().
Definition at line 482 of file math_color.c.
References min_ffff(), r, and w().
Definition at line 400 of file math_color.c.
Referenced by BKE_palette_from_hash().
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().
|
static |
Definition at line 559 of file math_color.c.
Referenced by BLI_init_srgb_conversion().
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().
|
static |
Definition at line 575 of file math_color.c.
Referenced by BLI_init_srgb_conversion().
| 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().
| void minmax_rgb | ( | short | c[3] | ) |
Definition at line 452 of file math_color.c.
References Freestyle::c.
| void rgb_byte_set_hue_float_offset | ( | unsigned char | rgb[3], |
| float | hue_offset | ||
| ) |
Definition at line 542 of file math_color.c.
References rgb_float_set_hue_float_offset(), rgb_float_to_uchar(), and rgb_uchar_to_float().
Definition at line 524 of file math_color.c.
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 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().
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().
| 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().
| 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().
| 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().
|
static |
Definition at line 666 of file math_color.c.
Referenced by blackbody_temperature_to_rgb().
|
static |
Definition at line 657 of file math_color.c.
Referenced by blackbody_temperature_to_rgb().
|
static |
Definition at line 648 of file math_color.c.
Referenced by blackbody_temperature_to_rgb().
| float BLI_color_from_srgb_table[256] |
Definition at line 556 of file math_color.c.
Referenced by BLI_init_srgb_conversion(), extract_vcol_init(), GPU_pbvh_mesh_buffers_update(), particle_pack_mcol(), and srgb_to_linearrgb_uchar4().
| unsigned short BLI_color_to_srgb_table[0x10000] |
Definition at line 557 of file math_color.c.
Referenced by BLI_init_srgb_conversion(), and to_srgb_table_lookup().