AVIR
High-quality pro image resizing library
 
Loading...
Searching...
No Matches
avir::CImageResizerDithererErrdINL< fptype > Class Template Reference

Image resizer's error-diffusion dithering class, interleaved mode. More...

#include <avir.h>

Inheritance diagram for avir::CImageResizerDithererErrdINL< fptype >:
avir::CImageResizerDithererDefINL< fptype >

Public Member Functions

void dither (fptype *const ResScanline)
 Performs rounding and clipping operations, in-place.
 
void init (const int aLen, const CImageResizerVars &aVars, const double aTrMul, const double aPkOut)
 Initializes the ditherer object.
 
- Public Member Functions inherited from avir::CImageResizerDithererDefINL< fptype >
void dither (fptype *const ResScanline) const
 Performs rounding and clipping operations, in-place.
 
void init (const int aLen, const CImageResizerVars &aVars, const double aTrMul, const double aPkOut)
 Initializes the ditherer object.
 

Static Public Member Functions

static bool isRecursive ()
 Returns true, if dithering is recursive relative to scanlines, meaning multi-threaded execution is not supported by this dithering method.
 
- Static Public Member Functions inherited from avir::CImageResizerDithererDefINL< fptype >
static bool isRecursive ()
 Returns true, if dithering is recursive relative to scanlines, meaning multi-threaded execution is not supported by this dithering method.
 

Protected Attributes

fptype * ResScanlineDith
 Error diffusion buffer pointer which skips the first ElCount elements.
 
CBuffer< fptype > ResScanlineDith0
 Error diffusion buffer.
 
- Protected Attributes inherited from avir::CImageResizerDithererDefINL< fptype >
int Len
 Scanline's length in pixels.
 
int LenE
 = LenE * ElCount.
 
double PkOut0
 Peak output value allowed.
 
double TrMul0
 Bit-depth truncation multiplier.
 
const CImageResizerVarsVars
 Image resizing-related variables.
 

Detailed Description

template<typename fptype>
class avir::CImageResizerDithererErrdINL< fptype >

Image resizer's error-diffusion dithering class, interleaved mode.

This ditherer implements error-diffusion dithering which looks good, and whose results are compressed by PNG well. This implementation uses weighting coefficients obtained via machine optimization and visual evaluation.

Template Parameters
fptypeFloating point type to use for storing pixel data. SIMD types can be used.

Member Function Documentation

◆ dither()

template<typename fptype>
void avir::CImageResizerDithererErrdINL< fptype >::dither ( fptype *const ResScanline)

Performs rounding and clipping operations, in-place.

Parameters
[in,out]ResScanlineThe buffer containing the final scanline.

◆ init()

template<typename fptype>
void avir::CImageResizerDithererErrdINL< fptype >::init ( const int aLen,
const CImageResizerVars & aVars,
const double aTrMul,
const double aPkOut )

Initializes the ditherer object.

Parameters
aLenScanline length in pixels to process.
aVarsImage resizing-related variables.
aTrMulBit-depth truncation multiplier. 1 - no additional truncation.
aPkOutPeak output value allowed.

◆ isRecursive()

template<typename fptype>
static bool avir::CImageResizerDithererErrdINL< fptype >::isRecursive ( )
static

Returns true, if dithering is recursive relative to scanlines, meaning multi-threaded execution is not supported by this dithering method.