Blender
V3.3
|
#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 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, ImagePaintTile *tile, const int diameter, 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 94 of file paint_image_2d.c.
Definition at line 193 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 136 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 676 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_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, BrushPainterCache::curve_mask_cache, blender::math::distance(), ELEM, Brush::flag, floorf, Brush::gradient_stroke_mode, BrushPainterCache::ibuf, IMB_freeImBuf(), BrushPainterCache::is_maskbrush, BrushPainterCache::is_texbrush, BrushPainterCache::last_mask_rotation, BrushPainterCache::last_pressure, BrushPainterCache::last_tex_rotation, BrushPainterCache::lastdiameter, BrushPainter::mask_mapping, Brush::mask_mtex, Brush::mask_pressure, MAX2, MEM_SAFE_FREE, Brush::mtex, MTEX_MAP_MODE_RANDOM, MTEX_MAP_MODE_VIEW, NULL, paint_curve_mask_cache_update(), BrushPainter::pool, pos, MTex::rot, scene, BrushPainter::scene, size(), BrushPainter::tex_mapping, BrushPainterCache::tex_mask, tile, Scene::toolsettings, and ToolSettings::unified_paint_settings.
Referenced by paint_2d_stroke().
|
static |
Definition at line 148 of file paint_image_2d.c.
References 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, tile, BrushPainterCache::use_color_correction, and BrushPainterCache::use_float.
Referenced by paint_2d_stroke().
|
static |
Definition at line 623 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, tile, UI_view2d_view_to_region_fl(), ImagePaintState::v2d, KernelWorkTile::x, rctf::xmax, rctf::xmin, KernelWorkTile::y, rctf::ymax, and rctf::ymin.
Referenced by brush_painter_2d_refresh_cache().
|
static |
Definition at line 176 of file paint_image_2d.c.
References BrushPainterCache::curve_mask_cache, BrushPainterCache::ibuf, IMB_freeImBuf(), MEM_freeN, paint_curve_mask_cache_free_data(), BrushPainterCache::tex_mask, BrushPainterCache::tex_mask_old, and BrushPainterCache::texibuf.
Referenced by paint_2d_stroke_done().
|
static |
Definition at line 363 of file paint_image_2d.c.
References BKE_brush_sample_tex_3d(), BrushPainter::brush, brush_imbuf_tex_co(), copy_v3_v3(), ColorManagedDisplaySettings::display_device, Scene::display_settings, blender::math::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(), usdtokens::rgba(), scene, BrushPainter::scene, size(), BrushPainter::tex_mapping, tile, 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 559 of file paint_image_2d.c.
References brush_painter_imbuf_update(), floorf, IB_rect, IB_rectfloat, BrushPainterCache::ibuf, IMB_allocImBuf(), IMB_freeImBuf(), IMB_rectclip(), min_ii(), NULL, pos, BrushPainterCache::texibuf, tile, BrushPainterCache::use_float, w(), x, ImBuf::x, x2, y, ImBuf::y, and y1.
Referenced by brush_painter_2d_refresh_cache().
|
static |
Definition at line 437 of file paint_image_2d.c.
References usdtokens::b(), BKE_brush_sample_tex_3d(), BrushPainter::brush, brush_imbuf_tex_co(), 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, usdtokens::rgba(), rgba_float_to_uchar(), scene, BrushPainter::scene, t, BrushPainter::tex_mapping, BrushPainterCache::texibuf, tile, BrushPainterCache::use_color_correction, BrushPainterCache::use_float, w(), x, ImBuf::x, and y.
Referenced by brush_painter_imbuf_partial_update().
|
static |
Definition at line 201 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 286 of file paint_image_2d.c.
References brush_painter_mask_imbuf_update(), floorf, IMB_rectclip(), 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, tile, w(), ImBuf::x, x2, ImBuf::y, and y1.
Referenced by brush_painter_2d_refresh_cache().
|
static |
Definition at line 228 of file paint_image_2d.c.
References usdtokens::b(), BKE_brush_sample_masktex(), BrushPainter::brush, brush_imbuf_tex_co(), 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, tile, w(), x, and y.
Referenced by brush_painter_mask_imbuf_partial_update().
Definition at line 1440 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 1753 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, color, 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 blender::ed::sculpt_paint::image::ops::paint::ImagePaintMode::paint_bucket_fill().
|
static |
Definition at line 1422 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 1393 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 1179 of file paint_image_2d.c.
References floorf, pos, ImBuf::x, and ImBuf::y.
Referenced by paint_2d_op().
|
static |
Definition at line 1185 of file paint_image_2d.c.
References blend(), ImagePaintState::brush, BRUSH_ACCUMULATE, ImagePaintRegion::destx, ImagePaintRegion::desty, ED_image_paint_tile_find(), ED_image_paint_tile_map_get(), ED_IMAGE_UNDO_TILE_SIZE, Brush::flag, ImagePaintRegion::height, ImagePaintState::image, IMB_initImBuf(), IMB_rectblend(), mask(), ImBuf::rect, ImBuf::rect_float, ImagePaintRegion::srcx, ImagePaintRegion::srcy, tile, and ImagePaintRegion::width.
Referenced by paint_2d_op(), and paint_2d_op_foreach_do().
|
static |
Definition at line 794 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, 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 1684 of file paint_image_2d.c.
References BLI_BITMAP_SET, BLI_BITMAP_TEST, BLI_stack_push(), color, 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 1713 of file paint_image_2d.c.
References BLI_BITMAP_SET, BLI_BITMAP_TEST, BLI_stack_push(), color, len_squared_v4v4(), ImBuf::rect_float, ImBuf::x, and ImBuf::y.
Referenced by paint_2d_bucket_fill().
|
static |
Definition at line 1737 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 1980 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 blender::ed::sculpt_paint::image::ops::paint::ImagePaintMode::paint_gradient_fill().
|
static |
Definition at line 903 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 843 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 854 of file paint_image_2d.c.
References mul_v3_v3fl(), premul_float_to_straight_uchar(), ImBuf::rect, ImBuf::rect_float, usdtokens::rgb(), x, ImBuf::x, y, and ImBuf::y.
Referenced by paint_2d_lift_soften().
Definition at line 887 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 1133 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 1104 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 926 of file paint_image_2d.c.
References BKE_brush_alpha_get(), blend_color_add_float(), ImagePaintState::blurkernel, ImagePaintState::brush, BRUSH_DIR_IN, copy_v4_v4(), count, fabsf, Brush::flag, IMB_colormanagement_get_luminance(), IMB_rectclip(), kernel, mask(), mul_v4_fl(), paint_2d_ibuf_add_if(), paint_2d_ibuf_rgb_get(), paint_2d_ibuf_rgb_set(), paint_2d_ibuf_tile_convert(), pos, usdtokens::rgba(), ImagePaintState::scene, Brush::sharp_threshold, sub_v2_v2v2_int(), sub_v3_v3v3(), threshold, tile, 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 1542 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, 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, tile, 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 blender::ed::sculpt_paint::image::ops::paint::ImagePaintMode::paint_new_stroke().
|
static |
Definition at line 1266 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, Brush::clone, ImagePaintState::clonecanvas, data, ImagePaintRegion::destx, ImagePaintRegion::desty, ImagePaintState::do_masking, ED_imapaint_dirty_region(), ImagePaintRegion::height, height, ImagePaintState::image, imapaint_region_tiles(), IMB_BLEND_INTERPOLATE, IMB_freeImBuf(), IMB_rectblend_threaded(), NULL, offset, 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, tile, ImagePaintState::tool, ImagePaintRegion::width, width, ImBuf::x, and ImBuf::y.
Referenced by paint_2d_stroke().
|
static |
Definition at line 1249 of file paint_image_2d.c.
References data, and paint_2d_do_making_brush().
Referenced by paint_2d_op().
Definition at line 1630 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 blender::ed::sculpt_paint::image::ops::paint::ImagePaintMode::paint_stroke_redraw().
|
static |
Definition at line 1028 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 1452 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(), blender::math::distance(), BrushPainter::firsttouch, IMB_BLEND_ERASE_ALPHA, IMB_COLORMANAGE_IS_DATA, is_inside_tile(), 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, ImBuf::rect_float, size(), ImagePaintTile::size, sub_v2_v2v2(), ImagePaintState::symmetry, tile, ImagePaintState::tiles, UI_view2d_region_to_view(), and ImagePaintState::v2d.
Referenced by blender::ed::sculpt_paint::image::ops::paint::ImagePaintMode::paint_stroke().
Definition at line 1669 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 blender::ed::sculpt_paint::image::ops::paint::ImagePaintMode::paint_stroke_done().
|
static |
Definition at line 1039 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 1435 of file paint_image_2d.c.
References usdtokens::out(), and UI_view2d_region_to_view().
Referenced by paint_2d_bucket_fill(), and paint_2d_gradient_fill().
|
static |