|
Blender
V2.93
|
#include "DNA_mesh_types.h"#include "DNA_meshdata_types.h"#include "DNA_object_types.h"#include "BLI_math_base.h"#include "BLI_math_color.h"#include "IMB_colormanagement.h"#include "IMB_imbuf.h"#include "BKE_context.h"#include "BKE_mesh.h"#include "DEG_depsgraph.h"#include "ED_mesh.h"#include "paint_intern.h"Go to the source code of this file.
Macros | |
| #define | EPS_SATURATION 0.0005f |
Functions | |
| bool | ED_vpaint_color_transform (struct Object *ob, VPaintTransform_Callback vpaint_tx_fn, const void *user_data) |
Color Blending Modes | |
| BLI_INLINE uint | mcol_blend (uint col_src, uint col_dst, int fac) |
| BLI_INLINE uint | mcol_add (uint col_src, uint col_dst, int fac) |
| BLI_INLINE uint | mcol_sub (uint col_src, uint col_dst, int fac) |
| BLI_INLINE uint | mcol_mul (uint col_src, uint col_dst, int fac) |
| BLI_INLINE uint | mcol_lighten (uint col_src, uint col_dst, int fac) |
| BLI_INLINE uint | mcol_darken (uint col_src, uint col_dst, int fac) |
| BLI_INLINE uint | mcol_colordodge (uint col_src, uint col_dst, int fac) |
| BLI_INLINE uint | mcol_difference (uint col_src, uint col_dst, int fac) |
| BLI_INLINE uint | mcol_screen (uint col_src, uint col_dst, int fac) |
| BLI_INLINE uint | mcol_hardlight (uint col_src, uint col_dst, int fac) |
| BLI_INLINE uint | mcol_overlay (uint col_src, uint col_dst, int fac) |
| BLI_INLINE uint | mcol_softlight (uint col_src, uint col_dst, int fac) |
| BLI_INLINE uint | mcol_exclusion (uint col_src, uint col_dst, int fac) |
| BLI_INLINE uint | mcol_luminosity (uint col_src, uint col_dst, int fac) |
| BLI_INLINE uint | mcol_saturation (uint col_src, uint col_dst, int fac) |
| BLI_INLINE uint | mcol_hue (uint col_src, uint col_dst, int fac) |
| BLI_INLINE uint | mcol_alpha_add (uint col_src, int fac) |
| BLI_INLINE uint | mcol_alpha_sub (uint col_src, int fac) |
| uint | ED_vpaint_blend_tool (const int tool, const uint col, const uint paintcol, const int alpha_i) |
Intended for use by paint_vertex.c & paint_vertex_color_ops.c.
Definition in file paint_vertex_color_utils.c.
| #define EPS_SATURATION 0.0005f |
Definition at line 42 of file paint_vertex_color_utils.c.
| uint ED_vpaint_blend_tool | ( | const int | tool, |
| const uint | col, | ||
| const uint | paintcol, | ||
| const int | alpha_i | ||
| ) |
Definition at line 616 of file paint_vertex_color_utils.c.
References BLI_assert, col, IMB_BLEND_ADD, IMB_BLEND_ADD_ALPHA, IMB_BLEND_COLORDODGE, IMB_BLEND_DARKEN, IMB_BLEND_DIFFERENCE, IMB_BLEND_ERASE_ALPHA, IMB_BLEND_EXCLUSION, IMB_BLEND_HARDLIGHT, IMB_BLEND_HUE, IMB_BLEND_LIGHTEN, IMB_BLEND_LUMINOSITY, IMB_BLEND_MIX, IMB_BLEND_MUL, IMB_BLEND_OVERLAY, IMB_BLEND_SATURATION, IMB_BLEND_SCREEN, IMB_BLEND_SOFTLIGHT, IMB_BLEND_SUB, mcol_add(), mcol_alpha_add(), mcol_alpha_sub(), mcol_blend(), mcol_colordodge(), mcol_darken(), mcol_difference(), mcol_exclusion(), mcol_hardlight(), mcol_hue(), mcol_lighten(), mcol_luminosity(), mcol_mul(), mcol_overlay(), mcol_saturation(), mcol_screen(), mcol_softlight(), and mcol_sub().
Referenced by vpaint_blend().
| bool ED_vpaint_color_transform | ( | struct Object * | ob, |
| VPaintTransform_Callback | vpaint_tx_fn, | ||
| const void * | user_data | ||
| ) |
Apply callback to each vertex of the active vertex color layer.
Definition at line 47 of file paint_vertex_color_utils.c.
References BKE_mesh_from_object(), BKE_mesh_tessface_clear(), DEG_id_tag_update(), ED_mesh_color_ensure(), Mesh::editflag, MVert::flag, MPoly::flag, Mesh::id, MPoly::loopstart, ME_EDIT_PAINT_FACE_SEL, ME_EDIT_PAINT_VERT_SEL, ME_FACE_SEL, Mesh::mloop, Mesh::mloopcol, Mesh::mpoly, Mesh::mvert, NULL, MLoopCol::r, rgb_float_to_uchar(), rgb_uchar_to_float(), SELECT, Mesh::totpoly, user_data, and MLoop::v.
Referenced by vertex_color_brightness_contrast_exec(), vertex_color_hsv_exec(), vertex_color_invert_exec(), and vertex_color_levels_exec().
| BLI_INLINE uint mcol_add | ( | uint | col_src, |
| uint | col_dst, | ||
| int | fac | ||
| ) |
Definition at line 137 of file paint_vertex_color_utils.c.
References divide_round_i().
Referenced by ED_vpaint_blend_tool().
| BLI_INLINE uint mcol_alpha_add | ( | uint | col_src, |
| int | fac | ||
| ) |
Definition at line 575 of file paint_vertex_color_utils.c.
Referenced by ED_vpaint_blend_tool().
| BLI_INLINE uint mcol_alpha_sub | ( | uint | col_src, |
| int | fac | ||
| ) |
Definition at line 594 of file paint_vertex_color_utils.c.
Referenced by ED_vpaint_blend_tool().
| BLI_INLINE uint mcol_blend | ( | uint | col_src, |
| uint | col_dst, | ||
| int | fac | ||
| ) |
Definition at line 98 of file paint_vertex_color_utils.c.
References divide_round_i(), round_fl_to_uchar(), and sqrtf.
Referenced by ED_vpaint_blend_tool().
| BLI_INLINE uint mcol_colordodge | ( | uint | col_src, |
| uint | col_dst, | ||
| int | fac | ||
| ) |
Definition at line 281 of file paint_vertex_color_utils.c.
References min_ii().
Referenced by ED_vpaint_blend_tool().
| BLI_INLINE uint mcol_darken | ( | uint | col_src, |
| uint | col_dst, | ||
| int | fac | ||
| ) |
Definition at line 248 of file paint_vertex_color_utils.c.
References divide_round_i(), and IMB_colormanagement_get_luminance_byte().
Referenced by ED_vpaint_blend_tool().
| BLI_INLINE uint mcol_difference | ( | uint | col_src, |
| uint | col_dst, | ||
| int | fac | ||
| ) |
Definition at line 308 of file paint_vertex_color_utils.c.
References abs().
Referenced by ED_vpaint_blend_tool().
| BLI_INLINE uint mcol_exclusion | ( | uint | col_src, |
| uint | col_dst, | ||
| int | fac | ||
| ) |
Definition at line 450 of file paint_vertex_color_utils.c.
Referenced by ED_vpaint_blend_tool().
| BLI_INLINE uint mcol_hardlight | ( | uint | col_src, |
| uint | col_dst, | ||
| int | fac | ||
| ) |
Definition at line 362 of file paint_vertex_color_utils.c.
References min_ii().
Referenced by ED_vpaint_blend_tool().
| BLI_INLINE uint mcol_hue | ( | uint | col_src, |
| uint | col_dst, | ||
| int | fac | ||
| ) |
Definition at line 542 of file paint_vertex_color_utils.c.
References hsv_to_rgb(), r, rgb_to_hsv(), v1, and v2.
Referenced by ED_vpaint_blend_tool().
| BLI_INLINE uint mcol_lighten | ( | uint | col_src, |
| uint | col_dst, | ||
| int | fac | ||
| ) |
Definition at line 214 of file paint_vertex_color_utils.c.
References divide_round_i(), and IMB_colormanagement_get_luminance_byte().
Referenced by ED_vpaint_blend_tool().
| BLI_INLINE uint mcol_luminosity | ( | uint | col_src, |
| uint | col_dst, | ||
| int | fac | ||
| ) |
Definition at line 475 of file paint_vertex_color_utils.c.
References hsv_to_rgb(), r, rgb_to_hsv(), v1, and v2.
Referenced by ED_vpaint_blend_tool().
| BLI_INLINE uint mcol_mul | ( | uint | col_src, |
| uint | col_dst, | ||
| int | fac | ||
| ) |
Definition at line 189 of file paint_vertex_color_utils.c.
References divide_round_i().
Referenced by ED_vpaint_blend_tool().
| BLI_INLINE uint mcol_overlay | ( | uint | col_src, |
| uint | col_dst, | ||
| int | fac | ||
| ) |
Definition at line 392 of file paint_vertex_color_utils.c.
References min_ii().
Referenced by ED_vpaint_blend_tool().
| BLI_INLINE uint mcol_saturation | ( | uint | col_src, |
| uint | col_dst, | ||
| int | fac | ||
| ) |
Definition at line 508 of file paint_vertex_color_utils.c.
References EPS_SATURATION, hsv_to_rgb(), r, rgb_to_hsv(), v1, and v2.
Referenced by ED_vpaint_blend_tool().
| BLI_INLINE uint mcol_screen | ( | uint | col_src, |
| uint | col_dst, | ||
| int | fac | ||
| ) |
Definition at line 335 of file paint_vertex_color_utils.c.
References max_ii().
Referenced by ED_vpaint_blend_tool().
| BLI_INLINE uint mcol_softlight | ( | uint | col_src, |
| uint | col_dst, | ||
| int | fac | ||
| ) |
Definition at line 422 of file paint_vertex_color_utils.c.
Referenced by ED_vpaint_blend_tool().
| BLI_INLINE uint mcol_sub | ( | uint | col_src, |
| uint | col_dst, | ||
| int | fac | ||
| ) |
Definition at line 163 of file paint_vertex_color_utils.c.
References divide_round_i().
Referenced by ED_vpaint_blend_tool().