Blender V5.0
blender::bke::pbvh::pixels Namespace Reference

Classes

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

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 Vertex< CoordSpace::Tileconvert_coord_space (const Vertex< CoordSpace::UV > &uv_vertex, const image::ImageTileWrapper image_tile, const int2 tile_resolution)
static 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 27 of file pbvh_pixels_copy.cc.

Function Documentation

◆ add_margin()

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

◆ apply_watertight_check()

◆ calc_barycentric_delta()

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 30 of file pbvh_pixels.cc.

References barycentric_weights_v2().

Referenced by calc_barycentric_delta_x().

◆ calc_barycentric_delta_x()

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 43 of file pbvh_pixels.cc.

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

Referenced by do_encode_pixels().

◆ clamp()

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 71 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]

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]

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()

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

Definition at line 230 of file pbvh_pixels.cc.

References result, and should_pixels_be_updated().

Referenced by find_nodes_to_update().

◆ data_get()

PBVHData & blender::bke::pbvh::pixels::data_get ( blender::bke::pbvh::Tree & pbvh)

◆ do_encode_pixels()

◆ extract_barycentric_pixels()

void blender::bke::pbvh::pixels::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

◆ find_nodes_to_update()

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 250 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::Node::RebuildPixels, blender::Vector< T, InlineBufferCapacity, Allocator >::reserve(), and should_pixels_be_updated().

Referenced by update_pixels().

◆ get_bounds()

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

◆ mark_image_dirty()

◆ node_data_get()

◆ should_pixels_be_updated()

◆ update_geom_primitives()

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 57 of file pbvh_pixels.cc.