Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::Geometry::CubicKernelWrapper< Kernel > Struct Template Reference

#include <src/libslic3r/Geometry/Bicubic.hpp>

Public Types

typedef Kernel::FloatType FloatType
 

Static Public Member Functions

static FloatType kernel (FloatType x)
 
static FloatType interpolate (FloatType f0, FloatType f1, FloatType f2, FloatType f3, FloatType x)
 

Static Public Attributes

static constexpr size_t kernel_span = 4
 

Detailed Description

template<typename Kernel>
struct Slic3r::Geometry::CubicKernelWrapper< Kernel >

Member Typedef Documentation

◆ FloatType

template<typename Kernel >
typedef Kernel::FloatType Slic3r::Geometry::CubicKernelWrapper< Kernel >::FloatType

Member Function Documentation

◆ interpolate()

template<typename Kernel >
static FloatType Slic3r::Geometry::CubicKernelWrapper< Kernel >::interpolate ( FloatType  f0,
FloatType  f1,
FloatType  f2,
FloatType  f3,
FloatType  x 
)
inlinestatic
216 {
217 const FloatType x2 = x * x;
218 const FloatType x3 = x * x * x;
219 return f0 * (Kernel::a00() + Kernel::a01() * x + Kernel::a02() * x2 + Kernel::a03() * x3) +
220 f1 * (Kernel::a10() + Kernel::a11() * x + Kernel::a12() * x2 + Kernel::a13() * x3) +
221 f2 * (Kernel::a20() + Kernel::a21() * x + Kernel::a22() * x2 + Kernel::a23() * x3) +
222 f3 * (Kernel::a30() + Kernel::a31() * x + Kernel::a32() * x2 + Kernel::a33() * x3);
223 }
TCoord< P > x(const P &p)
Definition geometry_traits.hpp:297
Kernel::FloatType FloatType
Definition Bicubic.hpp:194

◆ kernel()

template<typename Kernel >
static FloatType Slic3r::Geometry::CubicKernelWrapper< Kernel >::kernel ( FloatType  x)
inlinestatic
199 {
200 x = fabs(x);
201 if (x >= (FloatType) 2.)
202 return 0.0f;
203 if (x <= (FloatType) 1.) {
204 FloatType x2 = x * x;
205 FloatType x3 = x2 * x;
206 return Kernel::a10() + Kernel::a11() * x + Kernel::a12() * x2 + Kernel::a13() * x3;
207 }
208 assert(x > (FloatType )1. && x < (FloatType )2.);
209 x -= (FloatType) 1.;
210 FloatType x2 = x * x;
211 FloatType x3 = x2 * x;
212 return Kernel::a00() + Kernel::a01() * x + Kernel::a02() * x2 + Kernel::a03() * x3;
213 }

Member Data Documentation

◆ kernel_span

template<typename Kernel >
constexpr size_t Slic3r::Geometry::CubicKernelWrapper< Kernel >::kernel_span = 4
staticconstexpr

The documentation for this struct was generated from the following file: