|
Blender V5.3
|
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) |
| using blender::ed::sculpt_paint::image::BufferType = std::variant<std::monostate, MutableSpan<float4>, MutableSpan<uchar4>> |
Definition at line 28 of file image_paint_intern.hh.
|
static |
Definition at line 216 of file paint_image_3d.cc.
References apply_selection_filter(), blender::BLI_assert(), blender::Span< T >::index_range(), blender::bits::BitVector< InlineBufferCapacity, Allocator >::size(), and blender::Span< T >::size().
Referenced by apply_selection_filter(), and do_paint_pixels().
|
static |
Definition at line 177 of file paint_image_3d.cc.
References blender::BLI_assert(), calc_pixel_row_positions(), blender::Editor, blender::MutableSpan< T >::index_range(), PRF_scope, blender::IndexRange::size(), blender::MutableSpan< T >::size(), and blender::IndexRange::start().
Referenced by calc_pixel_row_positions(), and do_paint_pixels().
|
static |
Definition at line 741 of file paint_image_3d.cc.
References blender::bke::pbvh::pixels::collect_dirty_tiles(), and blender::index_mask::IndexMask::foreach_index().
| void blender::ed::sculpt_paint::image::do_3d_image_paint_brush | ( | const Depsgraph & | depsgraph, |
| const Paint & | paint, | ||
| const Brush & | brush, | ||
| Object & | ob, | ||
| ImageData & | image_data, | ||
| const IndexMask & | node_mask ) |
Definition at line 789 of file paint_image_3d.cc.
References blender::SculptSession::cache, blender::Object::data, do_3d_image_paint_brush(), do_paint_pixels(), blender::Editor, blender::bke::Face, fetch_image_buffers(), fix_non_manifold_seam_bleeding(), blender::index_mask::IndexMask::foreach_index(), blender::exec_mode::grain_size(), blender::ed::sculpt_paint::image::ImageData::image_buffers, blender::IMAGE_PAINT_BRUSH_TYPE_MASK, blender::ed::sculpt_paint::StrokeToggleSettings::invert, blender::bke::AttributeAccessor::lookup(), blender::bke::pbvh::pixels::mark_image_dirty(), mask_brush_blend_settings(), blender::ME_EDIT_PAINT_FACE_SEL, blender::bke::object::pbvh_get(), PRF_scope, blender::Object::runtime, blender::bke::ObjectRuntime::sculpt_session, blender::ed::sculpt_paint::StrokeCache::toggle_settings, and blender::bke::pbvh::vert_positions_eval().
Referenced by do_3d_image_paint_brush(), and blender::ed::sculpt_paint::image::ops::paint::do_brush_action().
|
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().
|
static |
Definition at line 101 of file paint_image_3d.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_overwrite(), blender::BLI_assert(), blender::ImBuf::byte_data(), blender::ImBuf::byte_data_for_write(), blender::ImBuf::channels, blender::ColormanageProcessor::colorspace_processor_from_scene_linear_new(), blender::ColormanageProcessor::colorspace_processor_to_scene_linear_new(), blender::ed::sculpt_paint::image::ImageData::data_buffers, blender::Editor, ELEM, fetch_image_buffers(), blender::ImBuf::float_data(), blender::ImBuf::float_data_for_write(), blender::if(), blender::ed::sculpt_paint::image::ImageData::image_buffers, blender::IMB_colormanagement_space_is_srgb(), blender::IMB_get_pixel_count(), blender::ColormanageProcessor::is_noop(), PRF_scope, blender::ed::sculpt_paint::image::ImageData::processors, blender::ed::sculpt_paint::image::ImageData::seam_tile_modified, tile, blender::bke::pbvh::pixels::PixelNode::tiles, and blender::ed::sculpt_paint::image::ImageData::undo_tile_pushed.
Referenced by do_3d_image_paint_brush(), and fetch_image_buffers().
|
static |
Definition at line 749 of file paint_image_3d.cc.
References blender::bke::pbvh::pixels::copy_pixels(), blender::Editor, blender::MutableSpan< T >::fill(), fix_non_manifold_seam_bleeding(), blender::ed::sculpt_paint::image::ImageData::image_buffers, PRF_scope, blender::ed::sculpt_paint::image::ImageData::seam_tile_modified, blender::ed::sculpt_paint::image::ImageData::undo_tile_pushed, and y.
Referenced by do_3d_image_paint_brush(), fix_non_manifold_seam_bleeding(), and fix_non_manifold_seam_bleeding().
|
static |
Definition at line 777 of file paint_image_3d.cc.
References blender::bke::pbvh::pixels::collect_dirty_tiles(), fix_non_manifold_seam_bleeding(), and blender::bke::object::pbvh_get().
|
static |
Definition at line 191 of file paint_image_3d.cc.
References blender::SculptSession::cache, blender::SculptSession::cursor_location, blender::SculptSession::cursor_radius, blender::Editor, blender::Span< T >::index_range(), init_uv_primitives_brush_test(), blender::isect_aabb_aabb_v3(), blender::ed::sculpt_paint::StrokeCache::location_symm, blender::Bounds< T >::max, blender::Bounds< T >::min, blender::math::min_max(), PRF_scope, blender::ed::sculpt_paint::StrokeCache::radius, and blender::Span< T >::size().
Referenced by do_paint_pixels(), and init_uv_primitives_brush_test().
|
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().
|
static |
Definition at line 246 of file paint_image_3d.cc.
References blender::ed::sculpt_paint::image::PaintBlendSettings::blend_mode, blender::ed::sculpt_paint::image::PaintBlendSettings::brush_alpha, blender::ed::sculpt_paint::image::PaintBlendSettings::brush_color, invert(), and mask_brush_blend_settings().
Referenced by do_3d_image_paint_brush(), and mask_brush_blend_settings().
Definition at line 438 of file paint_image_3d.cc.
References negative_bounds().
Referenced by do_paint_pixels(), and negative_bounds().
| 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 ) |
Blend one pixel with the brush.
Definition at line 257 of file paint_image_3d.cc.
References blender::blend_color_mix_float(), BLI_INLINE, blender::IMB_blend_color_float(), paint_blend_pixel(), and blender::result.
Referenced by paint_blend_pixel(), paint_blend_pixels(), and paint_blend_pixels_color_managed().
|
static |
Perform paint pixel blending with computed factors. Templated and specialized for common color spaces since this is a hot-spot.
Definition at line 360 of file paint_image_3d.cc.
References blender::ed::sculpt_paint::image::PaintBlendSettings::blend_mode, blender::ed::sculpt_paint::image::PaintBlendSettings::brush_alpha, blender::ed::sculpt_paint::image::PaintBlendSettings::brush_color, blender::Vector< T, InlineBufferCapacity, Allocator >::data(), blender::Editor, float, blender::IMB_BLEND_MIX, blender::IMB_colormanagement_rec709_to_scene_linear(), blender::ed::sculpt_paint::image::TileColorspaceProcessor::is_noop, blender::ed::sculpt_paint::image::TileColorspaceProcessor::is_srgb_byte, blender::linearrgb_to_srgb_uchar4_n(), blender::nullptr, paint_blend_pixel(), paint_blend_pixels(), paint_blend_pixels_color_managed(), PRF_scope, blender::MatBase< T, NumCol, NumRow, Alignment >::ptr(), blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), blender::colorspace::scene_linear_is_rec709, blender::colorspace::scene_linear_to_rec709, and blender::srgb_to_linearrgb_uchar4().
Referenced by do_paint_pixels(), and paint_blend_pixels().
|
static |
Slower paint pixels blending with OpenColorIO conversion.
Definition at line 293 of file paint_image_3d.cc.
References blender::ColormanageProcessor::apply(), blender::ed::sculpt_paint::image::PaintBlendSettings::blend_mode, BLI_NOINLINE, blender::ed::sculpt_paint::image::PaintBlendSettings::brush_alpha, blender::ed::sculpt_paint::image::PaintBlendSettings::brush_color, blender::ed::sculpt_paint::image::TileColorspaceProcessor::buffer_to_linear_processor, blender::MutableSpan< T >::data(), blender::Editor, blender::IMB_BLEND_MIX, blender::ed::sculpt_paint::image::TileColorspaceProcessor::is_noop, blender::ed::sculpt_paint::image::TileColorspaceProcessor::linear_to_buffer_processor, paint_blend_pixel(), paint_blend_pixels_color_managed(), PRF_scope, blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), blender::rgba_float_to_uchar(), blender::rgba_uchar_to_float(), and blender::MutableSpan< T >::slice().
Referenced by paint_blend_pixels(), and paint_blend_pixels_color_managed().
|
static |
Save the pre-stroke pixels of an undo tile for a pixel row, just-in-time before painting. Uses a mask to quickly skip already pushed tiles.
Definition at line 447 of file paint_image_3d.cc.
References blender::ED_image_paint_tile_map_get(), blender::ED_image_paint_tile_push(), ED_IMAGE_UNDO_TILE_BITS, ED_IMAGE_UNDO_TILE_SIZE, blender::ed::sculpt_paint::image::ImageData::image, blender::ed::sculpt_paint::image::ImageData::image_user_get(), push_undo_tiles(), blender::ImageUser::tile, tile_index, and blender::ImBuf::x.
Referenced by do_paint_pixels(), and push_undo_tiles().