OpenShot Audio Library | OpenShotAudio: juce::CatmullRomInterpolator Class Reference

OpenShot Audio Library | OpenShotAudio 0.3.2

Loading...
Searching...
No Matches
Public Member Functions | List of all members
juce::CatmullRomInterpolator Class Reference

`#include <juce_CatmullRomInterpolator.h>`

## Public Member Functions
| CatmullRomInterpolator (CatmullRomInterpolator &&) noexcept=default
CatmullRomInterpolator & | operator= (CatmullRomInterpolator &&) noexcept=default
void | reset () noexcept
int | process (double speedRatio, const float *inputSamples, float *outputSamples, int numOutputSamplesToProduce) noexcept
int | process (double speedRatio, const float *inputSamples, float *outputSamples, int numOutputSamplesToProduce, int available, int wrapAround) noexcept
int | processAdding (double speedRatio, const float *inputSamples, float *outputSamples, int numOutputSamplesToProduce, float gain) noexcept
int | processAdding (double speedRatio, const float *inputSamples, float *outputSamples, int numOutputSamplesToProduce, int available, int wrapAround, float gain) noexcept

## Detailed Description

Interpolator for resampling a stream of floats using Catmull-Rom interpolation.

Note that the resampler is stateful, so when there's a break in the continuity of the input stream you're feeding it, you should call reset() before feeding it any new data. And like with any other stateful filter, if you're resampling multiple channels, make sure each one uses its own CatmullRomInterpolator object.

See also
  LagrangeInterpolator

Definition at line 39 of file juce_CatmullRomInterpolator.h.

## Constructor & Destructor Documentation

## ◆ CatmullRomInterpolator()

juce::CatmullRomInterpolator::CatmullRomInterpolator | ( |  | ) |
| noexcept

Definition at line 44 of file juce_CatmullRomInterpolator.cpp.

## ◆ ~CatmullRomInterpolator()

juce::CatmullRomInterpolator::~CatmullRomInterpolator | ( |  | ) |
| noexcept

Definition at line 45 of file juce_CatmullRomInterpolator.cpp.

## Member Function Documentation

## ◆ process() [1/2]

int juce::CatmullRomInterpolator::process | ( | double | speedRatio,
|  | const float * | inputSamples,
|  | float * | outputSamples,
|  | int | numOutputSamplesToProduce
| ) |  |
| noexcept

Resamples a stream of samples.

Parameters

  speedRatio | the number of input samples to use for each output sample
  inputSamples | the source data to read from. This must contain at least (speedRatio * numOutputSamplesToProduce) samples.
  outputSamples | the buffer to write the results into
  numOutputSamplesToProduce | the number of output samples that should be created

Returns
  the actual number of input samples that were used

Definition at line 60 of file juce_CatmullRomInterpolator.cpp.

## ◆ process() [2/2]

int juce::CatmullRomInterpolator::process | ( | double | speedRatio,
|  | const float * | inputSamples,
|  | float * | outputSamples,
|  | int | numOutputSamplesToProduce,
|  | int | available,
|  | int | wrapAround
| ) |  |
| noexcept

Resamples a stream of samples.

Parameters

  speedRatio | the number of input samples to use for each output sample
  inputSamples | the source data to read from. This must contain at least (speedRatio * numOutputSamplesToProduce) samples.
  outputSamples | the buffer to write the results into
  numOutputSamplesToProduce | the number of output samples that should be created
  available | the number of available input samples. If it needs more samples than available, it either wraps back for wrapAround samples, or it feeds zeroes
  wrapAround | if the stream exceeds available samples, it wraps back for wrapAround samples. If wrapAround is set to 0, it will feed zeroes.

Returns
  the actual number of input samples that were used

Definition at line 55 of file juce_CatmullRomInterpolator.cpp.

## ◆ processAdding() [1/2]

int juce::CatmullRomInterpolator::processAdding | ( | double | speedRatio,
|  | const float * | inputSamples,
|  | float * | outputSamples,
|  | int | numOutputSamplesToProduce,
|  | float | gain
| ) |  |
| noexcept

Resamples a stream of samples, adding the results to the output data with a gain.

Parameters

  speedRatio | the number of input samples to use for each output sample
  inputSamples | the source data to read from. This must contain at least (speedRatio * numOutputSamplesToProduce) samples.
  outputSamples | the buffer to write the results to - the result values will be added to any pre-existing data in this buffer after being multiplied by the gain factor
  numOutputSamplesToProduce | the number of output samples that should be created
  gain | a gain factor to multiply the resulting samples by before adding them to the destination buffer

Returns
  the actual number of input samples that were used

Definition at line 70 of file juce_CatmullRomInterpolator.cpp.

## ◆ processAdding() [2/2]

int juce::CatmullRomInterpolator::processAdding | ( | double | speedRatio,
|  | const float * | inputSamples,
|  | float * | outputSamples,
|  | int | numOutputSamplesToProduce,
|  | int | available,
|  | int | wrapAround,
|  | float | gain
| ) |  |
| noexcept

Resamples a stream of samples, adding the results to the output data with a gain.

Parameters

  speedRatio | the number of input samples to use for each output sample
  inputSamples | the source data to read from. This must contain at least (speedRatio * numOutputSamplesToProduce) samples.
  outputSamples | the buffer to write the results to - the result values will be added to any pre-existing data in this buffer after being multiplied by the gain factor
  numOutputSamplesToProduce | the number of output samples that should be created
  available | the number of available input samples. If it needs more samples than available, it either wraps back for wrapAround samples, or it feeds zeroes
  wrapAround | if the stream exceeds available samples, it wraps back for wrapAround samples. If wrapAround is set to 0, it will feed zeroes.
  gain | a gain factor to multiply the resulting samples by before adding them to the destination buffer

Returns
  the actual number of input samples that were used

Definition at line 65 of file juce_CatmullRomInterpolator.cpp.

## ◆ reset()

void juce::CatmullRomInterpolator::reset | ( |  | ) |
| noexcept

Resets the state of the interpolator. Call this when there's a break in the continuity of the input data stream.

Definition at line 47 of file juce_CatmullRomInterpolator.cpp.

The documentation for this class was generated from the following files:

- juce_CatmullRomInterpolator.h
- juce_CatmullRomInterpolator.cpp