Blender V4.3
blender::bke::pbvh::pixels Namespace Reference

Classes

struct  CopyPixelCommand
 
struct  CopyPixelGroup
 
struct  CopyPixelTile
 
struct  CopyPixelTiles
 
struct  DeltaCopyPixelCommand
 
struct  Edge
 
struct  NodeData
 
class  NonManifoldTileEdges
 
class  NonManifoldUVEdges
 
struct  PackedPixelRow
 
struct  PBVHData
 
class  PixelNodesTileData
 
struct  Rows
 
struct  UDIMTilePixels
 
struct  UDIMTileUndo
 
struct  UVPrimitiveLookup
 
struct  UVPrimitivePaintInput
 
struct  Vertex
 

Enumerations

enum class  CoordSpace { UV , Tile }
 

Functions

NodeDatanode_data_get (blender::bke::pbvh::Node &node)
 
void mark_image_dirty (blender::bke::pbvh::Node &node, Image &image, ImageUser &image_user)
 
PBVHDatadata_get (blender::bke::pbvh::Tree &pbvh)
 
void collect_dirty_tiles (blender::bke::pbvh::Node &node, Vector< image::TileNumber > &r_dirty_tiles)
 
void copy_pixels (blender::bke::pbvh::Tree &pbvh, Image &image, ImageUser &image_user, image::TileNumber tile_number)
 
static float2 calc_barycentric_delta (const float2 uvs[3], const float2 start_uv, const float2 end_uv)
 
static float2 calc_barycentric_delta_x (const ImBuf *image_buffer, const float2 uvs[3], const int x, const int y)
 
static void extract_barycentric_pixels (UDIMTilePixels &tile_data, const ImBuf *image_buffer, const uv_islands::UVIslandsMask &uv_mask, const int uv_island_index, const int uv_primitive_index, const float2 uvs[3], const float2 tile_offset, const int minx, const int miny, const int maxx, const int maxy)
 
static void update_geom_primitives (Tree &pbvh, const uv_islands::MeshData &mesh_data)
 
static void do_encode_pixels (const uv_islands::MeshData &mesh_data, const uv_islands::UVIslandsMask &uv_masks, const UVPrimitiveLookup &uv_prim_lookup, Image &image, ImageUser &image_user, MeshNode &node)
 
static bool should_pixels_be_updated (const Node &node)
 
static int count_nodes_to_update (Tree &pbvh)
 
static bool find_nodes_to_update (Tree &pbvh, Vector< MeshNode * > &r_nodes_to_update)
 
static void apply_watertight_check (Tree &pbvh, Image &image, ImageUser &image_user)
 
static bool update_pixels (const Depsgraph &depsgraph, const Object &object, Tree &pbvh, Image &image, 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 const Vertex< CoordSpace::Tileconvert_coord_space (const Vertex< CoordSpace::UV > &uv_vertex, const image::ImageTileWrapper image_tile, const int2 tile_resolution)
 
static const Edge< CoordSpace::Tileconvert_coord_space (const Edge< CoordSpace::UV > &uv_edge, const image::ImageTileWrapper image_tile, const int2 tile_resolution)
 
void copy_update (blender::bke::pbvh::Tree &pbvh, Image &image, ImageUser &image_user, const uv_islands::MeshData &mesh_data)
 

Variables

constexpr bool USE_WATERTIGHT_CHECK = false
 
const int THREADING_GRAIN_SIZE = 128
 

Enumeration Type Documentation

◆ CoordSpace

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 29 of file pbvh_pixels_copy.cc.

Function Documentation

◆ add_margin()

static void blender::bke::pbvh::pixels::add_margin ( rcti & bounds,
int margin )
static

◆ apply_watertight_check()

◆ calc_barycentric_delta()

static float2 blender::bke::pbvh::pixels::calc_barycentric_delta ( const float2 uvs[3],
const float2 start_uv,
const float2 end_uv )
static

Calculate the delta of two neighbor UV coordinates in the given image buffer.

Definition at line 32 of file pbvh_pixels.cc.

References barycentric_weights_v2().

Referenced by calc_barycentric_delta_x().

◆ calc_barycentric_delta_x()

static float2 blender::bke::pbvh::pixels::calc_barycentric_delta_x ( const ImBuf * image_buffer,
const float2 uvs[3],
const int x,
const int y )
static

Definition at line 45 of file pbvh_pixels.cc.

References calc_barycentric_delta(), ImBuf::x, and ImBuf::y.

Referenced by do_encode_pixels().

◆ clamp()

static void blender::bke::pbvh::pixels::clamp ( rcti & bounds,
int2 resolution )
static

Clamp bounds to be between 0,0 and the given resolution.

Definition at line 73 of file pbvh_pixels_copy.cc.

References BLI_rcti_init(), and BLI_rcti_isect().

Referenced by blender::bke::pbvh::pixels::Rows::find_copy_source().

◆ collect_dirty_tiles()

◆ convert_coord_space() [1/2]

static const Edge< CoordSpace::Tile > blender::bke::pbvh::pixels::convert_coord_space ( const Edge< CoordSpace::UV > & uv_edge,
const image::ImageTileWrapper image_tile,
const int2 tile_resolution )
static

◆ convert_coord_space() [2/2]

static const Vertex< CoordSpace::Tile > blender::bke::pbvh::pixels::convert_coord_space ( const Vertex< CoordSpace::UV > & uv_vertex,
const image::ImageTileWrapper image_tile,
const int2 tile_resolution )
static

◆ copy_pixels()

◆ copy_update()

◆ count_nodes_to_update()

static int blender::bke::pbvh::pixels::count_nodes_to_update ( Tree & pbvh)
static

◆ data_get()

◆ do_encode_pixels()

◆ extract_barycentric_pixels()

◆ find_nodes_to_update()

static bool blender::bke::pbvh::pixels::find_nodes_to_update ( Tree & pbvh,
Vector< MeshNode * > & r_nodes_to_update )
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 256 of file pbvh_pixels.cc.

References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::bke::pbvh::pixels::NodeData::clear_data(), blender::bke::pbvh::pixels::PBVHData::clear_data(), count_nodes_to_update(), blender::bke::pbvh::Tree::nodes(), PBVH_RebuildPixels, blender::bke::pbvh::Tree::pixels_, blender::Vector< T, InlineBufferCapacity, Allocator >::reserve(), and should_pixels_be_updated().

Referenced by update_pixels().

◆ get_bounds()

static rcti blender::bke::pbvh::pixels::get_bounds ( const Edge< CoordSpace::Tile > & tile_edge)
static

◆ mark_image_dirty()

◆ node_data_get()

◆ should_pixels_be_updated()

static bool blender::bke::pbvh::pixels::should_pixels_be_updated ( const Node & node)
static

Definition at line 218 of file pbvh_pixels.cc.

References PBVH_Leaf, PBVH_RebuildPixels, and PBVH_TexLeaf.

Referenced by count_nodes_to_update(), and find_nodes_to_update().

◆ update_geom_primitives()

static void blender::bke::pbvh::pixels::update_geom_primitives ( Tree & pbvh,
const uv_islands::MeshData & mesh_data )
static

◆ update_pixels()

Variable Documentation

◆ THREADING_GRAIN_SIZE

const int blender::bke::pbvh::pixels::THREADING_GRAIN_SIZE = 128

◆ USE_WATERTIGHT_CHECK

bool blender::bke::pbvh::pixels::USE_WATERTIGHT_CHECK = false
constexpr

During debugging this check could be enabled. It will write to each image pixel that is covered by the Tree.

Definition at line 59 of file pbvh_pixels.cc.