Blender  V3.3
Functions
voxel.c File Reference
#include "BLI_utildefines.h"
#include "BLI_voxel.h"
#include "BLI_strict_flags.h"

Go to the source code of this file.

Functions

BLI_INLINE float D (const float *data, const int res[3], int x, int y, int z)
 
float BLI_voxel_sample_nearest (const float *data, const int res[3], const float co[3])
 
BLI_INLINE int FLOORI (float x)
 
BLI_INLINE int64_t _clamp (int a, int b, int c)
 
float BLI_voxel_sample_trilinear (const float *data, const int res[3], const float co[3])
 
float BLI_voxel_sample_triquadratic (const float *data, const int res[3], const float co[3])
 
float BLI_voxel_sample_tricubic (const float *data, const int res[3], const float co[3], int bspline)
 

Function Documentation

◆ _clamp()

BLI_INLINE int64_t _clamp ( int  a,
int  b,
int  c 
)

clamp function, cannot use the CLAMPIS macro, it sometimes returns unwanted results apparently related to gcc optimization flag -fstrict-overflow which is enabled at -O2

this causes the test (x + 2) < 0 with int x == 2147483647 to return false (x being an integer, x + 2 should wrap around to -2147483647 so the test < 0 should return true, which it doesn't).

Definition at line 49 of file voxel.c.

References Freestyle::a, usdtokens::b(), and Freestyle::c.

Referenced by BLI_voxel_sample_tricubic(), BLI_voxel_sample_trilinear(), and BLI_voxel_sample_triquadratic().

◆ BLI_voxel_sample_nearest()

float BLI_voxel_sample_nearest ( const float data,
const int  res[3],
const float  co[3] 
)

Definition at line 23 of file voxel.c.

References D(), and data.

◆ BLI_voxel_sample_tricubic()

float BLI_voxel_sample_tricubic ( const float data,
const int  res[3],
const float  co[3],
int  bspline 
)

Definition at line 150 of file voxel.c.

References _clamp(), data, float(), FLOORI(), v, w(), x, y, and z.

◆ BLI_voxel_sample_trilinear()

float BLI_voxel_sample_trilinear ( const float data,
const int  res[3],
const float  co[3] 
)

Definition at line 54 of file voxel.c.

References _clamp(), data, float(), FLOORI(), v, w(), x, y, and z.

◆ BLI_voxel_sample_triquadratic()

float BLI_voxel_sample_triquadratic ( const float data,
const int  res[3],
const float  co[3] 
)

Definition at line 95 of file voxel.c.

References _clamp(), data, float(), FLOORI(), v, w(), x, y, and z.

◆ D()

BLI_INLINE float D ( const float data,
const int  res[3],
int  x,
int  y,
int  z 
)

Definition at line 13 of file voxel.c.

References BLI_VOXEL_INDEX, CLAMP, data, x, y, and z.

Referenced by assign_final_coords_from_mdisps(), assign_final_elements_from_orig_mdisps(), BKE_subdiv_eval_final_point(), BLI_voxel_sample_nearest(), bsdf_ashikhmin_velvet_eval_reflect(), bsdf_ashikhmin_velvet_sample(), bsdf_microfacet_beckmann_eval_reflect(), bsdf_microfacet_beckmann_eval_transmit(), bsdf_microfacet_beckmann_sample(), bsdf_microfacet_ggx_eval_reflect(), bsdf_microfacet_ggx_eval_transmit(), bsdf_microfacet_ggx_sample(), btDoSimplex4(), camera_sample_orthographic(), camera_sample_panorama(), camera_sample_perspective(), differential_incoming_compact(), differential_make_compact(), direction_from_cosine(), distant_light_sample(), evaluate_vertex_and_apply_displacement_copy(), evaluate_vertex_and_apply_displacement_interpolate(), feline_eval(), henyey_greenstrein_sample(), integrate_distant_lights(), integrate_light(), integrate_surface_bsdf_bssrdf_bounce(), integrator_eval_background_shader(), integrator_state_read_ray(), integrator_state_read_shadow_ray(), integrator_state_write_ray(), integrator_state_write_shadow_ray(), kernel_displace_evaluate(), light_sample(), light_spread_attenuation(), md5_process_block(), mf_ggx_aniso_pdf(), mf_ggx_pdf(), mf_glass_pdf(), mf_sampleP22_11(), microfacet_ggx_sample_slopes(), multires_reshape_apply_base_update_mesh_coords(), object_dir_transform(), object_grid_element_to_tangent_displacement(), object_inverse_dir_transform(), pdf_uniform_cone(), reshape_subdiv_refine_orig_P(), QuadDice::scale_factor(), SolveP2(), SolveP4Bi(), spherical_stereo_transform(), subdiv_accumulate_vertex_displacement(), subdiv_mesh_vertex_corner(), subsurface_random_walk(), subsurface_random_walk_remap(), blender::tests::TEST(), and Camera::world_to_raster_size().

◆ FLOORI()

BLI_INLINE int FLOORI ( float  x)

Definition at line 35 of file voxel.c.

References float(), r, and x.

Referenced by BLI_voxel_sample_tricubic(), BLI_voxel_sample_trilinear(), and BLI_voxel_sample_triquadratic().