Blender V4.3
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)
 
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])
 

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 39 of file voxel.c.

References b.

Referenced by BLI_voxel_sample_trilinear().

◆ BLI_voxel_sample_trilinear()

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

Definition at line 44 of file voxel.c.

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

◆ D()

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

Definition at line 14 of file voxel.c.

References BLI_VOXEL_INDEX, CLAMP, and z().

◆ FLOORI()

BLI_INLINE int FLOORI ( float x)

Definition at line 25 of file voxel.c.

References float, and int.

Referenced by BLI_voxel_sample_trilinear().