|
Blender V4.5
|
Go to the source code of this file.
Macros | |
| #define | __MATH_COLOR_INLINE_C__ |
Functions | |
| 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 | 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]) |
| 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 | rgba_uchar_args_set (uchar col[4], const uchar r, const uchar g, const uchar b, const uchar 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 (uchar col[4], const uchar r, const uchar g, const uchar b, const uchar a) |
| MINLINE void | cpack_cpy_3ub (unsigned char r_col[3], const unsigned int pack) |
| MINLINE int | compare_rgb_uchar (const unsigned char col_a[3], const unsigned char col_b[3], const int limit) |
| MINLINE float | hash_iqint3_f (const uint32_t x, const uint32_t y) |
| 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 | 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]) |
sRGB/Gray-Scale Functions | |
| |
| MINLINE float | srgb_to_grayscale (const float rgb[3]) |
| MINLINE unsigned char | srgb_to_grayscale_byte (const unsigned char rgb[3]) |
Variables | |
| float | BLI_color_from_srgb_table [256] |
| unsigned short | BLI_color_to_srgb_table [0x10000] |
| #define __MATH_COLOR_INLINE_C__ |
Definition at line 15 of file math_color_inline.cc.
| MINLINE int compare_rgb_uchar | ( | const unsigned char | col_a[3], |
| const unsigned char | col_b[3], | ||
| const int | limit ) |
Definition at line 218 of file math_color_inline.cc.
Definition at line 180 of file math_color_inline.cc.
References MINLINE.
| 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().
| MINLINE float hash_iqint3_f | ( | const uint32_t | x, |
| const uint32_t | y ) |
Definition at line 238 of file math_color_inline.cc.
Referenced by dither_random_value().
| 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().
| 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().
| MINLINE void rgba_float_args_set | ( | float | col[4], |
| const float | r, | ||
| const float | g, | ||
| const float | b, | ||
| const 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().
| MINLINE void rgba_uchar_args_set | ( | uchar | col[4], |
| const uchar | r, | ||
| const uchar | g, | ||
| const uchar | b, | ||
| const uchar | 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 | ( | uchar | col[4], |
| const uchar | r, | ||
| const uchar | g, | ||
| const uchar | b, | ||
| const uchar | a ) |
Definition at line 169 of file math_color_inline.cc.
| 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().
| 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().
| 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().
|
extern |
Definition at line 712 of file math_color.cc.
Referenced by BLI_init_srgb_conversion(), blender::draw::AttributeConverter< ColorGeometry4b >::convert(), blender::draw::particle_pack_mcol(), and srgb_to_linearrgb_uchar4().
|
extern |
Definition at line 713 of file math_color.cc.
Referenced by BLI_init_srgb_conversion(), and to_srgb_table_lookup().