|
Blender V4.5
|
#include <algorithm>#include <cstring>#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.hh"#include "BKE_colorband.hh"#include "BKE_context.hh"#include "BKE_image.hh"#include "BKE_paint.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 use_float, bool use_color_correction, 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 101 of file paint_image_2d.cc.
|
static |
Definition at line 209 of file paint_image_2d.cc.
References brush_imbuf_tex_co(), x, rctf::xmax, rctf::xmin, y, rctf::ymax, and rctf::ymin.
Referenced by brush_imbuf_tex_co(), brush_painter_imbuf_new(), brush_painter_imbuf_update(), brush_painter_mask_ibuf_new(), and brush_painter_mask_imbuf_update().
|
static |
Definition at line 143 of file paint_image_2d.cc.
References BKE_brush_color_jitter_get_settings(), BrushPainter::brush, brush_painter_2d_new(), BrushPainter::cache_invert, BrushPainter::firsttouch, BrushPainter::initial_hsv_jitter, invert(), BrushPainter::paint, BrushPainter::scene, and seed_hsv_jitter().
Referenced by brush_painter_2d_new(), and paint_2d_new_stroke().
|
static |
Definition at line 712 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_refresh_cache(), 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, 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, MTex::rot, BrushPainter::scene, size(), BrushPainter::tex_mapping, BrushPainterCache::tex_mask, tile, Scene::toolsettings, and ToolSettings::unified_paint_settings.
Referenced by brush_painter_2d_refresh_cache(), and paint_2d_stroke().
|
static |
Definition at line 162 of file paint_image_2d.cc.
References brush_painter_2d_require_imbuf(), BrushPainterCache::ibuf, Brush::image_brush_type, IMAGE_PAINT_BRUSH_TYPE_DRAW, IMB_freeImBuf(), BrushPainterCache::invert, invert(), BrushPainterCache::is_maskbrush, BrushPainterCache::is_texbrush, BrushPainterCache::lastdiameter, Brush::mask_mtex, MEM_freeN(), Brush::mtex, MTex::tex, BrushPainterCache::tex_mask, BrushPainterCache::tex_mask_old, tile, BrushPainterCache::use_color_correction, and BrushPainterCache::use_float.
Referenced by brush_painter_2d_require_imbuf(), and paint_2d_stroke().
|
static |
Definition at line 659 of file paint_image_2d.cc.
References brush_painter_2d_tex_mapping(), ELEM, floorf, MTEX_MAP_MODE_3D, MTEX_MAP_MODE_RANDOM, MTEX_MAP_MODE_STENCIL, MTEX_MAP_MODE_VIEW, 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(), and brush_painter_2d_tex_mapping().
|
static |
Definition at line 192 of file paint_image_2d.cc.
References brush_painter_cache_2d_free(), 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 brush_painter_cache_2d_free(), and paint_2d_stroke_done().
|
static |
Definition at line 379 of file paint_image_2d.cc.
References BKE_brush_sample_tex_3d(), BrushPainter::brush, brush_imbuf_tex_co(), brush_painter_imbuf_new(), ImBuf::byte_buffer, copy_v3_v3(), ImBufByteBuffer::data, ImBufFloatBuffer::data, ColorManagedDisplaySettings::display_device, Scene::display_settings, distance(), ImBuf::float_buffer, IB_byte_data, IB_float_data, Brush::image_brush_type, IMAGE_PAINT_BRUSH_TYPE_DRAW, IMB_allocImBuf(), IMB_colormanagement_display_get_named(), IMB_colormanagement_scene_linear_to_display_v3(), BrushPainter::initial_hsv_jitter, BrushPainterCache::invert, BrushPainterCache::is_texbrush, Brush::mtex, mul_v3_v3(), mul_v3_v3fl(), BrushPainter::paint, paint_brush_color_get(), BrushPainter::pool, rgb_float_to_uchar(), 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(), and brush_painter_imbuf_new().
|
static |
Definition at line 595 of file paint_image_2d.cc.
References brush_painter_imbuf_partial_update(), brush_painter_imbuf_update(), floorf, IB_byte_data, IB_float_data, BrushPainterCache::ibuf, IMB_allocImBuf(), IMB_freeImBuf(), IMB_rectclip(), min_ii(), BrushPainterCache::texibuf, tile, BrushPainterCache::use_float, w(), ImBuf::x, x, ImBuf::y, and y.
Referenced by brush_painter_2d_refresh_cache(), and brush_painter_imbuf_partial_update().
|
static |
Definition at line 463 of file paint_image_2d.cc.
References b, BKE_brush_sample_tex_3d(), BrushPainter::brush, brush_imbuf_tex_co(), brush_painter_imbuf_update(), ImBuf::byte_buffer, copy_v3_v3(), copy_v4_v4(), ImBufByteBuffer::data, ImBufFloatBuffer::data, ColorManagedDisplaySettings::display_device, Scene::display_settings, ImBuf::float_buffer, BrushPainterCache::ibuf, Brush::image_brush_type, IMAGE_PAINT_BRUSH_TYPE_DRAW, IMB_colormanagement_display_get_named(), IMB_colormanagement_scene_linear_to_display_v3(), BrushPainter::initial_hsv_jitter, BrushPainterCache::invert, BrushPainterCache::is_texbrush, Brush::mtex, mul_v3_v3(), mul_v3_v3fl(), BrushPainter::paint, paint_brush_color_get(), BrushPainter::pool, rgba_float_to_uchar(), BrushPainter::scene, BrushPainter::tex_mapping, BrushPainterCache::texibuf, tile, BrushPainterCache::use_color_correction, BrushPainterCache::use_float, w(), ImBuf::x, x, and y.
Referenced by brush_painter_imbuf_partial_update(), and brush_painter_imbuf_update().
|
static |
Definition at line 217 of file paint_image_2d.cc.
References BKE_brush_sample_masktex(), BrushPainter::brush, brush_imbuf_tex_co(), brush_painter_mask_ibuf_new(), mask(), BrushPainter::mask_mapping, MEM_malloc_arrayN(), BrushPainter::pool, BrushPainter::scene, size(), x, and y.
Referenced by brush_painter_2d_refresh_cache(), and brush_painter_mask_ibuf_new().
|
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 302 of file paint_image_2d.cc.
References brush_painter_mask_imbuf_partial_update(), brush_painter_mask_imbuf_update(), floorf, IMB_rectclip(), MEM_freeN(), MEM_malloc_arrayN(), min_ii(), 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(), and brush_painter_mask_imbuf_partial_update().
|
static |
Definition at line 244 of file paint_image_2d.cc.
References b, BKE_brush_sample_masktex(), BrushPainter::brush, brush_imbuf_tex_co(), brush_painter_mask_imbuf_update(), BrushPainter::mask_mapping, BrushPainter::pool, BrushPainter::scene, 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(), and brush_painter_mask_imbuf_update().
|
static |
Definition at line 1490 of file paint_image_2d.cc.
References is_inside_tile(), and size().
Referenced by is_inside_tile(), and 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 1822 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(), 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, 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, imapaint_image_update(), IMB_blend_color_byte(), IMB_blend_color_float(), MEM_freeN(), NA_EDITED, NC_IMAGE, paint_2d_bucket_fill(), 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(), ImagePaintState::scene, srgb_to_linearrgb_v3_v3(), 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(), paint_2d_bucket_fill(), and blender::ed::sculpt_paint::image::ops::paint::ImagePaintMode::paint_bucket_fill().
|
static |
Definition at line 1471 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_2d_canvas_free(), paint_delete_blur_kernel(), ImagePaintState::scene, ImagePaintState::tiles, and Scene::toolsettings.
Referenced by paint_2d_canvas_free(), and paint_2d_stroke_done().
|
static |
Definition at line 1441 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_2d_canvas_set(), paint_use_opacity_masking(), ImagePaintState::scene, ImagePaintState::tiles, and Scene::toolsettings.
Referenced by paint_2d_canvas_set(), and paint_2d_new_stroke().
|
static |
Definition at line 1220 of file paint_image_2d.cc.
References floorf, paint_2d_convert_brushco(), ImBuf::x, and ImBuf::y.
Referenced by paint_2d_convert_brushco(), and paint_2d_op().
|
static |
Definition at line 1226 of file paint_image_2d.cc.
References 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(), paint_2d_do_making_brush(), ImagePaintRegion::srcx, ImagePaintRegion::srcy, tile, and ImagePaintRegion::width.
Referenced by paint_2d_do_making_brush(), paint_2d_op(), and paint_2d_op_foreach_do().
|
static |
Definition at line 834 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, paint_2d_ensure_tile_canvas(), ImagePaintTile::radius_fac, ImagePaintTile::size, sqrtf, ImagePaintTile::state, ImagePaintState::tiles, ImBuf::x, and ImBuf::y.
Referenced by paint_2d_ensure_tile_canvas(), paint_2d_get_tile_iuser(), and paint_2d_stroke().
|
static |
Definition at line 1753 of file paint_image_2d.cc.
References BLI_BITMAP_SET, BLI_BITMAP_TEST, BLI_stack_push(), ImBuf::byte_buffer, ImBufByteBuffer::data, len_squared_v4v4(), paint_2d_fill_add_pixel_byte(), rgba_uchar_to_float(), straight_to_premul_v4(), ImBuf::x, and ImBuf::y.
Referenced by paint_2d_bucket_fill(), and paint_2d_fill_add_pixel_byte().
|
static |
Definition at line 1782 of file paint_image_2d.cc.
References BLI_BITMAP_SET, BLI_BITMAP_TEST, BLI_stack_push(), ImBufFloatBuffer::data, ImBuf::float_buffer, len_squared_v4v4(), paint_2d_fill_add_pixel_float(), ImBuf::x, and ImBuf::y.
Referenced by paint_2d_bucket_fill(), and paint_2d_fill_add_pixel_float().
|
static |
Definition at line 1806 of file paint_image_2d.cc.
References i, ImagePaintTile::iuser, ImagePaintState::num_tiles, paint_2d_ensure_tile_canvas(), paint_2d_get_tile_iuser(), ImageUser::tile, and ImagePaintState::tiles.
Referenced by paint_2d_bucket_fill(), paint_2d_get_tile_iuser(), 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 2021 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, 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, 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, paint_2d_get_tile_iuser(), paint_2d_gradient_fill(), paint_2d_transform_mouse(), 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_2d_gradient_fill(), and blender::ed::sculpt_paint::image::ops::paint::ImagePaintMode::paint_gradient_fill().
|
static |
Definition at line 944 of file paint_image_2d.cc.
References add_v4_v4(), mul_v4_fl(), paint_2d_ibuf_add_if(), paint_2d_ibuf_rgb_get(), paint_2d_ibuf_tile_convert(), w(), x, and y.
Referenced by paint_2d_ibuf_add_if(), and paint_2d_lift_soften().
|
static |
Definition at line 884 of file paint_image_2d.cc.
References ImBuf::byte_buffer, copy_v4_v4(), ImBufByteBuffer::data, ImBufFloatBuffer::data, ImBuf::float_buffer, paint_2d_ibuf_rgb_get(), straight_uchar_to_premul_float(), ImBuf::x, x, and y.
Referenced by paint_2d_ibuf_add_if(), paint_2d_ibuf_rgb_get(), and paint_2d_lift_soften().
|
static |
Definition at line 895 of file paint_image_2d.cc.
References ImBuf::byte_buffer, ImBufByteBuffer::data, ImBufFloatBuffer::data, ImBuf::float_buffer, mul_v3_v3fl(), paint_2d_ibuf_rgb_set(), premul_float_to_straight_uchar(), ImBuf::x, x, ImBuf::y, and y.
Referenced by paint_2d_ibuf_rgb_set(), and paint_2d_lift_soften().
|
static |
Definition at line 928 of file paint_image_2d.cc.
References paint_2d_ibuf_tile_convert(), PAINT_TILE_X, PAINT_TILE_Y, ImBuf::x, x, ImBuf::y, and y.
Referenced by paint_2d_ibuf_add_if(), paint_2d_ibuf_tile_convert(), and paint_2d_lift_soften().
Definition at line 1174 of file paint_image_2d.cc.
References ImBuf::flags, IMB_allocImBuf(), IMB_BLEND_COPY_ALPHA, IMB_BLEND_COPY_RGB, IMB_rectblend(), IMB_rectclip(), paint_2d_lift_clone(), ImBuf::planes, w(), ImBuf::x, and ImBuf::y.
Referenced by paint_2d_lift_clone(), and paint_2d_op().
Definition at line 1145 of file paint_image_2d.cc.
References IMB_BLEND_COPY, IMB_rectblend(), paint_2d_lift_smear(), paint_2d_set_region(), paint_2d_torus_split_region(), ImBuf::x, and ImBuf::y.
Referenced by paint_2d_lift_smear(), and paint_2d_op().
|
static |
Definition at line 967 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(), fabsf, Brush::flag, IMB_colormanagement_get_luminance(), IMB_rectclip(), mask(), mul_v4_fl(), paint_2d_ibuf_add_if(), paint_2d_ibuf_rgb_get(), paint_2d_ibuf_rgb_set(), paint_2d_ibuf_tile_convert(), paint_2d_lift_soften(), BlurKernel::pixel_len, ImagePaintState::scene, 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_lift_soften(), and paint_2d_op().
| void * paint_2d_new_stroke | ( | bContext * | C, |
| wmOperator * | op, | ||
| int | mode ) |
Definition at line 1597 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, PAINT2D_TILE_READY, paint_2d_canvas_set(), paint_2d_new_stroke(), 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 paint_2d_new_stroke(), and blender::ed::sculpt_paint::image::ops::paint::ImagePaintMode::paint_new_stroke().
|
static |
Definition at line 1313 of file paint_image_2d.cc.
References BKE_brush_alpha_get(), 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(), paint_2d_convert_brushco(), paint_2d_do_making_brush(), paint_2d_lift_clone(), paint_2d_lift_smear(), paint_2d_lift_soften(), paint_2d_op(), paint_2d_op_foreach_do(), paint_2d_set_region(), paint_2d_torus_split_region(), PAINT_TILE_X, PAINT_TILE_Y, ImagePaintState::scene, ImagePaintRegion::srcx, ImagePaintRegion::srcy, state, ImagePaintState::symmetry, tile, Scene::toolsettings, ImagePaintRegion::width, ImBuf::x, and ImBuf::y.
Referenced by paint_2d_op(), and paint_2d_stroke().
|
static |
Definition at line 1296 of file paint_image_2d.cc.
References data, paint_2d_do_making_brush(), and paint_2d_op_foreach_do().
Referenced by paint_2d_op(), and paint_2d_op_foreach_do().
| void paint_2d_redraw | ( | const bContext * | C, |
| void * | ps, | ||
| bool | final ) |
Definition at line 1688 of file paint_image_2d.cc.
References BKE_image_acquire_ibuf(), BKE_image_free_gputextures(), BKE_image_release_ibuf(), C, CTX_data_active_object(), CTX_data_scene(), CTX_wm_region(), DEG_id_tag_update(), ED_imapaint_clear_partial_redraw(), ED_region_tag_redraw(), i, Image::id, Object::id, ID_RECALC_SHADING, ImagePaintState::image, IMAGEPAINT_MODE_IMAGE, ToolSettings::imapaint, imapaint_image_update(), ImagePaintTile::iuser, SpaceImage::lock, ImagePaintSettings::mode, NA_EDITED, NA_PAINTING, NC_IMAGE, ImagePaintTile::need_redraw, ImagePaintState::num_tiles, OB_MESH, paint_2d_redraw(), ImagePaintState::sima, ImagePaintState::tiles, Scene::toolsettings, Object::type, and WM_event_add_notifier().
Referenced by paint_2d_redraw(), and blender::ed::sculpt_paint::image::ops::paint::ImagePaintMode::paint_stroke_redraw().
|
static |
Definition at line 1069 of file paint_image_2d.cc.
References ImagePaintRegion::destx, ImagePaintRegion::desty, ImagePaintRegion::height, paint_2d_set_region(), ImagePaintRegion::srcx, ImagePaintRegion::srcy, and ImagePaintRegion::width.
Referenced by paint_2d_lift_smear(), paint_2d_op(), paint_2d_set_region(), 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 1502 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(), BrushPainter::cache_invert, ImagePaintTile::canvas, ImBuf::colormanage_flag, copy_v2_v2(), ImBufFloatBuffer::data, distance(), BrushPainter::firsttouch, ImBuf::float_buffer, FLT_MAX, i, IMB_BLEND_ERASE_ALPHA, IMB_COLORMANAGE_IS_DATA, is_inside_tile(), ImagePaintState::num_tiles, paint_2d_ensure_tile_canvas(), paint_2d_op(), paint_2d_stroke(), 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 paint_2d_stroke(), and blender::ed::sculpt_paint::image::ops::paint::ImagePaintMode::paint_stroke().
| void paint_2d_stroke_done | ( | void * | ps | ) |
Definition at line 1738 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_2d_stroke_done(), paint_brush_exit_tex(), ImagePaintState::painter, and ImagePaintState::tiles.
Referenced by paint_2d_stroke_done(), and blender::ed::sculpt_paint::image::ops::paint::ImagePaintMode::paint_stroke_done().
|
static |
Definition at line 1080 of file paint_image_2d.cc.
References ImagePaintRegion::destx, ImagePaintRegion::desty, ImagePaintRegion::height, IMB_rectclip(), paint_2d_set_region(), paint_2d_torus_split_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(), paint_2d_op(), and paint_2d_torus_split_region().
|
static |
Definition at line 1485 of file paint_image_2d.cc.
References in, out, paint_2d_transform_mouse(), and UI_view2d_region_to_view().
Referenced by paint_2d_bucket_fill(), paint_2d_gradient_fill(), and paint_2d_transform_mouse().
|
static |
Definition at line 1496 of file paint_image_2d.cc.
References paint_2d_uv_to_coord(), and tile.
Referenced by paint_2d_stroke(), and paint_2d_uv_to_coord().