Audacity 3.2.0
Public Member Functions | Public Attributes | List of all members
PixelSampleMapper::LinearMapper Struct Referencefinal

Public Member Functions

 LinearMapper () noexcept
 
 LinearMapper (double initialValue, double samplesPerPixel) noexcept
 
 LinearMapper (const LinearMapper &)=default
 
sampleCount operator() (uint32_t column) const noexcept
 
 operator bool () const noexcept
 

Public Attributes

double mInitialValue {}
 
double mSamplesPerPixel {}
 

Detailed Description

Definition at line 49 of file PixelSampleMapper.h.

Constructor & Destructor Documentation

◆ LinearMapper() [1/3]

PixelSampleMapper::LinearMapper::LinearMapper ( )
inlinenoexcept

Definition at line 52 of file PixelSampleMapper.h.

52{}

◆ LinearMapper() [2/3]

PixelSampleMapper::LinearMapper::LinearMapper ( double  initialValue,
double  samplesPerPixel 
)
inlinenoexcept

Definition at line 54 of file PixelSampleMapper.h.

55 : mInitialValue(initialValue)
56 , mSamplesPerPixel(samplesPerPixel)
57 {}

◆ LinearMapper() [3/3]

PixelSampleMapper::LinearMapper::LinearMapper ( const LinearMapper )
default

Member Function Documentation

◆ operator bool()

PixelSampleMapper::LinearMapper::operator bool ( ) const
explicitnoexcept

Definition at line 137 of file PixelSampleMapper.cpp.

138{
139 return mSamplesPerPixel > 0.0;
140}

◆ operator()()

sampleCount PixelSampleMapper::LinearMapper::operator() ( uint32_t  column) const
noexcept

Definition at line 129 of file PixelSampleMapper.cpp.

130{
131 // Previous code used floor, but "required" mInitialValue to be positive.
132 // For positive values, let's just trunc the value, as it is at least twice
133 // as fast.
134 return sampleCount(mInitialValue + column * mSamplesPerPixel);
135}
Positions or offsets within audio files need a wide type.
Definition: SampleCount.h:19

Member Data Documentation

◆ mInitialValue

double PixelSampleMapper::LinearMapper::mInitialValue {}

Definition at line 61 of file PixelSampleMapper.h.

Referenced by PixelSampleMapper::applyCorrection().

◆ mSamplesPerPixel

double PixelSampleMapper::LinearMapper::mSamplesPerPixel {}

Definition at line 62 of file PixelSampleMapper.h.

Referenced by PixelSampleMapper::applyCorrection().


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