#include <plfilterquantize.h>
Inheritance diagram for PLFilterQuantize:
Public Member Functions | |
PLFilterQuantize (int DitherPaletteType, int DitherType) | |
DitherPaletteType and DitherType determine the type of quantization:. | |
virtual | ~PLFilterQuantize () |
virtual void | Apply (PLBmp *pBmpSource, PLBmp *pBmpDest) const |
Applies the Filter to pBmpSource and stores the result in pBmpDest. | |
void | SetUserPalette (const PLPixel32 *pPal) |
For PLDTHPAL_USERDEFINED, sets the palette to use. | |
Static Public Member Functions | |
const PLPixel32 * | GetDefaultPalette () |
Private Types | |
typedef PLFilterQuantize::tagQUBOX | QUBOX |
typedef PLFilterQuantize::tagHISTONODE | HISTONODE |
Private Member Functions | |
void | initLUT () |
void | deleteLUT () |
void | genMedianPalette (PLBmp *pBmpSource, PLBmp *pBmpDest) const |
void | split (QUBOX *pBox0, QUBOX *pBox1, int ColComp) const |
void | squeeze (QUBOX *pBox) const |
void | genPopularityPalette (PLBmp *pBmpSource, PLBmp *pBmpDest) const |
void | genColorArray (PLBmp *pBmpSource) const |
void | genDefaultPalette (PLBmp *pBmpSource) const |
void | addColor (PLPixel32 col, PLULONG count) const |
void | makeBox (PLPixel32 col, int i, PLULONG c) const |
int | getColorTableIndex (PLPixel32 col) const |
int | getShiftedColorTableIndex (PLPixel32 col) const |
void | ditherDestBmp (PLBmp *pBmpSource, PLBmp *pBmpDest) const |
void | jitterPixel (int i, int y, PLPixel32 *pPixel) const |
void | ditherPixelOrdered (int x, int y, PLPixel32 *pPixel) const |
void | ditherCompOrdered (int x, int y, PLBYTE *pComp) const |
void | ditherPixelFS (double *pR, double *pG, double *pB, double *pCurErrors) const |
void | ditherCompFS (double *pComp, double Error) const |
PLBYTE | getNeighbor (PLPixel32 Color, PLPixel32 *pPal) const |
int | colorDist (PLPixel32 c0, PLPixel32 c1) const |
int | clip (int c) const |
Private Attributes | |
int | m_DitherPaletteType |
int | m_DitherType |
PLPixel32 * | m_pUserPal |
HISTONODE ** | m_ppHisto |
QUBOX * | m_pQuBoxes |
Definition at line 34 of file plfilterquantize.h.
|
Referenced by addColor(), genPopularityPalette(), getNeighbor(), initLUT(), and squeeze(). |
|
|
|
DitherPaletteType and DitherType determine the type of quantization:. PLDTHPAL_MEDIAN (0): Median cut PLDTHPAL_POPULARITY (1): Popularity sort PLDTHPAL_DEFAULT (2): Use default palette PLDTHPAL_USERDEFINED (3): Use palette defined by SetUserPalette(); PLDTH_NONE (0): No dithering PLDTH_ORDERED (1): Ordered dithering PLDTH_FS (2): Floyd-Steinberg dithering Definition at line 40 of file plfilterquantize.cpp. |
Here is the call graph for this function:
|
Definition at line 51 of file plfilterquantize.cpp. References deleteLUT(), and m_pUserPal. |
Here is the call graph for this function:
|
Definition at line 714 of file plfilterquantize.cpp. References PLFilterQuantize::tagHISTONODE::count, getShiftedColorTableIndex(), HISTONODE, PLFilterQuantize::tagHISTONODE::index, m_ppHisto, min, and PLULONG. Referenced by genColorArray(), genMedianPalette(), and genPopularityPalette(). |
Here is the call graph for this function:
|
Applies the Filter to pBmpSource and stores the result in pBmpDest. The base-class version copies the bitmap before calling ApplyInPlace (pBmpDest). Reimplemented from PLFilter. Definition at line 61 of file plfilterquantize.cpp. References PLBmp::Create(), ditherDestBmp(), genColorArray(), genDefaultPalette(), genMedianPalette(), genPopularityPalette(), PLBmp::GetBitsPerPixel(), PLBmp::GetHeight(), PLBmp::GetResolution(), PLBmp::GetWidth(), m_DitherPaletteType, m_pUserPal, PLASSERT, PLDTHPAL_DEFAULT, PLDTHPAL_MEDIAN, PLDTHPAL_POPULARITY, PLDTHPAL_USERDEFINED, and PLBmp::SetPalette(). Referenced by PLBmp::create8BPPCopy(). |
Here is the call graph for this function:
|
Definition at line 115 of file plfilterquantize.h. Referenced by ditherCompOrdered(). |
|
Definition at line 987 of file plfilterquantize.cpp. References PLPixel32::GetB(), PLPixel32::GetG(), and PLPixel32::GetR(). Referenced by getNeighbor(). |
Here is the call graph for this function:
|
Definition at line 127 of file plfilterquantize.cpp. References COLOR_MAX, and m_ppHisto. Referenced by ~PLFilterQuantize(). |
|
Definition at line 938 of file plfilterquantize.cpp. Referenced by ditherPixelFS(). |
|
Definition at line 921 of file plfilterquantize.cpp. References clip(), and PLBYTE. Referenced by ditherPixelOrdered(). |
Here is the call graph for this function:
|
Definition at line 761 of file plfilterquantize.cpp. References ditherPixelFS(), ditherPixelOrdered(), PLPixel32::GetB(), PLPixel32::GetG(), PLBmp::GetHeight(), PLBmp::GetLineArray(), getNeighbor(), PLBmp::GetPalette(), PLPixel32::GetR(), PLBmp::GetWidth(), m_DitherType, PLBYTE, PLDTH_FS, PLDTH_ORDERED, and PLPixel32::Set(). Referenced by Apply(). |
Here is the call graph for this function:
|
Definition at line 931 of file plfilterquantize.cpp. References ditherCompFS(). Referenced by ditherDestBmp(). |
Here is the call graph for this function:
|
Definition at line 912 of file plfilterquantize.cpp. References ditherCompOrdered(), PL_RGBA_BLUE, PL_RGBA_GREEN, PL_RGBA_RED, and PLBYTE. Referenced by ditherDestBmp(). |
Here is the call graph for this function:
|
Definition at line 424 of file plfilterquantize.cpp. References addColor(), PLBmp::GetHeight(), PLBmp::GetLineArray32(), and PLBmp::GetWidth(). Referenced by Apply(). |
Here is the call graph for this function:
|
Definition at line 707 of file plfilterquantize.cpp. References DefaultPalette, and PLBmp::GetPalette(). Referenced by Apply(). |
Here is the call graph for this function:
|
Definition at line 143 of file plfilterquantize.cpp. References addColor(), PLFilterQuantize::tagQUBOX::Average, PLFilterQuantize::tagQUBOX::Corner0, PLFilterQuantize::tagQUBOX::Corner1, PLFilterQuantize::tagQUBOX::count, PLPixel32::GetB(), PLPixel32::GetG(), PLBmp::GetPalette(), PLPixel32::GetR(), m_pQuBoxes, makeBox(), PLBYTE, PLPixel32::Set(), split(), and squeeze(). Referenced by Apply(). |
Here is the call graph for this function:
|
Definition at line 349 of file plfilterquantize.cpp. References addColor(), PLFilterQuantize::tagHISTONODE::count, getColorTableIndex(), PLBmp::GetPalette(), HISTONODE, m_ppHisto, PLULONG, PLPixel32::Set(), PLPixel32::SetB(), PLPixel32::SetG(), PLPixel32::SetR(), and SwapLong(). Referenced by Apply(). |
Here is the call graph for this function:
|
Definition at line 745 of file plfilterquantize.cpp. References PLPixel32::GetB(), PLPixel32::GetG(), and PLPixel32::GetR(). Referenced by genPopularityPalette(), and squeeze(). |
Here is the call graph for this function:
|
Definition at line 702 of file plfilterquantize.cpp. |
|
Definition at line 947 of file plfilterquantize.cpp. References colorDist(), PLFilterQuantize::tagHISTONODE::count, getShiftedColorTableIndex(), HISTONODE, PLFilterQuantize::tagHISTONODE::index, m_ppHisto, and PLBYTE. Referenced by ditherDestBmp(). |
Here is the call graph for this function:
|
Definition at line 753 of file plfilterquantize.cpp. References PLPixel32::GetB(), PLPixel32::GetG(), and PLPixel32::GetR(). Referenced by addColor(), and getNeighbor(). |
Here is the call graph for this function:
|
Definition at line 111 of file plfilterquantize.cpp. References COLOR_MAX, HISTONODE, m_ppHisto, m_pQuBoxes, PL_ERRNO_MEMORY, PLULONG, and QUBOX. Referenced by PLFilterQuantize(). |
|
Definition at line 908 of file plfilterquantize.cpp. |
|
Definition at line 738 of file plfilterquantize.cpp. References PLFilterQuantize::tagQUBOX::Corner0, PLFilterQuantize::tagQUBOX::Corner1, PLFilterQuantize::tagQUBOX::count, m_pQuBoxes, and PLULONG. Referenced by genMedianPalette(). |
|
For PLDTHPAL_USERDEFINED, sets the palette to use.
Definition at line 102 of file plfilterquantize.cpp. References m_pUserPal. |
|
Definition at line 244 of file plfilterquantize.cpp. References PLFilterQuantize::tagQUBOX::Average, PLFilterQuantize::tagQUBOX::Corner0, PLFilterQuantize::tagQUBOX::Corner1, PLASSERT, PLBYTE, QUBOX, and squeeze(). Referenced by genMedianPalette(). |
Here is the call graph for this function:
|
Definition at line 280 of file plfilterquantize.cpp. References PLFilterQuantize::tagQUBOX::Average, PLFilterQuantize::tagQUBOX::Corner0, PLFilterQuantize::tagQUBOX::Corner1, PLFilterQuantize::tagQUBOX::count, PLFilterQuantize::tagHISTONODE::count, PLPixel32::GetB(), getColorTableIndex(), PLPixel32::GetG(), PLPixel32::GetR(), HISTONODE, m_ppHisto, max, min, PLBYTE, PLULONG, and QUBOX. Referenced by genMedianPalette(), and split(). |
Here is the call graph for this function:
|
Definition at line 106 of file plfilterquantize.h. Referenced by Apply(). |
|
Definition at line 107 of file plfilterquantize.h. Referenced by ditherDestBmp(). |
|
Definition at line 110 of file plfilterquantize.h. Referenced by addColor(), deleteLUT(), genPopularityPalette(), getNeighbor(), initLUT(), and squeeze(). |
|
Definition at line 112 of file plfilterquantize.h. Referenced by genMedianPalette(), initLUT(), and makeBox(). |
|
Definition at line 108 of file plfilterquantize.h. Referenced by Apply(), SetUserPalette(), and ~PLFilterQuantize(). |