|
Blender
V2.93
|
#include <string.h>#include "MEM_guardedalloc.h"#include "DNA_brush_types.h"#include "DNA_object_types.h"#include "DNA_scene_types.h"#include "DNA_space_types.h"#include "BLI_bitmap.h"#include "BLI_listbase.h"#include "BLI_math_color_blend.h"#include "BLI_stack.h"#include "BLI_task.h"#include "BKE_brush.h"#include "BKE_colorband.h"#include "BKE_context.h"#include "BKE_image.h"#include "BKE_paint.h"#include "BKE_report.h"#include "DEG_depsgraph.h"#include "ED_paint.h"#include "ED_screen.h"#include "IMB_colormanagement.h"#include "IMB_imbuf.h"#include "IMB_imbuf_types.h"#include "WM_api.h"#include "WM_types.h"#include "UI_view2d.h"#include "paint_intern.h"Go to the source code of this file.
Classes | |
| struct | BrushPainterCache |
| struct | BrushPainter |
| struct | ImagePaintRegion |
| struct | ImagePaintTile |
| struct | ImagePaintState |
| struct | Paint2DForeachData |
Typedefs | |
| typedef struct BrushPainterCache | BrushPainterCache |
| typedef struct BrushPainter | BrushPainter |
| typedef struct ImagePaintRegion | ImagePaintRegion |
| typedef enum ImagePaintTileState | ImagePaintTileState |
| typedef struct ImagePaintTile | ImagePaintTile |
| typedef struct ImagePaintState | ImagePaintState |
| typedef struct Paint2DForeachData | Paint2DForeachData |
Enumerations | |
| enum | ImagePaintTileState { PAINT2D_TILE_UNINITIALIZED = 0 , PAINT2D_TILE_MISSING , PAINT2D_TILE_READY } |
Functions | |
| static BrushPainter * | brush_painter_2d_new (Scene *scene, Brush *brush, bool invert) |
| static void | brush_painter_2d_require_imbuf (Brush *brush, ImagePaintTile *tile, bool use_float, bool use_color_correction, bool invert) |
| static void | brush_painter_cache_2d_free (BrushPainterCache *cache) |
| static void | brush_imbuf_tex_co (rctf *mapping, int x, int y, float texco[3]) |
| static ushort * | brush_painter_mask_ibuf_new (BrushPainter *painter, const int size) |
| static void | brush_painter_mask_imbuf_update (BrushPainter *painter, ImagePaintTile *tile, const ushort *tex_mask_old, int origx, int origy, int w, int h, int xt, int yt, const int diameter) |
| static void | brush_painter_mask_imbuf_partial_update (BrushPainter *painter, ImagePaintTile *tile, const float pos[2], const int diameter) |
| static ushort * | brush_painter_curve_mask_new (BrushPainter *painter, int diameter, float radius, const float pos[2]) |
| static ImBuf * | brush_painter_imbuf_new (BrushPainter *painter, ImagePaintTile *tile, const int size, float pressure, float distance) |
| static void | brush_painter_imbuf_update (BrushPainter *painter, ImagePaintTile *tile, ImBuf *oldtexibuf, int origx, int origy, int w, int h, int xt, int yt) |
| static void | brush_painter_imbuf_partial_update (BrushPainter *painter, ImagePaintTile *tile, const float pos[2], const int diameter) |
| static void | brush_painter_2d_tex_mapping (ImagePaintState *s, ImBuf *canvas, const int diameter, const float startpos[2], const float pos[2], const float mouse[2], int mapmode, rctf *mapping) |
| static void | brush_painter_2d_refresh_cache (ImagePaintState *s, BrushPainter *painter, ImagePaintTile *tile, const float pos[2], const float mouse[2], float pressure, float distance, float size) |
| static bool | paint_2d_ensure_tile_canvas (ImagePaintState *s, int i) |
| static void | paint_2d_ibuf_rgb_get (ImBuf *ibuf, int x, int y, float r_rgb[4]) |
| static void | paint_2d_ibuf_rgb_set (ImBuf *ibuf, int x, int y, const bool is_torus, const float rgb[4]) |
| static void | paint_2d_ibuf_tile_convert (ImBuf *ibuf, int *x, int *y, short paint_tile) |
| static float | paint_2d_ibuf_add_if (ImBuf *ibuf, int x, int y, float *outrgb, short paint_tile, float w) |
| static void | paint_2d_lift_soften (ImagePaintState *s, ImagePaintTile *tile, ImBuf *ibuf, ImBuf *ibufb, const int *pos, const short paint_tile) |
| static void | paint_2d_set_region (ImagePaintRegion *region, int destx, int desty, int srcx, int srcy, int width, int height) |
| static int | paint_2d_torus_split_region (ImagePaintRegion region[4], ImBuf *dbuf, ImBuf *sbuf, short paint_tile) |
| static void | paint_2d_lift_smear (ImBuf *ibuf, ImBuf *ibufb, int *pos, short paint_tile) |
| static ImBuf * | paint_2d_lift_clone (ImBuf *ibuf, ImBuf *ibufb, const int *pos) |
| static void | paint_2d_convert_brushco (ImBuf *ibufb, const float pos[2], int ipos[2]) |
| static void | paint_2d_do_making_brush (ImagePaintState *s, ImagePaintTile *tile, ImagePaintRegion *region, ImBuf *frombuf, float mask_max, short blend, int tilex, int tiley, int tilew, int tileh) |
| static void | paint_2d_op_foreach_do (void *__restrict data_v, const int iter, const TaskParallelTLS *__restrict UNUSED(tls)) |
| static int | paint_2d_op (void *state, ImagePaintTile *tile, const float lastpos[2], const float pos[2]) |
| static int | paint_2d_canvas_set (ImagePaintState *s) |
| static void | paint_2d_canvas_free (ImagePaintState *s) |
| static void | paint_2d_transform_mouse (View2D *v2d, const float in[2], float out[2]) |
| static bool | is_inside_tile (const int size[2], const float pos[2], const float brush[2]) |
| static void | paint_2d_uv_to_coord (ImagePaintTile *tile, const float uv[2], float coord[2]) |
| void | paint_2d_stroke (void *ps, const float prev_mval[2], const float mval[2], const bool eraser, float pressure, float distance, float base_size) |
| void * | paint_2d_new_stroke (bContext *C, wmOperator *op, int mode) |
| void | paint_2d_redraw (const bContext *C, void *ps, bool final) |
| void | paint_2d_stroke_done (void *ps) |
| static void | paint_2d_fill_add_pixel_byte (const int x_px, const int y_px, ImBuf *ibuf, BLI_Stack *stack, BLI_bitmap *touched, const float color[4], float threshold_sq) |
| static void | paint_2d_fill_add_pixel_float (const int x_px, const int y_px, ImBuf *ibuf, BLI_Stack *stack, BLI_bitmap *touched, const float color[4], float threshold_sq) |
| static ImageUser * | paint_2d_get_tile_iuser (ImagePaintState *s, int tile_number) |
| void | paint_2d_bucket_fill (const bContext *C, const float color[3], Brush *br, const float mouse_init[2], const float mouse_final[2], void *ps) |
| void | paint_2d_gradient_fill (const bContext *C, Brush *br, const float mouse_init[2], const float mouse_final[2], void *ps) |
| typedef struct BrushPainter BrushPainter |
| typedef struct BrushPainterCache BrushPainterCache |
| typedef struct ImagePaintRegion ImagePaintRegion |
| typedef struct ImagePaintState ImagePaintState |
| typedef struct ImagePaintTile ImagePaintTile |
| typedef enum ImagePaintTileState ImagePaintTileState |
| typedef struct Paint2DForeachData Paint2DForeachData |
| enum ImagePaintTileState |
| Enumerator | |
|---|---|
| PAINT2D_TILE_UNINITIALIZED | |
| PAINT2D_TILE_MISSING | |
| PAINT2D_TILE_READY | |
Definition at line 109 of file paint_image_2d.c.
Definition at line 214 of file paint_image_2d.c.
References x, rctf::xmax, rctf::xmin, y, rctf::ymax, and rctf::ymin.
Referenced by brush_painter_imbuf_new(), brush_painter_imbuf_update(), brush_painter_mask_ibuf_new(), and brush_painter_mask_imbuf_update().
|
static |
Definition at line 151 of file paint_image_2d.c.
References BrushPainter::brush, BrushPainter::cache_invert, BrushPainter::firsttouch, invert(), MEM_callocN, scene, and BrushPainter::scene.
Referenced by paint_2d_new_stroke().
|
static |
Definition at line 769 of file paint_image_2d.c.
References BKE_image_pool_free(), BKE_image_pool_new(), BrushPainter::brush, BRUSH_ANCHORED, BRUSH_GRADIENT_SPACING_CLAMP, BRUSH_GRADIENT_SPACING_REPEAT, MTex::brush_map_mode, brush_painter_2d_tex_mapping(), brush_painter_curve_mask_new(), brush_painter_imbuf_new(), brush_painter_imbuf_partial_update(), brush_painter_mask_ibuf_new(), brush_painter_mask_imbuf_partial_update(), UnifiedPaintSettings::brush_rotation, UnifiedPaintSettings::brush_rotation_sec, BRUSH_USE_GRADIENT, ImagePaintTile::cache, ImagePaintTile::canvas, BrushPainterCache::curve_mask, distance(), ELEM, Brush::flag, floorf, Brush::gradient_stroke_mode, BrushPainterCache::ibuf, IMB_freeImBuf(), BrushPainterCache::is_maskbrush, BrushPainterCache::is_texbrush, BrushPainterCache::last_mask_rotation, ImagePaintTile::last_paintpos, BrushPainterCache::last_pressure, BrushPainterCache::last_tex_rotation, BrushPainterCache::lastdiameter, BrushPainter::mask_mapping, Brush::mask_mtex, Brush::mask_pressure, MAX2, MEM_freeN, Brush::mtex, MTEX_MAP_MODE_RANDOM, MTEX_MAP_MODE_VIEW, NULL, BrushPainter::pool, pos, MTex::rot, scene, BrushPainter::scene, size(), ImagePaintTile::start_paintpos, BrushPainter::tex_mapping, BrushPainterCache::tex_mask, Scene::toolsettings, and ToolSettings::unified_paint_settings.
Referenced by paint_2d_stroke().
|
static |
Definition at line 163 of file paint_image_2d.c.
References ImagePaintTile::cache, BrushPainterCache::curve_mask, BrushPainterCache::ibuf, Brush::imagepaint_tool, IMB_freeImBuf(), invert(), BrushPainterCache::invert, BrushPainterCache::is_maskbrush, BrushPainterCache::is_texbrush, BrushPainterCache::lastdiameter, Brush::mask_mtex, MEM_freeN, Brush::mtex, NULL, PAINT_TOOL_DRAW, MTex::tex, BrushPainterCache::tex_mask, BrushPainterCache::tex_mask_old, BrushPainterCache::use_color_correction, and BrushPainterCache::use_float.
Referenced by paint_2d_stroke().
|
static |
Definition at line 717 of file paint_image_2d.c.
References ELEM, float(), floorf, MTEX_MAP_MODE_3D, MTEX_MAP_MODE_RANDOM, MTEX_MAP_MODE_STENCIL, MTEX_MAP_MODE_VIEW, pos, UI_view2d_view_to_region(), ImagePaintState::v2d, ImBuf::x, rctf::xmax, rctf::xmin, ImBuf::y, rctf::ymax, and rctf::ymin.
Referenced by brush_painter_2d_refresh_cache().
|
static |
Definition at line 195 of file paint_image_2d.c.
References BrushPainterCache::curve_mask, BrushPainterCache::ibuf, IMB_freeImBuf(), MEM_freeN, BrushPainterCache::tex_mask, BrushPainterCache::tex_mask_old, and BrushPainterCache::texibuf.
Referenced by paint_2d_stroke_done().
|
static |
Definition at line 384 of file paint_image_2d.c.
References aa_samples(), BKE_brush_curve_strength_clamped(), BrushPainter::brush, BRUSH_PAINT_ANTIALIASING, CLAMP, clamp_i(), cosf, curve, DEG2RADF, float(), floorf, len, len_v2(), mask(), MEM_mallocN, pos, Brush::sampling_flag, sinf, sub_v2_v2(), x, and y.
Referenced by brush_painter_2d_refresh_cache().
|
static |
Definition at line 457 of file paint_image_2d.c.
References BKE_brush_sample_tex_3d(), BrushPainter::brush, brush_imbuf_tex_co(), ImagePaintTile::cache, copy_v3_v3(), ColorManagedDisplaySettings::display_device, Scene::display_settings, distance(), IB_rect, IB_rectfloat, Brush::imagepaint_tool, IMB_allocImBuf(), IMB_colormanagement_display_get_named(), IMB_colormanagement_scene_linear_to_display_v3(), BrushPainterCache::invert, BrushPainterCache::is_texbrush, mul_v3_v3(), mul_v3_v3fl(), paint_brush_color_get(), PAINT_TOOL_DRAW, blender::compositor::pool, BrushPainter::pool, ImBuf::rect, ImBuf::rect_float, rgb_float_to_uchar(), scene, BrushPainter::scene, size(), BrushPainter::tex_mapping, unit_float_to_uchar_clamp(), BrushPainterCache::use_color_correction, BrushPainterCache::use_float, x, and y.
Referenced by brush_painter_2d_refresh_cache().
|
static |
Definition at line 653 of file paint_image_2d.c.
References brush_painter_imbuf_update(), ImagePaintTile::cache, floorf, IB_rect, IB_rectfloat, BrushPainterCache::ibuf, IMB_allocImBuf(), IMB_freeImBuf(), IMB_rectclip(), ImagePaintTile::last_paintpos, min_ii(), NULL, pos, BrushPainterCache::texibuf, BrushPainterCache::use_float, w(), x, ImBuf::x, x2, y, ImBuf::y, and y1.
Referenced by brush_painter_2d_refresh_cache().
|
static |
Definition at line 531 of file paint_image_2d.c.
References BKE_brush_sample_tex_3d(), BrushPainter::brush, brush_imbuf_tex_co(), ImagePaintTile::cache, copy_v3_v3(), copy_v4_v4(), ColorManagedDisplaySettings::display_device, Scene::display_settings, BrushPainterCache::ibuf, Brush::imagepaint_tool, IMB_colormanagement_display_get_named(), IMB_colormanagement_scene_linear_to_display_v3(), BrushPainterCache::invert, BrushPainterCache::is_texbrush, mul_v3_v3(), mul_v3_v3fl(), NULL, ot, paint_brush_color_get(), PAINT_TOOL_DRAW, blender::compositor::pool, BrushPainter::pool, ImBuf::rect, ImBuf::rect_float, rgba_float_to_uchar(), scene, BrushPainter::scene, t, BrushPainter::tex_mapping, BrushPainterCache::texibuf, BrushPainterCache::use_color_correction, BrushPainterCache::use_float, w(), x, ImBuf::x, and y.
Referenced by brush_painter_imbuf_partial_update().
|
static |
Definition at line 222 of file paint_image_2d.c.
References BKE_brush_sample_masktex(), BrushPainter::brush, brush_imbuf_tex_co(), mask(), BrushPainter::mask_mapping, MEM_mallocN, blender::compositor::pool, BrushPainter::pool, scene, BrushPainter::scene, size(), x, and y.
Referenced by brush_painter_2d_refresh_cache().
|
static |
Update the brush mask image by trying to reuse the cached texture result. This can be considerably faster for brushes that change size due to pressure or textures that stick to the surface where only part of the pixels are new
Definition at line 307 of file paint_image_2d.c.
References brush_painter_mask_imbuf_update(), ImagePaintTile::cache, floorf, IMB_rectclip(), ImagePaintTile::last_paintpos, MEM_freeN, MEM_mallocN, min_ii(), NULL, pos, BrushPainterCache::tex_mask, BrushPainterCache::tex_mask_old, BrushPainterCache::tex_mask_old_h, BrushPainterCache::tex_mask_old_w, w(), ImBuf::x, x2, ImBuf::y, and y1.
Referenced by brush_painter_2d_refresh_cache().
|
static |
Definition at line 249 of file paint_image_2d.c.
References BKE_brush_sample_masktex(), BrushPainter::brush, brush_imbuf_tex_co(), ImagePaintTile::cache, BrushPainter::mask_mapping, NULL, blender::compositor::pool, BrushPainter::pool, scene, BrushPainter::scene, t, BrushPainterCache::tex_mask, BrushPainterCache::tex_mask_old, BrushPainterCache::tex_mask_old_w, w(), x, and y.
Referenced by brush_painter_mask_imbuf_partial_update().
Definition at line 1556 of file paint_image_2d.c.
Referenced by paint_2d_stroke().
| void paint_2d_bucket_fill | ( | const bContext * | C, |
| const float | color[3], | ||
| Brush * | br, | ||
| const float | mouse_init[2], | ||
| const float | mouse_final[2], | ||
| void * | ps | ||
| ) |
Definition at line 1871 of file paint_image_2d.c.
References BKE_brush_alpha_get(), BKE_image_acquire_ibuf(), BKE_image_get_tile_from_pos(), BKE_image_release_ibuf(), BKE_imageuser_default(), Brush::blend, blend_color_mix_byte(), blend_color_mix_float(), BLI_BITMAP_NEW, BLI_BITMAP_SET, BLI_stack_free(), BLI_stack_is_empty(), BLI_stack_new, BLI_stack_pop(), BLI_stack_push(), C, copy_v3_v3(), copy_v4_v4(), CTX_wm_region(), CTX_wm_space_image(), ED_imapaint_clear_partial_redraw(), ED_imapaint_dirty_region(), Brush::fill_threshold, SpaceImage::image, image_init(), imapaint_image_update(), IMB_blend_color_byte(), IMB_blend_color_float(), linearrgb_to_srgb_uchar3(), MEM_freeN, NA_EDITED, NC_IMAGE, NULL, paint_2d_fill_add_pixel_byte(), paint_2d_fill_add_pixel_float(), paint_2d_get_tile_iuser(), paint_2d_transform_mouse(), ImBuf::rect, ImBuf::rect_float, rgba_uchar_to_float(), ImagePaintState::scene, straight_to_premul_v4(), ImageUser::tile, ImagePaintState::v2d, ARegion::v2d, width, WM_event_add_notifier(), ImBuf::x, and ImBuf::y.
Referenced by ED_imapaint_bucket_fill(), and paint_stroke_done().
|
static |
Definition at line 1538 of file paint_image_2d.c.
References BKE_image_release_ibuf(), ImagePaintState::blurkernel, ImagePaintState::brush, ImagePaintTile::canvas, Brush::clone, ImagePaintState::clonecanvas, ImagePaintState::image, BrushClone::image, MEM_freeN, NULL, ImagePaintState::num_tiles, paint_delete_blur_kernel(), and ImagePaintState::tiles.
Referenced by paint_2d_stroke_done().
|
static |
Definition at line 1509 of file paint_image_2d.c.
References BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), ImagePaintState::brush, ImagePaintTile::canvas, Brush::clone, ImagePaintState::clonecanvas, ImagePaintState::do_masking, BrushClone::image, IMB_float_from_rect(), IMB_rect_from_float(), NULL, PAINT_TOOL_CLONE, paint_use_opacity_masking(), ImBuf::rect, ImBuf::rect_float, ImagePaintState::tiles, and ImagePaintState::tool.
Referenced by paint_2d_new_stroke().
Definition at line 1295 of file paint_image_2d.c.
References floorf, pos, ImBuf::x, and ImBuf::y.
Referenced by paint_2d_op().
|
static |
Definition at line 1301 of file paint_image_2d.c.
References blend(), ImagePaintState::brush, BRUSH_ACCUMULATE, ImagePaintTile::cache, ImagePaintTile::canvas, BrushPainterCache::curve_mask, ImagePaintRegion::destx, ImagePaintRegion::desty, ED_image_paint_tile_find(), ED_image_paint_tile_list_get(), ED_IMAGE_UNDO_TILE_SIZE, Brush::flag, ImagePaintRegion::height, ImagePaintState::image, IMB_initImBuf(), IMB_rectblend(), ImagePaintTile::iuser, mask(), ImBuf::rect, ImBuf::rect_float, ImagePaintRegion::srcx, ImagePaintRegion::srcy, BrushPainterCache::tex_mask, and ImagePaintRegion::width.
Referenced by paint_2d_op(), and paint_2d_op_foreach_do().
|
static |
Definition at line 908 of file paint_image_2d.c.
References BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), ImagePaintTile::cache, ImagePaintTile::canvas, ImBuf::channels, ImagePaintState::image, ImagePaintTile::iuser, BrushPainterCache::lastdiameter, NULL, ImagePaintState::num_tiles, ImageUser::ok, PAINT2D_TILE_MISSING, PAINT2D_TILE_READY, ImagePaintTile::radius_fac, ImBuf::rect, ImBuf::rect_float, ImagePaintTile::size, sqrtf, ImagePaintTile::state, ImagePaintState::tiles, ImBuf::x, and ImBuf::y.
Referenced by paint_2d_get_tile_iuser(), and paint_2d_stroke().
|
static |
Definition at line 1801 of file paint_image_2d.c.
References BLI_BITMAP_SET, BLI_BITMAP_TEST, BLI_stack_push(), len_squared_v4v4(), ImBuf::rect, rgba_uchar_to_float(), straight_to_premul_v4(), ImBuf::x, and ImBuf::y.
Referenced by paint_2d_bucket_fill().
|
static |
Definition at line 1830 of file paint_image_2d.c.
References BLI_BITMAP_SET, BLI_BITMAP_TEST, BLI_stack_push(), len_squared_v4v4(), ImBuf::rect_float, ImBuf::x, and ImBuf::y.
Referenced by paint_2d_bucket_fill().
|
static |
Definition at line 1854 of file paint_image_2d.c.
References ImagePaintTile::iuser, NULL, ImagePaintState::num_tiles, paint_2d_ensure_tile_canvas(), ImageUser::tile, and ImagePaintState::tiles.
Referenced by paint_2d_bucket_fill(), and paint_2d_gradient_fill().
| void paint_2d_gradient_fill | ( | const bContext * | C, |
| Brush * | br, | ||
| const float | mouse_init[2], | ||
| const float | mouse_final[2], | ||
| void * | ps | ||
| ) |
Definition at line 2098 of file paint_image_2d.c.
References BKE_brush_alpha_get(), BKE_colorband_evaluate(), BKE_image_acquire_ibuf(), BKE_image_get_tile_from_pos(), BKE_image_release_ibuf(), Brush::blend, BRUSH_GRADIENT_LINEAR, BRUSH_GRADIENT_RADIAL, C, CTX_wm_space_image(), dot_v2v2(), ED_imapaint_clear_partial_redraw(), ED_imapaint_dirty_region(), Brush::gradient, Brush::gradient_fill_mode, SpaceImage::image, image_init(), imapaint_image_update(), IMB_blend_color_byte(), IMB_blend_color_float(), len_squared_v2(), len_v2(), linearrgb_to_srgb_v3_v3(), mul_v3_fl(), NA_EDITED, NC_IMAGE, NULL, paint_2d_get_tile_iuser(), paint_2d_transform_mouse(), ImBuf::rect, ImBuf::rect_float, rgba_float_to_uchar(), ImagePaintState::scene, sqrtf, sub_v2_v2(), sub_v2_v2v2(), ImagePaintState::v2d, WM_event_add_notifier(), ImBuf::x, and ImBuf::y.
Referenced by paint_stroke_done().
|
static |
Definition at line 1019 of file paint_image_2d.c.
References add_v4_v4(), mul_v4_fl(), paint_2d_ibuf_rgb_get(), paint_2d_ibuf_tile_convert(), w(), x, and y.
Referenced by paint_2d_lift_soften().
Definition at line 959 of file paint_image_2d.c.
References copy_v4_v4(), ImBuf::rect, ImBuf::rect_float, straight_uchar_to_premul_float(), x, ImBuf::x, and y.
Referenced by paint_2d_ibuf_add_if(), and paint_2d_lift_soften().
|
static |
Definition at line 970 of file paint_image_2d.c.
References mul_v3_v3fl(), premul_float_to_straight_uchar(), ImBuf::rect, ImBuf::rect_float, x, ImBuf::x, y, and ImBuf::y.
Referenced by paint_2d_lift_soften().
|
static |
Definition at line 1003 of file paint_image_2d.c.
References PAINT_TILE_X, PAINT_TILE_Y, x, ImBuf::x, y, and ImBuf::y.
Referenced by paint_2d_ibuf_add_if(), and paint_2d_lift_soften().
Definition at line 1249 of file paint_image_2d.c.
References ImBuf::flags, IMB_allocImBuf(), IMB_BLEND_COPY_ALPHA, IMB_BLEND_COPY_RGB, IMB_rectblend(), IMB_rectclip(), NULL, ImBuf::planes, pos, w(), ImBuf::x, and ImBuf::y.
Referenced by paint_2d_op().
Definition at line 1220 of file paint_image_2d.c.
References Freestyle::a, height, IMB_BLEND_COPY, IMB_rectblend(), NULL, paint_2d_set_region(), paint_2d_torus_split_region(), pos, width, ImBuf::x, and ImBuf::y.
Referenced by paint_2d_op().
|
static |
Definition at line 1042 of file paint_image_2d.c.
References alpha, BKE_brush_alpha_get(), blend_color_add_float(), ImagePaintState::blurkernel, ImagePaintState::brush, BRUSH_DIR_IN, ImagePaintTile::cache, copy_v4_v4(), count, fabsf, Brush::flag, IMB_colormanagement_get_luminance(), IMB_rectclip(), BrushPainterCache::invert, mask(), mul_v4_fl(), paint_2d_ibuf_add_if(), paint_2d_ibuf_rgb_get(), paint_2d_ibuf_rgb_set(), paint_2d_ibuf_tile_convert(), BlurKernel::pixel_len, pos, ImagePaintState::scene, Brush::sharp_threshold, BlurKernel::side, sub_v2_v2v2_int(), sub_v3_v3v3(), BlurKernel::wdata, x, ImBuf::x, y, ImBuf::y, and zero_v4().
Referenced by paint_2d_op().
| void* paint_2d_new_stroke | ( | bContext * | C, |
| wmOperator * | op, | ||
| int | mode | ||
| ) |
Definition at line 1658 of file paint_image_2d.c.
References BKE_image_acquire_ibuf(), BKE_image_has_packedfile(), BKE_image_release_ibuf(), BKE_paint_brush(), BKE_report(), ImagePaintState::blend, Brush::blend, BLI_listbase_count(), ImagePaintState::blurkernel, ImagePaintState::brush, brush_painter_2d_new(), BRUSH_STROKE_INVERT, C, ImagePaintTile::canvas, ImBuf::channels, CTX_data_scene(), CTX_wm_region(), CTX_wm_space_image(), ListBase::first, ImagePaintState::image, SpaceImage::image, Brush::imagepaint_tool, ToolSettings::imapaint, ImagePaintTile::iuser, SpaceImage::iuser, MEM_callocN, MEM_freeN, NULL, ImagePaintState::num_tiles, ImageUser::ok, ImagePaintSettings::paint, PAINT2D_TILE_READY, paint_2d_canvas_set(), paint_brush_init_tex(), paint_new_blur_kernel(), PAINT_TOOL_SOFTEN, ImagePaintState::painter, ImagePaintTile::radius_fac, wmOperator::reports, RPT_WARNING, Image::rr, scene, ImagePaintState::scene, ImagePaintState::sima, ImagePaintTile::size, ImagePaintTile::state, ImagePaintState::symmetry, Paint::symmetry_flags, ImageUser::tile, ImagePaintState::tiles, Image::tiles, ImagePaintState::tool, Scene::toolsettings, ImagePaintTile::uv_origin, ImagePaintState::v2d, ARegion::v2d, ImBuf::x, ImBuf::y, and zero_v2().
Referenced by texture_paint_init().
|
static |
Definition at line 1382 of file paint_image_2d.c.
References Freestyle::a, BKE_brush_alpha_get(), ImagePaintState::blend, blend(), BLI_parallel_range_settings_defaults(), BLI_task_parallel_range(), ImagePaintState::brush, ImagePaintTile::cache, ImagePaintTile::canvas, Brush::clone, ImagePaintState::clonecanvas, BrushPainterCache::curve_mask, data, ImagePaintRegion::destx, ImagePaintRegion::desty, ImagePaintState::do_masking, ED_imapaint_dirty_region(), ImagePaintRegion::height, height, BrushPainterCache::ibuf, ImagePaintState::image, imapaint_region_tiles(), IMB_BLEND_INTERPOLATE, IMB_freeImBuf(), IMB_rectblend_threaded(), ImagePaintTile::iuser, NULL, BrushClone::offset, paint_2d_convert_brushco(), paint_2d_do_making_brush(), paint_2d_lift_clone(), paint_2d_lift_smear(), paint_2d_lift_soften(), paint_2d_op_foreach_do(), paint_2d_set_region(), paint_2d_torus_split_region(), PAINT_TILE_X, PAINT_TILE_Y, PAINT_TOOL_CLONE, PAINT_TOOL_SMEAR, PAINT_TOOL_SOFTEN, pos, ImagePaintState::scene, ImagePaintRegion::srcx, ImagePaintRegion::srcy, state, ImagePaintState::symmetry, BrushPainterCache::tex_mask, ImagePaintState::tool, ImagePaintRegion::width, width, ImBuf::x, and ImBuf::y.
Referenced by paint_2d_stroke().
|
static |
Definition at line 1365 of file paint_image_2d.c.
References data, and paint_2d_do_making_brush().
Referenced by paint_2d_op().
| void paint_2d_redraw | ( | const bContext * | C, |
| void * | ps, | ||
| bool | final | ||
| ) |
Definition at line 1747 of file paint_image_2d.c.
References BKE_image_acquire_ibuf(), BKE_image_free_gputextures(), BKE_image_release_ibuf(), C, CTX_wm_region(), DEG_id_tag_update(), ED_imapaint_clear_partial_redraw(), ED_region_tag_redraw(), Image::id, ImagePaintState::image, imapaint_image_update(), ImagePaintTile::iuser, SpaceImage::lock, NA_EDITED, NA_PAINTING, NC_IMAGE, ImagePaintTile::need_redraw, NULL, ImagePaintState::num_tiles, ImagePaintState::sima, ImagePaintState::tiles, and WM_event_add_notifier().
Referenced by paint_stroke_redraw().
|
static |
Definition at line 1144 of file paint_image_2d.c.
References ImagePaintRegion::destx, ImagePaintRegion::desty, ImagePaintRegion::height, height, ImagePaintRegion::srcx, ImagePaintRegion::srcy, ImagePaintRegion::width, and width.
Referenced by paint_2d_lift_smear(), paint_2d_op(), and paint_2d_torus_split_region().
| void paint_2d_stroke | ( | void * | ps, |
| const float | prev_mval[2], | ||
| const float | mval[2], | ||
| const bool | eraser, | ||
| float | pressure, | ||
| float | distance, | ||
| float | base_size | ||
| ) |
Definition at line 1568 of file paint_image_2d.c.
References ImagePaintState::blend, Brush::blend, BrushPainter::brush, ImagePaintState::brush, brush_painter_2d_refresh_cache(), brush_painter_2d_require_imbuf(), BrushPainter::cache_invert, ImagePaintTile::canvas, ImBuf::colormanage_flag, copy_v2_v2(), distance(), BrushPainter::firsttouch, IMB_BLEND_ERASE_ALPHA, IMB_COLORMANAGE_IS_DATA, is_inside_tile(), ImagePaintTile::last_paintpos, ImagePaintTile::need_redraw, NULL, ImagePaintState::num_tiles, paint_2d_ensure_tile_canvas(), paint_2d_op(), paint_2d_uv_to_coord(), PAINT_TILE_X, PAINT_TILE_Y, ImagePaintState::painter, ImagePaintTile::radius_fac, ImBuf::rect_float, size(), ImagePaintTile::size, ImagePaintTile::start_paintpos, sub_v2_v2v2(), ImagePaintState::symmetry, ImagePaintState::tiles, UI_view2d_region_to_view(), ImagePaintTile::uv_origin, and ImagePaintState::v2d.
Referenced by paint_stroke_update_step().
| void paint_2d_stroke_done | ( | void * | ps | ) |
Definition at line 1786 of file paint_image_2d.c.
References ImagePaintState::brush, brush_painter_cache_2d_free(), ImagePaintTile::cache, MEM_freeN, ImagePaintState::num_tiles, paint_2d_canvas_free(), paint_brush_exit_tex(), ImagePaintState::painter, and ImagePaintState::tiles.
Referenced by paint_stroke_done().
|
static |
Definition at line 1155 of file paint_image_2d.c.
References ImagePaintRegion::destx, ImagePaintRegion::desty, ImagePaintRegion::height, height, IMB_rectclip(), paint_2d_set_region(), PAINT_TILE_X, PAINT_TILE_Y, ImagePaintRegion::srcx, ImagePaintRegion::srcy, w(), ImagePaintRegion::width, width, ImBuf::x, and ImBuf::y.
Referenced by paint_2d_lift_smear(), and paint_2d_op().
Definition at line 1551 of file paint_image_2d.c.
References UI_view2d_region_to_view().
Referenced by paint_2d_bucket_fill(), and paint_2d_gradient_fill().
|
static |
Definition at line 1562 of file paint_image_2d.c.
References ImagePaintTile::size, and ImagePaintTile::uv_origin.
Referenced by paint_2d_stroke().