|
Blender V5.0
|
#include <algorithm>#include <cstring>#include "MEM_guardedalloc.h"#include "DNA_brush_types.h"#include "DNA_scene_types.h"#include "DNA_space_types.h"#include "BLI_bitmap.h"#include "BLI_listbase.h"#include "BLI_math_color.h"#include "BLI_math_color_blend.h"#include "BLI_stack.h"#include "BLI_task.h"#include "BKE_brush.hh"#include "BKE_colorband.hh"#include "BKE_context.hh"#include "BKE_image.hh"#include "BKE_paint.hh"#include "BKE_paint_types.hh"#include "BKE_report.hh"#include "DEG_depsgraph.hh"#include "ED_paint.hh"#include "ED_screen.hh"#include "IMB_colormanagement.hh"#include "IMB_imbuf.hh"#include "IMB_imbuf_types.hh"#include "WM_api.hh"#include "WM_types.hh"#include "UI_view2d.hh"#include "paint_intern.hh"Go to the source code of this file.
Classes | |
| struct | BrushPainterCache |
| struct | BrushPainter |
| struct | ImagePaintRegion |
| struct | ImagePaintTile |
| struct | ImagePaintState |
| struct | Paint2DForeachData |
Enumerations | |
| enum | ImagePaintTileState { PAINT2D_TILE_UNINITIALIZED = 0 , PAINT2D_TILE_MISSING , PAINT2D_TILE_READY } |
Functions | |
| static BrushPainter * | brush_painter_2d_new (Scene *scene, const Paint *paint, Brush *brush, bool invert) |
| static void | brush_painter_2d_require_imbuf (Brush *brush, ImagePaintTile *tile, bool is_float, bool is_data, bool is_srgb, const ColorSpace *byte_colorspace, bool invert) |
| static void | brush_painter_cache_2d_free (BrushPainterCache *cache) |
| static void | brush_imbuf_tex_co (const 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 *r_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) |
| 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, const Paint *paint) |
| 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) |
| enum ImagePaintTileState |
| Enumerator | |
|---|---|
| PAINT2D_TILE_UNINITIALIZED | |
| PAINT2D_TILE_MISSING | |
| PAINT2D_TILE_READY | |
Definition at line 104 of file paint_image_2d.cc.
Definition at line 220 of file paint_image_2d.cc.
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 147 of file paint_image_2d.cc.
References BKE_brush_color_jitter_get_settings(), BrushPainter::brush, BrushPainter::cache_invert, BrushPainter::firsttouch, BrushPainter::initial_hsv_jitter, invert(), BrushPainter::paint, BrushPainter::scene, and seed_hsv_jitter().
Referenced by paint_2d_new_stroke().
|
static |
Definition at line 716 of file paint_image_2d.cc.
References BKE_brush_color_jitter_get_settings(), 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(), blender::bke::PaintRuntime::brush_rotation, blender::bke::PaintRuntime::brush_rotation_sec, BRUSH_USE_GRADIENT, BrushPainterCache::curve_mask_cache, 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, MEM_SAFE_FREE, Brush::mtex, MTEX_MAP_MODE_RANDOM, MTEX_MAP_MODE_VIEW, BrushPainter::paint, paint_curve_mask_cache_update(), BrushPainter::pool, pos, MTex::rot, Paint::runtime, size(), BrushPainter::tex_mapping, BrushPainterCache::tex_mask, and tile.
Referenced by paint_2d_stroke().
|
static |
Definition at line 166 of file paint_image_2d.cc.
References BrushPainterCache::byte_colorspace, BrushPainterCache::ibuf, Brush::image_brush_type, IMAGE_PAINT_BRUSH_TYPE_DRAW, IMB_freeImBuf(), BrushPainterCache::invert, invert(), BrushPainterCache::is_data, BrushPainterCache::is_float, BrushPainterCache::is_maskbrush, BrushPainterCache::is_srgb, BrushPainterCache::is_texbrush, BrushPainterCache::lastdiameter, Brush::mask_mtex, MEM_freeN(), Brush::mtex, MTex::tex, BrushPainterCache::tex_mask, BrushPainterCache::tex_mask_old, and tile.
Referenced by paint_2d_stroke().
|
static |
Definition at line 663 of file paint_image_2d.cc.
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, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by brush_painter_2d_refresh_cache().
|
static |
Definition at line 203 of file paint_image_2d.cc.
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 389 of file paint_image_2d.cc.
References BKE_brush_sample_tex_3d(), BrushPainter::brush, brush_imbuf_tex_co(), ImBuf::byte_buffer, BrushPainterCache::byte_colorspace, copy_v3_v3(), ImBufByteBuffer::data, ImBufFloatBuffer::data, distance(), ImBuf::float_buffer, IB_byte_data, IB_float_data, Brush::image_brush_type, IMAGE_PAINT_BRUSH_TYPE_DRAW, IMB_allocImBuf(), IMB_colormanagement_scene_linear_to_colorspace_v3(), IMB_colormanagement_scene_linear_to_srgb_v3(), BrushPainter::initial_hsv_jitter, BrushPainterCache::invert, BrushPainterCache::is_float, BrushPainterCache::is_srgb, BrushPainterCache::is_texbrush, Brush::mtex, mul_v3_v3(), mul_v3_v3fl(), BrushPainter::paint, paint_brush_color_get(), BrushPainter::pool, rgb_float_to_uchar(), size(), BrushPainter::tex_mapping, tile, unit_float_to_uchar_clamp(), x, and y.
Referenced by brush_painter_2d_refresh_cache().
|
static |
Definition at line 599 of file paint_image_2d.cc.
References brush_painter_imbuf_update(), floorf, IB_byte_data, IB_float_data, BrushPainterCache::ibuf, IMB_allocImBuf(), IMB_freeImBuf(), IMB_rectclip(), BrushPainterCache::is_float, min_ii(), pos, BrushPainterCache::texibuf, tile, w(), ImBuf::x, x, ImBuf::y, and y.
Referenced by brush_painter_2d_refresh_cache().
|
static |
Definition at line 470 of file paint_image_2d.cc.
References b, BKE_brush_sample_tex_3d(), BrushPainter::brush, brush_imbuf_tex_co(), ImBuf::byte_buffer, BrushPainterCache::byte_colorspace, copy_v3_v3(), copy_v4_v4(), ImBufByteBuffer::data, ImBufFloatBuffer::data, ImBuf::float_buffer, BrushPainterCache::ibuf, Brush::image_brush_type, IMAGE_PAINT_BRUSH_TYPE_DRAW, IMB_colormanagement_scene_linear_to_colorspace_v3(), IMB_colormanagement_scene_linear_to_srgb_v3(), BrushPainter::initial_hsv_jitter, BrushPainterCache::invert, BrushPainterCache::is_float, BrushPainterCache::is_srgb, BrushPainterCache::is_texbrush, Brush::mtex, mul_v3_v3(), mul_v3_v3fl(), ot, BrushPainter::paint, paint_brush_color_get(), BrushPainter::pool, rgba_float_to_uchar(), BrushPainter::tex_mapping, BrushPainterCache::texibuf, tile, w(), ImBuf::x, x, and y.
Referenced by brush_painter_imbuf_partial_update().
|
static |
Definition at line 228 of file paint_image_2d.cc.
References BKE_brush_sample_masktex(), BrushPainter::brush, brush_imbuf_tex_co(), mask(), BrushPainter::mask_mapping, MEM_malloc_arrayN(), BrushPainter::paint, BrushPainter::pool, 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 312 of file paint_image_2d.cc.
References brush_painter_mask_imbuf_update(), floorf, IMB_rectclip(), MEM_freeN(), MEM_malloc_arrayN(), min_ii(), pos, BrushPainterCache::tex_mask, BrushPainterCache::tex_mask_old, BrushPainterCache::tex_mask_old_h, BrushPainterCache::tex_mask_old_w, tile, w(), ImBuf::x, and ImBuf::y.
Referenced by brush_painter_2d_refresh_cache().
|
static |
Definition at line 254 of file paint_image_2d.cc.
References b, BKE_brush_sample_masktex(), BrushPainter::brush, brush_imbuf_tex_co(), BrushPainter::mask_mapping, BrushPainter::paint, BrushPainter::pool, 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 1493 of file paint_image_2d.cc.
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 ) |
This function expects sRGB space color values.
Definition at line 1823 of file paint_image_2d.cc.
References BKE_brush_alpha_get(), BKE_image_acquire_ibuf(), BKE_image_get_tile_from_pos(), BKE_image_release_ibuf(), BKE_imageuser_default(), BKE_paint_get_active_from_context(), 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(), ImBuf::byte_buffer, C, ImBufByteBuffer::colorspace, copy_v3_v3(), copy_v4_v4(), CTX_wm_region(), CTX_wm_space_image(), ImBufByteBuffer::data, ImBufFloatBuffer::data, ED_imapaint_clear_partial_redraw(), ED_imapaint_dirty_region(), Brush::fill_threshold, ImBuf::float_buffer, SpaceImage::image, image_init(), imapaint_image_update(), IMB_blend_color_byte(), IMB_blend_color_float(), IMB_colormanagement_scene_linear_to_colorspace_v3(), MEM_freeN(), NA_EDITED, NC_IMAGE, paint_2d_fill_add_pixel_byte(), paint_2d_fill_add_pixel_float(), paint_2d_get_tile_iuser(), paint_2d_transform_mouse(), rgb_float_to_uchar(), rgba_uchar_to_float(), straight_to_premul_v4(), ImageUser::tile, ARegion::v2d, ImagePaintState::v2d, 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 1474 of file paint_image_2d.cc.
References BKE_image_release_ibuf(), ImagePaintState::blurkernel, ImagePaintTile::canvas, ImagePaintSettings::clone, ImagePaintState::clonecanvas, i, ImagePaintState::image, ToolSettings::imapaint, ImagePaintState::num_tiles, paint_delete_blur_kernel(), ImagePaintState::scene, ImagePaintState::tiles, and Scene::toolsettings.
Referenced by paint_2d_stroke_done().
|
static |
Definition at line 1444 of file paint_image_2d.cc.
References BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), ImagePaintState::brush, ImagePaintState::brush_type, ImBuf::byte_buffer, ImagePaintTile::canvas, ImagePaintSettings::clone, ImagePaintState::clonecanvas, ImBufByteBuffer::data, ImBufFloatBuffer::data, ImagePaintState::do_masking, ImBuf::float_buffer, IMAGE_PAINT_BRUSH_TYPE_CLONE, ToolSettings::imapaint, IMB_byte_from_float(), IMB_float_from_byte(), paint_use_opacity_masking(), ImagePaintState::scene, ImagePaintState::tiles, and Scene::toolsettings.
Referenced by paint_2d_new_stroke().
Definition at line 1223 of file paint_image_2d.cc.
References floorf, pos, ImBuf::x, and ImBuf::y.
Referenced by paint_2d_op().
|
static |
Definition at line 1229 of file paint_image_2d.cc.
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, IB_DO_NOT_TAKE_OWNERSHIP, ImagePaintState::image, IMB_assign_byte_buffer(), IMB_assign_float_buffer(), IMB_initImBuf(), IMB_rectblend(), mask(), ImagePaintRegion::srcx, ImagePaintRegion::srcy, tile, and ImagePaintRegion::width.
Referenced by paint_2d_op(), and paint_2d_op_foreach_do().
|
static |
Definition at line 837 of file paint_image_2d.cc.
References BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), ImBuf::byte_buffer, ImagePaintTile::cache, ImagePaintTile::canvas, ImBuf::channels, ImBufByteBuffer::data, ImBufFloatBuffer::data, ImBuf::float_buffer, i, ImagePaintState::image, ImagePaintTile::iuser, BrushPainterCache::lastdiameter, ImagePaintState::num_tiles, PAINT2D_TILE_MISSING, PAINT2D_TILE_READY, ImagePaintTile::radius_fac, 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 1754 of file paint_image_2d.cc.
References BLI_BITMAP_SET, BLI_BITMAP_TEST, BLI_stack_push(), ImBuf::byte_buffer, ImBufByteBuffer::data, len_squared_v4v4(), rgba_uchar_to_float(), straight_to_premul_v4(), ImBuf::x, and ImBuf::y.
Referenced by paint_2d_bucket_fill().
|
static |
Definition at line 1783 of file paint_image_2d.cc.
References BLI_BITMAP_SET, BLI_BITMAP_TEST, BLI_stack_push(), ImBufFloatBuffer::data, ImBuf::float_buffer, len_squared_v4v4(), ImBuf::x, and ImBuf::y.
Referenced by paint_2d_bucket_fill().
|
static |
Definition at line 1807 of file paint_image_2d.cc.
References i, ImagePaintTile::iuser, 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 2025 of file paint_image_2d.cc.
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, ImBuf::byte_buffer, C, ImBufByteBuffer::colorspace, CTX_wm_space_image(), ImBufByteBuffer::data, ImBufFloatBuffer::data, dot_v2v2(), ED_imapaint_clear_partial_redraw(), ED_imapaint_dirty_region(), ImBuf::float_buffer, Brush::gradient, Brush::gradient_fill_mode, SpaceImage::image, image_init(), imapaint_image_update(), IMB_blend_color_byte(), IMB_blend_color_float(), IMB_colormanagement_scene_linear_to_colorspace_v3(), len_squared_v2(), len_v2(), mul_v3_fl(), NA_EDITED, NC_IMAGE, ImagePaintState::paint, paint_2d_get_tile_iuser(), paint_2d_transform_mouse(), rgba_float_to_uchar(), 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 947 of file paint_image_2d.cc.
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 887 of file paint_image_2d.cc.
References ImBuf::byte_buffer, copy_v4_v4(), ImBufByteBuffer::data, ImBufFloatBuffer::data, ImBuf::float_buffer, straight_uchar_to_premul_float(), ImBuf::x, x, and y.
Referenced by paint_2d_ibuf_add_if(), and paint_2d_lift_soften().
|
static |
Definition at line 898 of file paint_image_2d.cc.
References ImBuf::byte_buffer, ImBufByteBuffer::data, ImBufFloatBuffer::data, ImBuf::float_buffer, mul_v3_v3fl(), premul_float_to_straight_uchar(), ImBuf::x, x, ImBuf::y, and y.
Referenced by paint_2d_lift_soften().
|
static |
Definition at line 931 of file paint_image_2d.cc.
References PAINT_TILE_X, PAINT_TILE_Y, ImBuf::x, x, ImBuf::y, and y.
Referenced by paint_2d_ibuf_add_if(), and paint_2d_lift_soften().
Definition at line 1177 of file paint_image_2d.cc.
References ImBuf::flags, IMB_allocImBuf(), IMB_BLEND_COPY_ALPHA, IMB_BLEND_COPY_RGB, IMB_rectblend(), IMB_rectclip(), ImBuf::planes, pos, w(), ImBuf::x, and ImBuf::y.
Referenced by paint_2d_op().
Definition at line 1148 of file paint_image_2d.cc.
References IMB_BLEND_COPY, IMB_rectblend(), paint_2d_set_region(), paint_2d_torus_split_region(), pos, ImBuf::x, and ImBuf::y.
Referenced by paint_2d_op().
|
static |
Definition at line 970 of file paint_image_2d.cc.
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(), mask(), mul_v4_fl(), ImagePaintState::paint, paint_2d_ibuf_add_if(), paint_2d_ibuf_rgb_get(), paint_2d_ibuf_rgb_set(), paint_2d_ibuf_tile_convert(), BlurKernel::pixel_len, pos, Brush::sharp_threshold, BlurKernel::side, sub_v2_v2v2_int(), sub_v3_v3v3(), tile, BlurKernel::wdata, ImBuf::x, x, ImBuf::y, y, and zero_v4().
Referenced by paint_2d_op().
| void * paint_2d_new_stroke | ( | bContext * | C, |
| wmOperator * | op, | ||
| int | mode ) |
Definition at line 1608 of file paint_image_2d.cc.
References BKE_image_acquire_ibuf(), BKE_image_has_packedfile(), BKE_image_release_ibuf(), BKE_paint_brush(), BKE_paint_get_active_from_context(), BKE_report(), Brush::blend, ImagePaintState::blend, BLI_listbase_count(), ImagePaintState::blurkernel, ImagePaintState::brush, brush_painter_2d_new(), BRUSH_STROKE_INVERT, ImagePaintState::brush_type, C, ImagePaintTile::canvas, ImBuf::channels, CTX_data_scene(), CTX_wm_region(), CTX_wm_space_image(), ListBase::first, i, ImagePaintState::image, SpaceImage::image, Brush::image_brush_type, IMAGE_PAINT_BRUSH_TYPE_SOFTEN, ToolSettings::imapaint, ImagePaintTile::iuser, SpaceImage::iuser, MEM_calloc_arrayN(), MEM_callocN(), MEM_freeN(), ImagePaintState::num_tiles, ImagePaintSettings::paint, ImagePaintState::paint, PAINT2D_TILE_READY, paint_2d_canvas_set(), paint_brush_init_tex(), paint_new_blur_kernel(), ImagePaintState::painter, ImagePaintTile::radius_fac, wmOperator::reports, RPT_WARNING, Image::rr, ImagePaintState::scene, ImagePaintState::sima, ImagePaintTile::size, ImagePaintTile::state, ImagePaintState::symmetry, Paint::symmetry_flags, ImageUser::tile, tile, Image::tiles, ImagePaintState::tiles, Scene::toolsettings, ImagePaintTile::uv_origin, ARegion::v2d, ImagePaintState::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 1316 of file paint_image_2d.cc.
References BKE_brush_alpha_get(), blend(), ImagePaintState::blend, BLI_parallel_range_settings_defaults(), BLI_task_parallel_range(), ImagePaintState::brush, ImagePaintState::brush_type, ImagePaintSettings::clone_offset, ImagePaintState::clonecanvas, data, ImagePaintRegion::destx, ImagePaintRegion::desty, ImagePaintState::do_masking, ED_imapaint_dirty_region(), ImagePaintRegion::height, ImagePaintState::image, IMAGE_PAINT_BRUSH_TYPE_CLONE, IMAGE_PAINT_BRUSH_TYPE_SMEAR, IMAGE_PAINT_BRUSH_TYPE_SOFTEN, ToolSettings::imapaint, imapaint_region_tiles(), IMB_BLEND_INTERPOLATE, IMB_freeImBuf(), IMB_rectblend_threaded(), ImagePaintState::paint, 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, pos, ImagePaintState::scene, ImagePaintRegion::srcx, ImagePaintRegion::srcy, state, ImagePaintState::symmetry, tile, Scene::toolsettings, ImagePaintRegion::width, ImBuf::x, and ImBuf::y.
Referenced by paint_2d_stroke().
|
static |
Definition at line 1299 of file paint_image_2d.cc.
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 1700 of file paint_image_2d.cc.
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(), i, Image::id, ImagePaintState::image, imapaint_image_update(), ImagePaintTile::iuser, SpaceImage::lock, NA_EDITED, NA_PAINTING, NC_IMAGE, ImagePaintTile::need_redraw, 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 1072 of file paint_image_2d.cc.
References ImagePaintRegion::destx, ImagePaintRegion::desty, ImagePaintRegion::height, ImagePaintRegion::srcx, ImagePaintRegion::srcy, and ImagePaintRegion::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 1505 of file paint_image_2d.cc.
References Brush::blend, ImagePaintState::blend, BrushPainter::brush, ImagePaintState::brush, brush_painter_2d_refresh_cache(), brush_painter_2d_require_imbuf(), ImBuf::byte_buffer, BrushPainter::cache_invert, ImBuf::colormanage_flag, ImBufByteBuffer::colorspace, copy_v2_v2(), ImBufFloatBuffer::data, distance(), BrushPainter::firsttouch, ImBuf::float_buffer, FLT_MAX, i, IMB_BLEND_ERASE_ALPHA, IMB_COLORMANAGE_IS_DATA, IMB_colormanagement_space_is_srgb(), is_inside_tile(), 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::size, 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().
| void paint_2d_stroke_done | ( | void * | ps | ) |
Definition at line 1739 of file paint_image_2d.cc.
References ImagePaintState::brush, brush_painter_cache_2d_free(), ImagePaintTile::cache, i, 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 1083 of file paint_image_2d.cc.
References ImagePaintRegion::destx, ImagePaintRegion::desty, ImagePaintRegion::height, IMB_rectclip(), paint_2d_set_region(), PAINT_TILE_X, PAINT_TILE_Y, ImagePaintRegion::srcx, ImagePaintRegion::srcy, w(), ImagePaintRegion::width, ImBuf::x, and ImBuf::y.
Referenced by paint_2d_lift_smear(), and paint_2d_op().
Definition at line 1488 of file paint_image_2d.cc.
References in, out, and UI_view2d_region_to_view().
Referenced by paint_2d_bucket_fill(), and paint_2d_gradient_fill().
|
static |
Definition at line 1499 of file paint_image_2d.cc.
References tile.
Referenced by paint_2d_stroke().