Blender V5.3
blender::ed::sculpt_paint::image Namespace Reference

Namespaces

namespace  ops

Classes

struct  ImageData
struct  PaintBlendSettings
struct  PaintLocalData
struct  TileColorspaceProcessor

Functions

static void fetch_image_buffers (ImageData &image_data, bke::pbvh::Node &, PixelNode &pixel_node, const bool is_mask_brush)
static void calc_pixel_row_positions (const float3 P_start, const float3 P_delta, const MutableSpan< float3 > positions, IndexRange range)
static BitVector init_uv_primitives_brush_test (SculptSession &ss, const Span< int > corner_verts, const Span< int3 > corner_tris, const Span< int > tri_indices, const Span< float3 > positions)
static void apply_selection_filter (const Span< int > corner_tri_faces, const Span< int > tri_indices, const Span< bool > select_poly, BitVector<> &brush_test)
static PaintBlendSettings mask_brush_blend_settings (const Brush &brush, const bool invert)
BLI_INLINE float4 paint_blend_pixel (const float4 &brush_color, const float brush_alpha, const bool is_mix, const IMB_BlendMode blend_mode, const float factor, const float4 color)
template<typename PixelT>
static BLI_NOINLINE void paint_blend_pixels_color_managed (const PaintBlendSettings &settings, const Span< float > factors, const int start, const int size, const MutableSpan< PixelT > image_pixels, const int img_x, const int img_y, const TileColorspaceProcessor &processors, Vector< float4 > &paint_pixels)
template<typename PixelT>
static void paint_blend_pixels (const PaintBlendSettings &settings, const Span< float > factors, const int start, const int size, const MutableSpan< PixelT > image_pixels, const int img_x, const int img_y, const TileColorspaceProcessor &processors, Vector< float4 > &paint_pixels)
static Bounds< int2 > negative_bounds ()
static void push_undo_tiles (ImageData &image_data, const image::TileNumber tile_number, ImBuf &image_buffer, MutableSpan< uint32_t > tile_pushed, const int img_x_start, const int img_x_end, const int img_y)
static void mark_seam_tiles_modified (MutableSpan< uint8_t > mask, const int tiles_x, const int tiles_y, const int x_start, const int x_end, const int y)
static void do_paint_pixels (const PaintBlendSettings &blend_settings, const Brush &brush, Object &object, Span< float3 > positions_eval, Span< int > corner_verts, Span< int3 > corner_tris, Span< int > corner_tri_faces, Span< bool > select_poly, ImageData &image_data, bke::pbvh::Node &, PixelNode &pixel_node)
Fix non-manifold edge bleeding.
static Vector< image::TileNumber > collect_dirty_tiles (MutableSpan< PixelNode > nodes, const IndexMask &node_mask)
static void fix_non_manifold_seam_bleeding (bke::pbvh::Tree &pbvh, ImageData &image_data, Span< TileNumber > tile_numbers_to_fix)
static void fix_non_manifold_seam_bleeding (Object &ob, ImageData &image_data, MutableSpan< bke::pbvh::MeshNode >, MutableSpan< PixelNode > pixel_nodes, const IndexMask &node_mask)

3D Texture Paint (Experimental)

using BufferType = std::variant<std::monostate, MutableSpan<float4>, MutableSpan<uchar4>>
void do_3d_image_paint_brush (const Depsgraph &depsgraph, const Paint &paint, const Brush &brush, Object &ob, ImageData &image_data, const IndexMask &node_mask)

Typedef Documentation

◆ BufferType

Definition at line 28 of file image_paint_intern.hh.

Function Documentation

◆ apply_selection_filter()

void blender::ed::sculpt_paint::image::apply_selection_filter ( const Span< int > corner_tri_faces,
const Span< int > tri_indices,
const Span< bool > select_poly,
BitVector<> & brush_test )
static

◆ calc_pixel_row_positions()

void blender::ed::sculpt_paint::image::calc_pixel_row_positions ( const float3 P_start,
const float3 P_delta,
const MutableSpan< float3 > positions,
IndexRange range )
static

◆ collect_dirty_tiles()

◆ do_3d_image_paint_brush()

◆ do_paint_pixels()

void blender::ed::sculpt_paint::image::do_paint_pixels ( const PaintBlendSettings & blend_settings,
const Brush & brush,
Object & object,
Span< float3 > positions_eval,
Span< int > corner_verts,
Span< int3 > corner_tris,
Span< int > corner_tri_faces,
Span< bool > select_poly,
ImageData & image_data,
bke::pbvh::Node & ,
PixelNode & pixel_node )
static

Definition at line 504 of file paint_image_3d.cc.

References blender::ed::sculpt_paint::apply_hardness_to_distances(), apply_selection_filter(), blender::BLI_assert(), BLI_assert_unreachable, blender::BLI_hash_int(), blender::ed::sculpt_paint::StrokeCache::bstrength, blender::SculptSession::cache, blender::ed::sculpt_paint::calc_brush_distances(), blender::ed::sculpt_paint::calc_brush_strength_factors(), blender::ed::sculpt_paint::calc_brush_texture_factors(), calc_pixel_row_positions(), blender::SculptSession::cursor_location, blender::SculptSession::cursor_radius, blender::ed::sculpt_paint::image::ImageData::data_buffers, blender::ed::sculpt_paint::image::PaintLocalData::distances, do_paint_pixels(), blender::Editor, blender::ed::sculpt_paint::image::PaintLocalData::factors, blender::MutableSpan< T >::fill(), blender::ed::sculpt_paint::filter_distances_with_radius(), blender::bke::pbvh::pixels::PixelNode::flags, blender::bke::pbvh::pixels::UDIMTilePixels::flags, float, hash, blender::ed::sculpt_paint::image::ImageData::image_buffers, blender::IMB_mark_dirty(), blender::IndexRange::IndexRange(), init_uv_primitives_brush_test(), blender::Bounds< T >::intersects_segment(), blender::Bounds< T >::is_empty(), blender::Span< T >::is_empty(), blender::threading::EnumerableThreadSpecific< T >::local(), blender::ed::sculpt_paint::StrokeCache::location_symm, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_default(), blender::bke::pbvh::pixels::UDIMTilePixels::mark_dirty(), mark_seam_tiles_modified(), blender::bounds::merge(), blender::ed::sculpt_paint::image::PaintLocalData::modified_spans, negative_bounds(), node, blender::bke::pbvh::pixels::PackedPixelRow::num_pixels, paint_blend_pixels(), blender::ed::sculpt_paint::image::PaintLocalData::paint_blend_pixels, blender::threading::parallel_for(), blender::ed::sculpt_paint::image::PaintLocalData::pixel_positions, blender::bke::pbvh::pixels::UDIMTilePixels::pixel_row_run_start_coords, blender::bke::pbvh::pixels::UDIMTilePixels::pixel_row_run_starts, blender::bke::pbvh::pixels::UDIMTilePixels::pixel_rows, POINTER_AS_UINT, PRF_scope, blender::ed::sculpt_paint::image::ImageData::processors, push_undo_tiles(), blender::ed::sculpt_paint::StrokeCache::radius, lexit::Vector< T >::resize(), blender::ed::sculpt_paint::scale_factors(), blender::bke::pbvh::pixels::SEAM_TILE_BITS, blender::ed::sculpt_paint::image::ImageData::seam_tile_modified, blender::bke::pbvh::pixels::SEAM_TILE_SIZE, blender::ed::sculpt_paint::image::PaintLocalData::ModifiedSpan::size, blender::Vector< T, InlineBufferCapacity, Allocator >::size(), blender::MutableSpan< T >::slice(), blender::Texture3D, blender::bke::pbvh::pixels::UDIMTilePixels::tile_number, blender::bke::pbvh::pixels::PixelNode::tiles, blender::ed::sculpt_paint::image::ImageData::undo_tile_pushed, blender::bke::pbvh::pixels::PackedPixelRow::uv_primitive_index, blender::bke::pbvh::pixels::PixelNode::uv_primitives, blender::ed::sculpt_paint::image::PaintLocalData::ModifiedSpan::x, blender::ImBuf::x, blender::ed::sculpt_paint::image::PaintLocalData::ModifiedSpan::y, and blender::ImBuf::y.

Referenced by do_3d_image_paint_brush(), and do_paint_pixels().

◆ fetch_image_buffers()

◆ fix_non_manifold_seam_bleeding() [1/2]

◆ fix_non_manifold_seam_bleeding() [2/2]

void blender::ed::sculpt_paint::image::fix_non_manifold_seam_bleeding ( Object & ob,
ImageData & image_data,
MutableSpan< bke::pbvh::MeshNode > ,
MutableSpan< PixelNode > pixel_nodes,
const IndexMask & node_mask )
static

◆ init_uv_primitives_brush_test()

◆ mark_seam_tiles_modified()

void blender::ed::sculpt_paint::image::mark_seam_tiles_modified ( MutableSpan< uint8_t > mask,
const int tiles_x,
const int tiles_y,
const int x_start,
const int x_end,
const int y )
static

Mark the seam tiles covering the given pixel row as modified. Dilated by one tile so a seam whose second source sits one pixel across a tile boundary is still handled.

Definition at line 481 of file paint_image_3d.cc.

References mark_seam_tiles_modified(), blender::bke::pbvh::pixels::SEAM_TILE_BITS, and y.

Referenced by do_paint_pixels(), and mark_seam_tiles_modified().

◆ mask_brush_blend_settings()

◆ negative_bounds()

Bounds< int2 > blender::ed::sculpt_paint::image::negative_bounds ( )
static

Definition at line 438 of file paint_image_3d.cc.

References negative_bounds().

Referenced by do_paint_pixels(), and negative_bounds().

◆ paint_blend_pixel()

BLI_INLINE float4 blender::ed::sculpt_paint::image::paint_blend_pixel ( const float4 & brush_color,
const float brush_alpha,
const bool is_mix,
const IMB_BlendMode blend_mode,
const float factor,
const float4 color )

◆ paint_blend_pixels()

template<typename PixelT>
void blender::ed::sculpt_paint::image::paint_blend_pixels ( const PaintBlendSettings & settings,
const Span< float > factors,
const int start,
const int size,
const MutableSpan< PixelT > image_pixels,
const int img_x,
const int img_y,
const TileColorspaceProcessor & processors,
Vector< float4 > & paint_pixels )
static

◆ paint_blend_pixels_color_managed()

◆ push_undo_tiles()

void blender::ed::sculpt_paint::image::push_undo_tiles ( ImageData & image_data,
const image::TileNumber tile_number,
ImBuf & image_buffer,
MutableSpan< uint32_t > tile_pushed,
const int img_x_start,
const int img_x_end,
const int img_y )
static