Blender  V3.3
Classes | Functions | Variables
blender::bke::pbvh::pixels Namespace Reference

Classes

struct  TrianglePaintInput
 
struct  Triangles
 
struct  PackedPixelRow
 
struct  UDIMTilePixels
 
struct  UDIMTileUndo
 
struct  NodeData
 
struct  EncodePixelsUserData
 

Functions

NodeDataBKE_pbvh_pixels_node_data_get (PBVHNode &node)
 
void BKE_pbvh_pixels_mark_image_dirty (PBVHNode &node, Image &image, ImageUser &image_user)
 
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 int triangle_index, const float2 uvs[3], const int minx, const int miny, const int maxx, const int maxy)
 
static void init_triangles (PBVH *pbvh, PBVHNode *node, NodeData *node_data, const MLoop *mloop)
 
static void do_encode_pixels (void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls))
 
static bool should_pixels_be_updated (PBVHNode *node)
 
static int64_t count_nodes_to_update (PBVH *pbvh)
 
static bool find_nodes_to_update (PBVH *pbvh, Vector< PBVHNode * > &r_nodes_to_update)
 
static void apply_watertight_check (PBVH *pbvh, Image *image, ImageUser *image_user)
 
static void update_pixels (PBVH *pbvh, Mesh *mesh, Image *image, ImageUser *image_user)
 

Variables

constexpr bool USE_WATERTIGHT_CHECK = false
 

Function Documentation

◆ apply_watertight_check()

static void blender::bke::pbvh::pixels::apply_watertight_check ( PBVH pbvh,
Image image,
ImageUser image_user 
)
static

◆ BKE_pbvh_pixels_mark_image_dirty()

void blender::bke::pbvh::pixels::BKE_pbvh_pixels_mark_image_dirty ( PBVHNode node,
Image image,
ImageUser image_user 
)

◆ BKE_pbvh_pixels_node_data_get()

NodeData & blender::bke::pbvh::pixels::BKE_pbvh_pixels_node_data_get ( PBVHNode node)

◆ 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 34 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 47 of file pbvh_pixels.cc.

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

Referenced by do_encode_pixels().

◆ count_nodes_to_update()

static int64_t blender::bke::pbvh::pixels::count_nodes_to_update ( PBVH pbvh)
static

Definition at line 185 of file pbvh_pixels.cc.

References node, PBVH::nodes, result, should_pixels_be_updated(), and PBVH::totnode.

Referenced by find_nodes_to_update().

◆ do_encode_pixels()

static void blender::bke::pbvh::pixels::do_encode_pixels ( void *__restrict  userdata,
const int  n,
const TaskParallelTLS *__restrict   UNUSEDtls 
)
static

◆ extract_barycentric_pixels()

static void blender::bke::pbvh::pixels::extract_barycentric_pixels ( UDIMTilePixels tile_data,
const ImBuf image_buffer,
const int  triangle_index,
const float2  uvs[3],
const int  minx,
const int  miny,
const int  maxx,
const int  maxy 
)
static

◆ find_nodes_to_update()

static bool blender::bke::pbvh::pixels::find_nodes_to_update ( PBVH pbvh,
Vector< PBVHNode * > &  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 206 of file pbvh_pixels.cc.

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

Referenced by update_pixels().

◆ init_triangles()

static void blender::bke::pbvh::pixels::init_triangles ( PBVH pbvh,
PBVHNode node,
NodeData node_data,
const MLoop mloop 
)
static

◆ should_pixels_be_updated()

static bool blender::bke::pbvh::pixels::should_pixels_be_updated ( PBVHNode node)
static

Definition at line 170 of file pbvh_pixels.cc.

References node, PBVH_Leaf, and PBVH_RebuildPixels.

Referenced by count_nodes_to_update(), and find_nodes_to_update().

◆ update_pixels()

static void blender::bke::pbvh::pixels::update_pixels ( PBVH pbvh,
Mesh mesh,
Image image,
ImageUser image_user 
)
static

Variable Documentation

◆ USE_WATERTIGHT_CHECK

constexpr 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 PBVH.

Definition at line 29 of file pbvh_pixels.cc.

Referenced by update_pixels().