|
Blender V5.3
|
Classes | |
| struct | BorderTriangle |
| struct | BuildPixelRow |
| struct | CopyPixelCommand |
| struct | CopyPixelGroup |
| struct | CopyPixelTile |
| struct | CopyPixelTiles |
| struct | DeltaCopyPixelCommand |
| struct | Edge |
| class | NonManifoldTileEdges |
| class | NonManifoldUVEdges |
| struct | PackedPixelRow |
| struct | PixelData |
| struct | PixelNode |
| class | PixelNodesTileData |
| struct | Rows |
| struct | UDIMTilePixels |
| struct | Vertex |
Enumerations | |
| enum class | CoordSpace { UV , Tile } |
Functions | |
| void | mark_image_dirty (bke::pbvh::Node &node, PixelNode &pixel_node, Map< image::TileNumber, ImBuf * > &buffers) |
| PixelData & | data_get (bke::pbvh::Tree &pbvh) |
| void | collect_dirty_tiles (PixelNode &pixel_node, Vector< image::TileNumber > &r_dirty_tiles) |
| void | copy_pixels (bke::pbvh::Tree &pbvh, Map< image::TileNumber, ImBuf * > &buffers, image::TileNumber tile_number, Span< uint8_t > seam_tiles_modified, FunctionRef< void(int x_start, int x_end, int y)> push_undo_tiles) |
| static float3x3 | calc_pixel_to_position_map (const uv_islands::MeshData &mesh_data, const int tri, const float2 uvs[3], const float inv_w, const float inv_h) |
| static void | extract_barycentric_pixels (Vector< BuildPixelRow > &build_rows, const ImBuf *image_buffer, const uv_islands::UVIslandsMask::Tile &mask_tile, const int uv_island_index, const int uv_primitive_index, const float2 uvs[3]) |
| static GroupedSpan< BorderTriangle > | build_border_triangles (const uv_islands::MeshData &mesh_data, const int64_t geom_primitive_len, MutableSpan< uv_islands::UVIsland > uv_islands, Array< int > &r_offsets, Array< BorderTriangle > &r_data) |
| static void | build_pixel_row_runs (Vector< BuildPixelRow > &build_rows, UDIMTilePixels &tile_data) |
| template<typename Fn> | |
| void | foreach_uv_triangle (const uv_islands::MeshData &mesh_data, const GroupedSpan< BorderTriangle > border_tris, const int tri, Fn &&fn) |
| static void | do_encode_pixels (const uv_islands::MeshData &mesh_data, const uv_islands::UVIslandsMask &uv_masks, const GroupedSpan< BorderTriangle > border_tris, Image &image, const ImageUser &image_user, MeshNode &node, PixelNode &pixel_node) |
| static IndexMask | find_nodes_to_update (Tree &pbvh, IndexMaskMemory &memory) |
| static void | apply_watertight_check (Tree &pbvh, Image &image, const ImageUser &image_user) |
| static bool | update_pixels (const Depsgraph &depsgraph, const Object &object, Tree &pbvh, Image &image, const ImageUser &image_user) |
| static rcti | get_bounds (const Edge< CoordSpace::Tile > &tile_edge) |
| static void | add_margin (rcti &bounds, int margin) |
| static void | clamp (rcti &bounds, int2 resolution) |
| static Vertex< CoordSpace::Tile > | convert_coord_space (const Vertex< CoordSpace::UV > &uv_vertex, const image::ImageTileWrapper image_tile, const int2 tile_resolution) |
| static Edge< CoordSpace::Tile > | convert_coord_space (const Edge< CoordSpace::UV > &uv_edge, const image::ImageTileWrapper image_tile, const int2 tile_resolution) |
| static DeltaCopyPixelCommand | encode_delta (const CopyPixelCommand &previous, const CopyPixelCommand &next) |
| static bool | can_be_extended (const CopyPixelCommand &previous, const CopyPixelCommand &next) |
| static int64_t | pixel_offset (const int width, const int2 coordinate) |
| static float4 | read_pixel (const float *buffer, const int width, const int2 coordinate) |
| static void | write_pixel (float *buffer, const int width, const int2 coordinate, const float4 &value) |
| static float4 | read_pixel (const uint8_t *buffer, const int width, const int2 coordinate) |
| static void | write_pixel (uint8_t *buffer, const int width, const int2 coordinate, const float4 &value) |
| template<typename T> | |
| static void | copy_pixels (T *buffer, const int width, const Span< CopyPixelGroup > groups, const Span< DeltaCopyPixelCommand > command_deltas) |
| void | copy_update (bke::pbvh::Tree &pbvh, Image &image, const ImageUser &image_user, const uv_islands::MeshData &mesh_data) |
Variables | |
| constexpr bool | USE_WATERTIGHT_CHECK = false |
| const int | THREADING_GRAIN_SIZE = 128 |
Fix non-manifold edge bleeding. | |
| constexpr int | SEAM_TILE_BITS = 6 |
| constexpr int | SEAM_TILE_SIZE = 1 << SEAM_TILE_BITS |
|
strong |
Coordinate space of a coordinate.
| Enumerator | |
|---|---|
| UV | Coordinate is in UV coordinate space. As in unmodified from mesh data. |
| Tile | Coordinate is in Tile coordinate space. With tile coordinate space each unit is a single pixel of the tile. Range is [0..buffer width]. |
Definition at line 38 of file pbvh_pixels_copy.cc.
|
static |
Add a margin to the given bounds.
Definition at line 73 of file pbvh_pixels_copy.cc.
References add_margin().
Referenced by add_margin(), blender::bke::pbvh::pixels::Rows::filter_pixels_for_closer_examination(), and blender::bke::pbvh::pixels::Rows::find_copy_source().
|
static |
Definition at line 414 of file pbvh_pixels.cc.
References blender::bke::pbvh::all_leaf_nodes(), apply_watertight_check(), blender::BKE_image_acquire_ibuf(), blender::BKE_image_release_ibuf(), blender::ImBuf::byte_data_for_write(), blender::copy_v4_fl(), blender::bke::pbvh::pixels::PixelNode::find_tile_data(), blender::ImBuf::float_data_for_write(), blender::index_mask::IndexMask::foreach_index(), blender::bke::image::ImageTileWrapper::get_tile_number(), blender::IMB_mark_dirty(), blender::IMB_partial_update_mark_full(), blender::bke::pbvh::pixels::PixelData::nodes, blender::bke::pbvh::pixels::PackedPixelRow::num_pixels, 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, blender::Vector< T, InlineBufferCapacity, Allocator >::size(), blender::ImageUser::tile, blender::ImBuf::x, and blender::x.
Referenced by apply_watertight_check(), and update_pixels().
|
static |
Build a map from each original triangle to the border extension triangles that duplicate it on the border of another island,
Definition at line 158 of file pbvh_pixels.cc.
References blender::offset_indices::accumulate_counts_to_offsets(), blender::Array< T, InlineBufferCapacity, Allocator >::as_span(), build_border_triangles(), blender::bke::pbvh::uv_islands::UVPrimitive::get_uv_vert(), blender::GroupedSpan< T >::GroupedSpan(), blender::bke::pbvh::uv_islands::UVIsland::num_original_primitives, blender::bke::pbvh::uv_islands::UVPrimitive::primitive_i, blender::Array< T, InlineBufferCapacity, Allocator >::reinitialize(), blender::offset_indices::OffsetIndices< T >::total_size(), blender::bke::pbvh::pixels::BorderTriangle::uv_island_index, blender::bke::pbvh::uv_islands::UVIsland::uv_primitives, blender::bke::pbvh::uv_islands::UVIsland::uv_verts, and blender::bke::pbvh::pixels::BorderTriangle::uvs.
Referenced by build_border_triangles(), and update_pixels().
|
static |
Definition at line 194 of file pbvh_pixels.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), b, build_pixel_row_runs(), blender::Vector< T, InlineBufferCapacity, Allocator >::clear(), blender::Vector< T, InlineBufferCapacity, Allocator >::index_range(), blender::bke::pbvh::pixels::BuildPixelRow::num_pixels, 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, blender::Vector< T, InlineBufferCapacity, Allocator >::size(), blender::bke::pbvh::pixels::BuildPixelRow::start_image_coordinate, and blender::bke::pbvh::pixels::BuildPixelRow::uv_primitive_index.
Referenced by build_pixel_row_runs(), and do_encode_pixels().
|
static |
Compute affine map from image pixel coordinate to object space position:
Definition at line 46 of file pbvh_pixels.cc.
References b, calc_pixel_to_position_map(), blender::bke::pbvh::uv_islands::MeshData::corner_tris, blender::bke::pbvh::uv_islands::MeshData::corner_verts, blender::v2, blender::bke::pbvh::uv_islands::MeshData::vert_positions, and y.
Referenced by calc_pixel_to_position_map(), and do_encode_pixels().
|
static |
Can next be appended to a group whose most recent command is previous?
Definition at line 226 of file pbvh_pixels_copy.cc.
References blender::math::abs(), can_be_extended(), blender::bke::pbvh::pixels::CopyPixelCommand::destination, blender::math::reduce_max(), and blender::bke::pbvh::pixels::CopyPixelCommand::source_1.
Referenced by can_be_extended(), and blender::bke::pbvh::pixels::Rows::pack_into().
Clamp bounds to be between 0,0 and the given resolution.
Definition at line 82 of file pbvh_pixels_copy.cc.
References blender::BLI_rcti_init(), blender::BLI_rcti_isect(), and clamp().
Referenced by clamp(), blender::bke::pbvh::pixels::Rows::filter_pixels_for_closer_examination(), and blender::bke::pbvh::pixels::Rows::find_copy_source().
| void blender::bke::pbvh::pixels::collect_dirty_tiles | ( | PixelNode & | pixel_node, |
| Vector< image::TileNumber > & | r_dirty_tiles ) |
Definition at line 601 of file pbvh_pixels.cc.
References collect_dirty_tiles(), and node.
Referenced by collect_dirty_tiles(), blender::ed::sculpt_paint::image::collect_dirty_tiles(), and blender::ed::sculpt_paint::image::fix_non_manifold_seam_bleeding().
|
static |
Definition at line 97 of file pbvh_pixels_copy.cc.
References convert_coord_space(), blender::bke::pbvh::pixels::Edge< Space >::vertex_1, and blender::bke::pbvh::pixels::Edge< Space >::vertex_2.
|
static |
Definition at line 89 of file pbvh_pixels_copy.cc.
References convert_coord_space(), blender::bke::pbvh::pixels::Vertex< Space >::coordinate, and blender::bke::image::ImageTileWrapper::get_tile_offset().
Referenced by convert_coord_space(), convert_coord_space(), and blender::bke::pbvh::pixels::NonManifoldUVEdges::extract_tile_edges().
| void blender::bke::pbvh::pixels::copy_pixels | ( | bke::pbvh::Tree & | pbvh, |
| Map< image::TileNumber, ImBuf * > & | buffers, | ||
| image::TileNumber | tile_number, | ||
| Span< uint8_t > | seam_tiles_modified, | ||
| FunctionRef< void(int x_start, int x_end, int y)> | push_undo_tiles ) |
Definition at line 670 of file pbvh_pixels_copy.cc.
References blender::BLI_assert(), copy_pixels(), data_get(), blender::bke::pbvh::pixels::CopyPixelTiles::find_tile(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_default(), blender::Span< T >::size(), tile, blender::bke::pbvh::pixels::PixelData::tiles_copy_pixels, and y.
Referenced by copy_pixels(), copy_pixels(), blender::bke::pbvh::pixels::CopyPixelTile::copy_pixels(), and blender::ed::sculpt_paint::image::fix_non_manifold_seam_bleeding().
|
static |
Definition at line 566 of file pbvh_pixels_copy.cc.
References copy_pixels(), float, blender::math::interpolate(), read_pixel(), Span< T >::Span(), T, and write_pixel().
| void blender::bke::pbvh::pixels::copy_update | ( | bke::pbvh::Tree & | pbvh, |
| Image & | image, | ||
| const ImageUser & | image_user, | ||
| const uv_islands::MeshData & | mesh_data ) |
Definition at line 622 of file pbvh_pixels_copy.cc.
References blender::BKE_image_acquire_ibuf(), blender::BKE_image_release_ibuf(), blender::bke::pbvh::pixels::CopyPixelTile::build_seam_tile_map(), blender::bke::pbvh::pixels::CopyPixelTiles::clear(), copy_update(), data_get(), blender::Editor, blender::bke::pbvh::pixels::NonManifoldUVEdges::extract_tile_edges(), blender::bke::pbvh::pixels::Rows::filter_pixels_for_closer_examination(), blender::bke::pbvh::pixels::Rows::find_copy_source(), blender::bke::image::ImageTileWrapper::get_tile_number(), blender::ui::Vector< T, InlineBufferCapacity, Allocator >::is_empty(), blender::bke::pbvh::pixels::Rows::mark_pixels_effected_by_brush(), blender::bke::pbvh::pixels::Rows::pack_into(), PRF_scope, blender::Vector< T, InlineBufferCapacity, Allocator >::size(), blender::ImageUser::tile, tile, blender::bke::pbvh::pixels::CopyPixelTiles::tiles, blender::bke::pbvh::pixels::PixelData::tiles_copy_pixels, blender::ImBuf::x, and blender::ImBuf::y.
Referenced by copy_update(), and update_pixels().
| PixelData & blender::bke::pbvh::pixels::data_get | ( | bke::pbvh::Tree & | pbvh | ) |
Definition at line 576 of file pbvh_pixels.cc.
References blender::BLI_assert(), blender::data, and data_get().
Referenced by copy_pixels(), copy_update(), and data_get().
|
static |
Definition at line 254 of file pbvh_pixels.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::Vector< T, InlineBufferCapacity, Allocator >::append_non_duplicates(), blender::Vector< T, InlineBufferCapacity, Allocator >::as_span(), blender::BKE_image_acquire_ibuf(), blender::BKE_image_release_ibuf(), blender::BLI_assert(), blender::BLI_listbase_count(), build_pixel_row_runs(), calc_pixel_to_position_map(), blender::math::clamp(), blender::Vector< T, InlineBufferCapacity, Allocator >::contains(), do_encode_pixels(), blender::Editor, extract_barycentric_pixels(), blender::bke::mesh::face_triangles_range(), blender::bke::pbvh::uv_islands::MeshData::faces, blender::bke::pbvh::uv_islands::UVIslandsMask::find_tile(), blender::bke::pbvh::pixels::PixelNode::flags, blender::math::floor(), FLT_MAX, foreach_uv_triangle(), blender::bke::image::ImageTileWrapper::get_tile_number(), blender::bke::image::ImageTileWrapper::get_tile_offset(), INT_MAX, blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty(), blender::math::max(), blender::math::min(), blender::math::min_max(), node, PRF_scope, blender::Vector< T, InlineBufferCapacity, Allocator >::reserve(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), blender::ImageUser::tile, tile, blender::bke::pbvh::pixels::UDIMTilePixels::tile_number, blender::bke::pbvh::pixels::PixelNode::tiles, blender::bke::pbvh::pixels::PixelNode::uv_primitives, blender::ImBuf::x, and blender::ImBuf::y.
Referenced by do_encode_pixels(), and update_pixels().
|
static |
Definition at line 217 of file pbvh_pixels_copy.cc.
References blender::bke::pbvh::pixels::DeltaCopyPixelCommand::DeltaCopyPixelCommand(), encode_delta(), blender::bke::pbvh::pixels::CopyPixelCommand::mix_factor, blender::bke::pbvh::pixels::CopyPixelCommand::source_1, and blender::bke::pbvh::pixels::CopyPixelCommand::source_2.
Referenced by encode_delta(), and blender::bke::pbvh::pixels::Rows::pack_into().
|
static |
Definition at line 94 of file pbvh_pixels.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::bke::pbvh::TriRasterizer::bounds, extract_barycentric_pixels(), float, blender::bke::pbvh::TriRasterizer::inside(), blender::bke::pbvh::uv_islands::UVIslandsMask::Tile::is_masked(), blender::bke::pbvh::uv_islands::UVIslandsMask::Tile::mask_resolution, blender::bke::pbvh::pixels::BuildPixelRow::num_pixels, blender::bke::pbvh::pixels::BuildPixelRow::start_image_coordinate, blender::bke::pbvh::pixels::BuildPixelRow::uv_primitive_index, blender::ImBuf::x, blender::x, blender::ImBuf::y, and y.
Referenced by do_encode_pixels(), and extract_barycentric_pixels().
|
static |
Find the nodes that needs to be updated.
The nodes that require updated are added to the r_nodes_to_update parameter. Will fill in r_visited_polygons with polygons that are owned by nodes that do not require updates.
returns if there were any nodes found (true).
Definition at line 388 of file pbvh_pixels.cc.
References blender::bke::pbvh::all_leaf_nodes(), find_nodes_to_update(), blender::index_mask::IndexMask::foreach_index(), blender::IndexMask::from_predicate(), blender::index_mask::IndexMask::is_empty(), and blender::bke::pbvh::pixels::PixelData::nodes.
Referenced by find_nodes_to_update(), and update_pixels().
|
inline |
Iterate over all UV triangles, both original triangles and new ones added by border extension. Provides UVs and island index.
Definition at line 238 of file pbvh_pixels.cc.
References blender::bke::pbvh::uv_islands::MeshData::corner_tris, foreach_uv_triangle(), blender::bke::pbvh::uv_islands::MeshData::uv_island_ids, and blender::bke::pbvh::uv_islands::MeshData::uv_map.
Referenced by do_encode_pixels(), and foreach_uv_triangle().
|
static |
Calculate the bounds of the given edge.
Definition at line 63 of file pbvh_pixels_copy.cc.
References blender::BLI_rcti_do_minmax_v(), blender::BLI_rcti_init_minmax(), get_bounds(), blender::bke::pbvh::pixels::Edge< Space >::vertex_1, and blender::bke::pbvh::pixels::Edge< Space >::vertex_2.
Referenced by blender::bke::pbvh::pixels::Rows::filter_pixels_for_closer_examination(), and get_bounds().
| void blender::bke::pbvh::pixels::mark_image_dirty | ( | bke::pbvh::Node & | node, |
| PixelNode & | pixel_node, | ||
| Map< image::TileNumber, ImBuf * > & | buffers ) |
Definition at line 583 of file pbvh_pixels.cc.
References blender::Editor, blender::bke::pbvh::pixels::PixelNode::flags, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_default(), mark_image_dirty(), blender::bke::pbvh::pixels::PixelNode::mark_region(), PRF_scope, tile, and blender::bke::pbvh::pixels::PixelNode::tiles.
Referenced by blender::ed::sculpt_paint::image::do_3d_image_paint_brush(), and mark_image_dirty().
Definition at line 535 of file pbvh_pixels_copy.cc.
References pixel_offset().
Referenced by pixel_offset(), read_pixel(), read_pixel(), write_pixel(), and write_pixel().
|
static |
Definition at line 540 of file pbvh_pixels_copy.cc.
References pixel_offset(), and read_pixel().
Referenced by copy_pixels(), read_pixel(), and read_pixel().
|
static |
Definition at line 550 of file pbvh_pixels_copy.cc.
References pixel_offset(), read_pixel(), blender::result, and blender::rgba_uchar_to_float().
|
static |
Definition at line 467 of file pbvh_pixels.cc.
References blender::bke::pbvh::uv_islands::UVIslandsMask::add(), blender::bke::pbvh::uv_islands::UVIslandsMask::add_tile(), apply_watertight_check(), blender::BKE_image_acquire_ibuf(), blender::BKE_image_release_ibuf(), build_border_triangles(), blender::offset_indices::build_groups_from_indices(), blender::bke::pbvh::uv_islands::build_uv_islands(), copy_update(), blender::bke::Corner, blender::data, blender::bke::pbvh::uv_islands::UVIslandsMask::dilate(), do_encode_pixels(), find_nodes_to_update(), blender::index_mask::IndexMask::foreach_index(), blender::bke::image::ImageTileWrapper::get_tile_number(), blender::bke::image::ImageTileWrapper::get_tile_x_offset(), blender::bke::image::ImageTileWrapper::get_tile_y_offset(), blender::exec_mode::grain_size(), blender::blender::StringRefBase::is_empty(), blender::index_mask::IndexMask::is_empty(), blender::bke::AttributeAccessor::lookup(), blender::bke::pbvh::pixels::PackedPixelRow::num_pixels, blender::ImageUser::tile, tile, blender::bke::pbvh::pixels::PixelNode::tiles, update_pixels(), USE_WATERTIGHT_CHECK, blender::bke::pbvh::pixels::PixelNode::uv_primitives, blender::bke::pbvh::vert_positions_eval(), blender::ImBuf::x, and blender::ImBuf::y.
Referenced by blender::bke::pbvh::build_pixels(), and update_pixels().
|
static |
Definition at line 545 of file pbvh_pixels_copy.cc.
References pixel_offset(), and write_pixel().
Referenced by copy_pixels(), write_pixel(), and write_pixel().
|
static |
Definition at line 557 of file pbvh_pixels_copy.cc.
References pixel_offset(), blender::rgba_float_to_uchar(), and write_pixel().
|
constexpr |
Each UDIM tile is split into smaller (64x64) seam tiles for which we can do seam bleeding. These are tagged as modified during painting, and only the modified subset will be processed.
Definition at line 163 of file BKE_paint_bvh_pixels.hh.
Referenced by blender::bke::pbvh::pixels::CopyPixelTile::build_seam_tile_map(), blender::ed::sculpt_paint::image::do_paint_pixels(), blender::ed::sculpt_paint::image::mark_seam_tiles_modified(), blender::bke::pbvh::pixels::Rows::pack_into(), and blender::bke::pbvh::pixels::CopyPixelTile::seam_tile_index().
|
constexpr |
Definition at line 164 of file BKE_paint_bvh_pixels.hh.
Referenced by blender::bke::pbvh::pixels::CopyPixelTile::build_seam_tile_map(), blender::ed::sculpt_paint::image::do_paint_pixels(), and blender::bke::pbvh::pixels::Rows::pack_into().
| const int blender::bke::pbvh::pixels::THREADING_GRAIN_SIZE = 128 |
Definition at line 35 of file pbvh_pixels_copy.cc.
Referenced by blender::bke::pbvh::pixels::Rows::find_copy_source().
|
constexpr |
During debugging this check could be enabled. It will write to each image pixel that is covered by the Tree.
Definition at line 85 of file pbvh_pixels.cc.
Referenced by update_pixels().