Audacity 3.2.0
|
Utility class to calculate sample range for a given column. More...
#include <PixelSampleMapper.h>
Classes | |
struct | LinearMapper |
Public Types | |
using | CustomMapper = std::function< sampleCount(uint32_t)> |
Public Member Functions | |
PixelSampleMapper ()=default | |
PixelSampleMapper (const PixelSampleMapper &)=default | |
PixelSampleMapper (PixelSampleMapper &&)=default | |
PixelSampleMapper & | operator= (const PixelSampleMapper &)=default |
PixelSampleMapper & | operator= (PixelSampleMapper &&)=default |
PixelSampleMapper (double t0, double rate, double samplesPerPixel) noexcept | |
void | applyBias (double bias) noexcept |
double | applyCorrection (const PixelSampleMapper &oldMapper, size_t oldLen, size_t newLen) |
sampleCount | GetFirstSample (uint32_t column) const |
sampleCount | GetLastSample (uint32_t column) const |
std::pair< sampleCount, sampleCount > | GetSampleRange (uint32_t column) const |
void | setCustomMapper (CustomMapper mapper) |
bool | IsValid () const |
bool | IsLinear () const noexcept |
Private Attributes | |
std::variant< LinearMapper, CustomMapper > | mMapper { LinearMapper {} } |
Utility class to calculate sample range for a given column.
Audacity: A Digital Audio Editor
Dmitry Vedenko
Definition at line 22 of file PixelSampleMapper.h.
using PixelSampleMapper::CustomMapper = std::function<sampleCount(uint32_t)> |
Definition at line 42 of file PixelSampleMapper.h.
|
default |
|
default |
|
default |
|
noexcept |
Audacity: A Digital Audio Editor
Dmitry Vedenko
Definition at line 19 of file PixelSampleMapper.cpp.
|
noexcept |
Definition at line 26 of file PixelSampleMapper.cpp.
double PixelSampleMapper::applyCorrection | ( | const PixelSampleMapper & | oldMapper, |
size_t | oldLen, | ||
size_t | newLen | ||
) |
Definition at line 34 of file PixelSampleMapper.cpp.
References min(), PixelSampleMapper::LinearMapper::mInitialValue, mMapper, and PixelSampleMapper::LinearMapper::mSamplesPerPixel.
sampleCount PixelSampleMapper::GetFirstSample | ( | uint32_t | column | ) | const |
Definition at line 96 of file PixelSampleMapper.cpp.
References mMapper, and Variant::Visit().
Referenced by GetLastSample(), and GetSampleRange().
sampleCount PixelSampleMapper::GetLastSample | ( | uint32_t | column | ) | const |
Definition at line 102 of file PixelSampleMapper.cpp.
References GetFirstSample().
Referenced by GetSampleRange().
std::pair< sampleCount, sampleCount > PixelSampleMapper::GetSampleRange | ( | uint32_t | column | ) | const |
Definition at line 108 of file PixelSampleMapper.cpp.
References GetFirstSample(), and GetLastSample().
|
noexcept |
Definition at line 123 of file PixelSampleMapper.cpp.
References mMapper.
bool PixelSampleMapper::IsValid | ( | ) | const |
Definition at line 118 of file PixelSampleMapper.cpp.
References mMapper, and Variant::Visit().
|
default |
|
default |
void PixelSampleMapper::setCustomMapper | ( | CustomMapper | mapper | ) |
Definition at line 113 of file PixelSampleMapper.cpp.
References mMapper.
|
private |
Definition at line 69 of file PixelSampleMapper.h.
Referenced by applyCorrection(), GetFirstSample(), IsLinear(), IsValid(), and setCustomMapper().