The Battle for Wesnoth  1.19.5+dev
Classes | Enumerations | Functions | Variables
xbrz Namespace Reference

Classes

struct  ScalerCfg
 

Enumerations

enum class  ColorFormat { RGB , ARGB , ARGB_UNBUFFERED }
 

Functions

void scale (size_t factor, const uint32_t *src, uint32_t *trg, int srcWidth, int srcHeight, ColorFormat colFmt, const ScalerCfg &cfg=ScalerCfg(), int yFirst=0, int yLast=std::numeric_limits< int >::max())
 
void bilinearScale (const uint32_t *src, int srcWidth, int srcHeight, uint32_t *trg, int trgWidth, int trgHeight)
 
void nearestNeighborScale (const uint32_t *src, int srcWidth, int srcHeight, uint32_t *trg, int trgWidth, int trgHeight)
 
bool equalColorTest (uint32_t col1, uint32_t col2, ColorFormat colFmt, double luminanceWeight, double equalColorTolerance)
 
template<uint32_t N>
unsigned char getByte (uint32_t val)
 
unsigned char getAlpha (uint32_t pix)
 
unsigned char getRed (uint32_t pix)
 
unsigned char getGreen (uint32_t pix)
 
unsigned char getBlue (uint32_t pix)
 
uint32_t makePixel (unsigned char a, unsigned char r, unsigned char g, unsigned char b)
 
uint32_t makePixel (unsigned char r, unsigned char g, unsigned char b)
 
uint32_t rgb555to888 (uint16_t pix)
 
uint32_t rgb565to888 (uint16_t pix)
 
uint16_t rgb888to555 (uint32_t pix)
 
uint16_t rgb888to565 (uint32_t pix)
 
template<class Pix >
Pix * byteAdvance (Pix *ptr, int bytes)
 
template<class Pix >
void fillBlock (Pix *trg, int pitch, Pix col, int blockWidth, int blockHeight)
 
template<class PixSrc , class PixTrg , class PixConverter >
void nearestNeighborScale (const PixSrc *src, int srcWidth, int srcHeight, int srcPitch, PixTrg *trg, int trgWidth, int trgHeight, int trgPitch, int yFirst, int yLast, PixConverter pixCvrt)
 
template<class PixSrc , class PixTrg , class PixConverter >
void nearestNeighborScaleOverSource (const PixSrc *src, int srcWidth, int srcHeight, int srcPitch, PixTrg *trg, int trgWidth, int trgHeight, int trgPitch, int yFirst, int yLast, PixConverter pixCvrt)
 
template<class PixTrg , class PixConverter >
void bilinearScale (const uint32_t *src, int srcWidth, int srcHeight, int srcPitch, PixTrg *trg, int trgWidth, int trgHeight, int trgPitch, int yFirst, int yLast, PixConverter pixCvrt)
 

Variables

const int SCALE_FACTOR_MAX = 6
 

Enumeration Type Documentation

◆ ColorFormat

enum xbrz::ColorFormat
strong
Enumerator
RGB 
ARGB 
ARGB_UNBUFFERED 

Definition at line 43 of file xbrz.hpp.

Function Documentation

◆ bilinearScale() [1/2]

template<class PixTrg , class PixConverter >
void xbrz::bilinearScale ( const uint32_t *  src,
int  srcWidth,
int  srcHeight,
int  srcPitch,
PixTrg *  trg,
int  trgWidth,
int  trgHeight,
int  trgPitch,
int  yFirst,
int  yLast,
PixConverter  pixCvrt 
)

Definition at line 164 of file xbrz_tools.hpp.

References b, byteAdvance(), g, and src.

◆ bilinearScale() [2/2]

void xbrz::bilinearScale ( const uint32_t *  src,
int  srcWidth,
int  srcHeight,
uint32_t *  trg,
int  trgWidth,
int  trgHeight 
)

Definition at line 1249 of file xbrz.cpp.

References src.

◆ byteAdvance()

template<class Pix >
Pix* xbrz::byteAdvance ( Pix *  ptr,
int  bytes 
)
inline

◆ equalColorTest()

bool xbrz::equalColorTest ( uint32_t  col1,
uint32_t  col2,
ColorFormat  colFmt,
double  luminanceWeight,
double  equalColorTolerance 
)

Definition at line 1233 of file xbrz.cpp.

References ARGB, ARGB_UNBUFFERED, and RGB.

◆ fillBlock()

template<class Pix >
void xbrz::fillBlock ( Pix *  trg,
int  pitch,
Pix  col,
int  blockWidth,
int  blockHeight 
)
inline

Definition at line 59 of file xbrz_tools.hpp.

References byteAdvance().

Referenced by nearestNeighborScaleOverSource().

◆ getAlpha()

unsigned char xbrz::getAlpha ( uint32_t  pix)
inline

Definition at line 30 of file xbrz_tools.hpp.

◆ getBlue()

unsigned char xbrz::getBlue ( uint32_t  pix)
inline

Definition at line 33 of file xbrz_tools.hpp.

◆ getByte()

template<uint32_t N>
unsigned char xbrz::getByte ( uint32_t  val)
inline

Definition at line 28 of file xbrz_tools.hpp.

◆ getGreen()

unsigned char xbrz::getGreen ( uint32_t  pix)
inline

Definition at line 32 of file xbrz_tools.hpp.

◆ getRed()

unsigned char xbrz::getRed ( uint32_t  pix)
inline

Definition at line 31 of file xbrz_tools.hpp.

◆ makePixel() [1/2]

uint32_t xbrz::makePixel ( unsigned char  a,
unsigned char  r,
unsigned char  g,
unsigned char  b 
)
inline

Definition at line 35 of file xbrz_tools.hpp.

References b, and g.

◆ makePixel() [2/2]

uint32_t xbrz::makePixel ( unsigned char  r,
unsigned char  g,
unsigned char  b 
)
inline

Definition at line 36 of file xbrz_tools.hpp.

References b, and g.

◆ nearestNeighborScale() [1/2]

template<class PixSrc , class PixTrg , class PixConverter >
void xbrz::nearestNeighborScale ( const PixSrc *  src,
int  srcWidth,
int  srcHeight,
int  srcPitch,
PixTrg *  trg,
int  trgWidth,
int  trgHeight,
int  trgPitch,
int  yFirst,
int  yLast,
PixConverter  pixCvrt 
)

Definition at line 72 of file xbrz_tools.hpp.

References byteAdvance(), and src.

◆ nearestNeighborScale() [2/2]

void xbrz::nearestNeighborScale ( const uint32_t *  src,
int  srcWidth,
int  srcHeight,
uint32_t *  trg,
int  trgWidth,
int  trgHeight 
)

Definition at line 1258 of file xbrz.cpp.

References src.

◆ nearestNeighborScaleOverSource()

template<class PixSrc , class PixTrg , class PixConverter >
void xbrz::nearestNeighborScaleOverSource ( const PixSrc *  src,
int  srcWidth,
int  srcHeight,
int  srcPitch,
PixTrg *  trg,
int  trgWidth,
int  trgHeight,
int  trgPitch,
int  yFirst,
int  yLast,
PixConverter  pixCvrt 
)

Definition at line 109 of file xbrz_tools.hpp.

References byteAdvance(), fillBlock(), and src.

◆ rgb555to888()

uint32_t xbrz::rgb555to888 ( uint16_t  pix)
inline

Definition at line 38 of file xbrz_tools.hpp.

◆ rgb565to888()

uint32_t xbrz::rgb565to888 ( uint16_t  pix)
inline

Definition at line 39 of file xbrz_tools.hpp.

◆ rgb888to555()

uint16_t xbrz::rgb888to555 ( uint32_t  pix)
inline

Definition at line 41 of file xbrz_tools.hpp.

◆ rgb888to565()

uint16_t xbrz::rgb888to565 ( uint32_t  pix)
inline

Definition at line 42 of file xbrz_tools.hpp.

◆ scale()

void xbrz::scale ( size_t  factor,
const uint32_t *  src,
uint32_t *  trg,
int  srcWidth,
int  srcHeight,
ColorFormat  colFmt,
const ScalerCfg cfg = ScalerCfg(),
int  yFirst = 0,
int  yLast = std::numeric_limits<int>::max() 
)

Variable Documentation

◆ SCALE_FACTOR_MAX

const int xbrz::SCALE_FACTOR_MAX = 6

Definition at line 50 of file xbrz.hpp.

Referenced by scale(), and scale_surface_xbrz().