File: catmullrom_curve.cpp

package info (click to toggle)
embree 4.3.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 100,656 kB
  • sloc: cpp: 228,918; xml: 40,944; ansic: 2,685; python: 812; sh: 635; makefile: 228; csh: 42
file content (30 lines) | stat: -rw-r--r-- 748 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

#include "catmullrom_curve.h"

namespace embree
{
  PrecomputedCatmullRomBasis::PrecomputedCatmullRomBasis(int dj)
  {
    for (size_t i=1; i<=N; i++) 
    {
      for (size_t j=0; j<=N; j++) 
      {
        const float u = float(j+dj)/float(i);
        const Vec4f f = CatmullRomBasis::eval(u);
        c0[i][j] = f.x;
        c1[i][j] = f.y;
        c2[i][j] = f.z;
        c3[i][j] = f.w;
        const Vec4f d = CatmullRomBasis::derivative(u);
        d0[i][j] = d.x;
        d1[i][j] = d.y;
        d2[i][j] = d.z;
        d3[i][j] = d.w;
      }
    }
  }
  PrecomputedCatmullRomBasis catmullrom_basis0(0);
  PrecomputedCatmullRomBasis catmullrom_basis1(1);
}