Blender  V3.3
Macros | Functions | Variables
math_interp.c File Reference
#include <math.h>
#include "BLI_math.h"
#include "BLI_strict_flags.h"

Go to the source code of this file.

Macros

#define EWA_MAXIDX   255
 

Functions

static float P (float k)
 
static void vector_from_float (const float *data, float vector[4], int components)
 
static void vector_from_byte (const unsigned char *data, float vector[4], int components)
 
BLI_INLINE void bicubic_interpolation (const unsigned char *byte_buffer, const float *float_buffer, unsigned char *byte_output, float *float_output, int width, int height, int components, float u, float v)
 
void BLI_bicubic_interpolation_fl (const float *buffer, float *output, int width, int height, int components, float u, float v)
 
void BLI_bicubic_interpolation_char (const unsigned char *buffer, unsigned char *output, int width, int height, int components, float u, float v)
 
BLI_INLINE void bilinear_interpolation (const unsigned char *byte_buffer, const float *float_buffer, unsigned char *byte_output, float *float_output, int width, int height, int components, float u, float v, bool wrap_x, bool wrap_y)
 
void BLI_bilinear_interpolation_fl (const float *buffer, float *output, int width, int height, int components, float u, float v)
 
void BLI_bilinear_interpolation_char (const unsigned char *buffer, unsigned char *output, int width, int height, int components, float u, float v)
 
void BLI_bilinear_interpolation_wrap_fl (const float *buffer, float *output, int width, int height, int components, float u, float v, bool wrap_x, bool wrap_y)
 
void BLI_bilinear_interpolation_wrap_char (const unsigned char *buffer, unsigned char *output, int width, int height, int components, float u, float v, bool wrap_x, bool wrap_y)
 
static void radangle2imp (float a2, float b2, float th, float *A, float *B, float *C, float *F)
 
void BLI_ewa_imp2radangle (float A, float B, float C, float F, float *a, float *b, float *th, float *ecc)
 
void BLI_ewa_filter (const int width, const int height, const bool intpol, const bool use_alpha, const float uv[2], const float du[2], const float dv[2], ewa_filter_read_pixel_cb read_pixel_cb, void *userdata, float result[4])
 

Variables

const float EWA_WTS [EWA_MAXIDX+1]
 

Macro Definition Documentation

◆ EWA_MAXIDX

#define EWA_MAXIDX   255

Definition at line 502 of file math_interp.c.

Function Documentation

◆ bicubic_interpolation()

BLI_INLINE void bicubic_interpolation ( const unsigned char *  byte_buffer,
const float float_buffer,
unsigned char *  byte_output,
float float_output,
int  width,
int  height,
int  components,
float  u,
float  v 
)

◆ bilinear_interpolation()

BLI_INLINE void bilinear_interpolation ( const unsigned char *  byte_buffer,
const float float_buffer,
unsigned char *  byte_output,
float float_output,
int  width,
int  height,
int  components,
float  u,
float  v,
bool  wrap_x,
bool  wrap_y 
)

◆ BLI_bicubic_interpolation_char()

void BLI_bicubic_interpolation_char ( const unsigned char *  buffer,
unsigned char *  output,
int  width,
int  height,
int  components,
float  u,
float  v 
)

Definition at line 236 of file math_interp.c.

References bicubic_interpolation(), buffer, height, NULL, output, v, and width.

Referenced by bicubic_interpolation_color().

◆ BLI_bicubic_interpolation_fl()

void BLI_bicubic_interpolation_fl ( const float buffer,
float output,
int  width,
int  height,
int  components,
float  u,
float  v 
)

◆ BLI_bilinear_interpolation_char()

void BLI_bilinear_interpolation_char ( const unsigned char *  buffer,
unsigned char *  output,
int  width,
int  height,
int  components,
float  u,
float  v 
)

◆ BLI_bilinear_interpolation_fl()

void BLI_bilinear_interpolation_fl ( const float buffer,
float output,
int  width,
int  height,
int  components,
float  u,
float  v 
)

◆ BLI_bilinear_interpolation_wrap_char()

void BLI_bilinear_interpolation_wrap_char ( const unsigned char *  buffer,
unsigned char *  output,
int  width,
int  height,
int  components,
float  u,
float  v,
bool  wrap_x,
bool  wrap_y 
)

Definition at line 478 of file math_interp.c.

References bilinear_interpolation(), buffer, height, NULL, output, v, and width.

◆ BLI_bilinear_interpolation_wrap_fl()

void BLI_bilinear_interpolation_wrap_fl ( const float buffer,
float output,
int  width,
int  height,
int  components,
float  u,
float  v,
bool  wrap_x,
bool  wrap_y 
)

◆ BLI_ewa_filter()

void BLI_ewa_filter ( int  width,
int  height,
bool  intpol,
bool  use_alpha,
const float  uv[2],
const float  du[2],
const float  dv[2],
ewa_filter_read_pixel_cb  read_pixel_cb,
void userdata,
float  result[4] 
)

TODO(sergey): Consider making this function inlined, so the pixel read callback could also be inlined in order to avoid per-pixel function calls.

Definition at line 584 of file math_interp.c.

References A, Freestyle::a, B, usdtokens::b(), BLI_ewa_imp2radangle(), C, ceilf, EWA_MAXIDX, EWA_WTS, F, float(), floorf, height, madd_v3_v3fl(), mul_v3_fl(), radangle2imp(), result, sqrtf, U, u1, u2, V, v, v1, v2, width, and zero_v4().

Referenced by ewa_eval(), blender::compositor::MemoryBuffer::read_elem_filtered(), and blender::compositor::MemoryBuffer::readEWA().

◆ BLI_ewa_imp2radangle()

void BLI_ewa_imp2radangle ( float  A,
float  B,
float  C,
float  F,
float a,
float b,
float th,
float ecc 
)

Definition at line 554 of file math_interp.c.

References A, Freestyle::a, atan2f, B, usdtokens::b(), C, F, float(), M_PI, r, and sqrtf.

Referenced by BLI_ewa_filter(), and imagewraposa_aniso().

◆ P()

static float P ( float  k)
static

Definition at line 25 of file math_interp.c.

References max_ff().

Referenced by _btMprVec3PointSegmentDist2(), Mesh::add_vertex(), Mesh::add_vertex_slow(), btDeformableCorotatedForce::addScaledElasticForce(), btDeformableLinearElasticityForce::addScaledElasticForce(), btDeformableNeoHookeanForce::addScaledElasticForce(), btDeformableLinearElasticityForce::addScaledHessian(), assign_final_coords_from_mdisps(), assign_final_elements_from_orig_mdisps(), attr_create_motion(), bake_offset_towards_center(), base_surface_grids_write(), bicubic_interpolation(), PointCloud::Point::bounds_grow(), Hair::Curve::bounds_grow(), btMprVec3PointTriDist2(), btVec3PointSegmentDist2(), btVec3PointTriDist2(), libmv::Build_Minimal2Point_PolynomialFactor(), BVH(), bvh_aligned_node_intersect(), bvh_instance_pop(), bvh_instance_push(), bvh_node_intersect(), bvh_unaligned_node_intersect(), bvh_unaligned_node_intersect_child(), camera_direction_from_point(), camera_distance(), camera_sample_orthographic(), camera_sample_panorama(), camera_sample_perspective(), camera_world_to_ndc(), camera_z_depth(), Freestyle::GridHelpers::closestPointToSegment(), Freestyle::OGF::compute_curvature_tensor(), Freestyle::ComputeMaxError(), Mesh::copy_center_to_motion_step(), decasteljau_bicubic(), decasteljau_cubic(), Freestyle::GeomUtils::distPointSegment(), libmv::EliminateRow(), Freestyle::StrokeShaders::CurvePiece::error(), libmv::EuclideanIntersect(), libmv::EuclideanResect(), libmv::euclidean_resection::EuclideanResectionPPnP(), LinearQuadPatch::eval(), BicubicPatch::eval(), QuadDice::eval_projected(), blender::opensubdiv::VolatileEvalOutput< SRC_VERTEX_BUFFER, EVAL_VERTEX_BUFFER, STENCIL_TABLE, PATCH_TABLE, EVALUATOR, DEVICE_CONTEXT >::evalPatches(), blender::opensubdiv::VolatileEvalOutput< SRC_VERTEX_BUFFER, EVAL_VERTEX_BUFFER, STENCIL_TABLE, PATCH_TABLE, EVALUATOR, DEVICE_CONTEXT >::evalPatchesWithDerivatives(), evaluate_higher_grid_positions_callback(), blender::opensubdiv::EvalOutputAPI::evaluateLimit(), blender::opensubdiv::EvalOutputAPI::evaluatePatchesLimit(), export_pointcloud_motion(), libmv::F_FromCorrespondance_2points(), fast_sinpif(), btDeformableCorotatedForce::firstPiola(), btDeformableLinearElasticityForce::firstPiola(), btDeformableNeoHookeanForce::firstPiola(), libmv::FundamentalFrom7CorrespondencesLinear(), OSLRenderServices::get_object_standard_attribute(), GPU_matrix_bind(), Freestyle::GeomUtils::includePointTriangle(), libmv::ProjectiveReconstruction::InsertCamera(), integrate_light(), integrate_surface_bsdf_bssrdf_bounce(), integrator_eval_background_shader(), integrator_init_from_bake(), integrator_state_read_ray(), integrator_state_read_shadow_ray(), integrator_state_write_ray(), integrator_state_write_shadow_ray(), interp_m3_m3m3(), libmv::isInFrontOfCamera(), kernel_displace_evaluate(), CCL_NAMESPACE_BEGIN::kernel_tex_image_interp_3d(), kernel_tex_image_interp_3d(), libmv::KRt_From_P(), light_distribution_sample(), light_distribution_sample_from_position(), light_distribution_sample_from_volume_segment(), light_distribution_sample_new_position(), light_sample(), light_sample_to_surface_shadow_ray(), light_sample_to_volume_shadow_ray(), light_spread_clamp_area_light(), lights_intersect(), mikk_get_position(), motion_triangle_intersect(), motion_triangle_point_from_uv(), multires_reshape_apply_base_update_mesh_coords(), Freestyle::NewtonRaphsonRootFind(), object_grid_element_to_tangent_displacement(), object_inverse_position_transform(), object_position_transform(), Freestyle::VecMat::operator*(), libmv::P_From_KRt(), libmv::Project(), libmv::ProjectionChangeAspectRatio(), libmv::ProjectionShiftPrincipalPoint(), libmv::ProjectiveResect(), ray_aligned_disk_intersect(), ray_disk_intersect(), ray_offset(), ray_optical_depth(), rect_light_sample(), libmv::resection::Resection(), reshape_subdiv_refine(), libmv::RootMeanSquareError(), QuadDice::scale_factor(), set_attribute_float3_3(), EdgeDice::set_vert(), shader_setup_from_displace(), shader_setup_from_sample(), shadow_ray_offset(), shadow_ray_setup(), shadow_ray_smooth_surface_offset(), single_scattering(), Freestyle::OGF::sphere_clip_vector(), sphere_light_sample(), spherical_stereo_transform(), subsurface_disk(), subsurface_random_walk(), svm_node_enter_bump_eval(), OSLRenderServices::texture3d(), OSLRenderServices::trace(), triangle_intersect(), triangle_light_sample(), triangle_point_from_uv(), triangle_point_normal(), triangle_vertices(), triangle_vertices_and_normals(), wireframe(), Camera::world_to_raster_size(), and xml_read_mesh().

◆ radangle2imp()

static void radangle2imp ( float  a2,
float  b2,
float  th,
float A,
float B,
float C,
float F 
)
static

Definition at line 543 of file math_interp.c.

References A, B, C, cosf, F, and sinf.

Referenced by BLI_ewa_filter().

◆ vector_from_byte()

static void vector_from_byte ( const unsigned char *  data,
float  vector[4],
int  components 
)
static

Definition at line 59 of file math_interp.c.

References data.

Referenced by bicubic_interpolation().

◆ vector_from_float()

static void vector_from_float ( const float data,
float  vector[4],
int  components 
)
static

Definition at line 46 of file math_interp.c.

References copy_v3_v3(), copy_v4_v4(), and data.

Referenced by bicubic_interpolation().

Variable Documentation

◆ EWA_WTS

const float EWA_WTS[EWA_MAXIDX+1]

Definition at line 503 of file math_interp.c.

Referenced by BLI_ewa_filter(), and feline_eval().