# E:/DevIL/src-IL/src/il_quantizer.c File Reference

`#include "il_internal.h"`

## Data Structures

struct | Box

## Defines

#define | MAXCOLOR 256
#define | RED 2
#define | GREEN 1
#define | BLUE 0

## Functions

ILuint | n2 (ILint s)
ILboolean | Hist3d (ILubyte *Ir, ILubyte *Ig, ILubyte *Ib, ILint *vwt, ILint *vmr, ILint *vmg, ILint *vmb, ILfloat *m2)
void | M3d (ILint *vwt, ILint *vmr, ILint *vmg, ILint *vmb, ILfloat *m2)
ILint | Vol (Box *cube, ILint mmt[33][33][33])
ILint | Bottom (Box *cube, ILubyte dir, ILint mmt[33][33][33])
ILint | Top (Box *cube, ILubyte dir, ILint pos, ILint mmt[33][33][33])
ILfloat | Var (Box *cube)
ILfloat | Maximize (Box *cube, ILubyte dir, ILint first, ILint last, ILint *cut, ILint whole_r, ILint whole_g, ILint whole_b, ILint whole_w)
ILint | Cut (Box *set1, Box *set2)
void | Mark (struct Box *cube, int label, unsigned char *tag)
ILimage * | iQuantizeImage (ILimage *Image, ILuint NumCols)

## Variables

ILfloat | gm2 [33][33][33]
ILint | wt [33][33][33]
ILint | mr [33][33][33]
ILint | mg [33][33][33]
ILint | mb [33][33][33]
ILuint | size
ILint | K
ILushort * | Qadd
ILint | WindW
ILint | WindH
ILint | WindD
ILint | i
ILubyte * | buffer

## Define Documentation

#define BLUE 0

Referenced by Bottom(), Cut(), and Top().

#define GREEN 1

Referenced by Bottom(), Cut(), and Top().

#define MAXCOLOR 256

Referenced by iQuantizeImage().

#define RED 2

Referenced by Bottom(), Cut(), and Top().

## Function Documentation

ILint Bottom | ( | Box * | cube,
|  | ILubyte | dir,
|  | ILint | mmt[33][33][33] |
| ) |  |  |

Referenced by ilFlipSurfaceDxtcData(), and Maximize().

ILint Cut | ( | Box * | set1,
|  | Box * | set2 |
| ) |  |  |

Referenced by iQuantizeImage().

ILboolean Hist3d | ( | ILubyte * | Ir,
|  | ILubyte * | Ig,
|  | ILubyte * | Ib,
|  | ILint * | vwt,
|  | ILint * | vmr,
|  | ILint * | vmg,
|  | ILint * | vmb,
|  | ILfloat * | m2 |
| ) |  |  |

Referenced by iQuantizeImage().

ILimage* iQuantizeImage | ( | ILimage * | Image,
|  | ILuint | NumCols |
| ) |  |  |

Referenced by iConvertImage(), and iSaveWbmpInternal().

void M3d | ( | ILint * | vwt,
|  | ILint * | vmr,
|  | ILint * | vmg,
|  | ILint * | vmb,
|  | ILfloat * | m2 |
| ) |  |  |

Referenced by iQuantizeImage().

void Mark | ( | struct Box * | cube,
|  | int | label,
|  | unsigned char * | tag |
| ) |  |  |

Referenced by iQuantizeImage().

ILfloat Maximize | ( | Box * | cube,
|  | ILubyte | dir,
|  | ILint | first,
|  | ILint | last,
|  | ILint * | cut,
|  | ILint | whole_r,
|  | ILint | whole_g,
|  | ILint | whole_b,
|  | ILint | whole_w |
| ) |  |  |

Referenced by Cut().

ILuint n2 | ( | ILint | s | ) |

ILint Top | ( | Box * | cube,
|  | ILubyte | dir,
|  | ILint | pos,
|  | ILint | mmt[33][33][33] |
| ) |  |  |

Referenced by ilFlipSurfaceDxtcData(), and Maximize().

ILfloat Var | ( | Box * | cube | ) |

Referenced by iQuantizeImage().

ILint Vol | ( | Box * | cube,
|  | ILint | mmt[33][33][33] |
| ) |  |  |

Referenced by Cut(), iQuantizeImage(), and Var().

## Variable Documentation

ILubyte* buffer

Referenced by iff_read_data(), iQuantizeImage(), and iSaveHdrInternal().

ILfloat gm2[33][33][33]

Referenced by iQuantizeImage(), and Var().

ILint i

Referenced by AssembleImage(), BuildEdgeList(), channelReadMixed(), channelReadPure(), channelReadRaw(), ChooseAlphaEndpoints(), ChooseEndpoints(), Cleanup(), Compress(), CompressTo565(), CompressTo88(), CompressToRXGB(), contest(), ConvertTransparent(), CorrectPreMult(), Decompress3Dc(), DecompressARGB(), DecompressAti1n(), DecompressDXT1(), DecompressDXT3(), DecompressDXT5(), DecompressRXGB(), encLine(), EndianSwapData(), FillScan(), Filter(), GenAlphaBitMask(), GenBitMask(), Get3DcBlock(), get_next_code(), GetAlphaBlock(), GetBigInt(), GetBigUInt(), GetBitsFromMask(), GetBlock(), GetCompChanLen(), GetCubemapInfo(), GetImages(), GetLittleInt(), GetLittleUInt(), GetShiftFromMask(), GifGetData(), Hist3d(), iApplyMatrix(), iBuild1DMipmaps_(), iBuild1DMipmapsVertical_(), iCheckDcx(), iCheckExtension(), iCheckPsd(), ico_readpng_get_image(), iConvertImage(), iConvertPalette(), iConvFloat16ToFloat32(), iExrReadString(), iFastConvert(), iff_decompress_rle(), iff_decompress_tile_rle(), iffReadUncompressedTile(), iFgetw(), iFlip3dc(), iFlipDxt1(), iFlipDxt3(), iFlipDxt5(), iGetDdsHead(), iGetExtension(), iGetOS2Bmp(), iIcnsReadData(), iIntExtImg(), iInvertDxt3Alpha(), iInvertDxt5Alpha(), ilAddAlpha(), ilAddAlphaKey(), ilClearImage_(), ilConvertBuffer(), ilDxtcDataToImage(), ilFixImage(), ilFreeImageDxtcData(), ilGenImage(), ilGetAlpha(), ilImageToDxtcData(), ilInvertSurfaceDxtcDataAlpha(), ilLoadJascPal(), ilModAlpha(), iLoadCutInternal(), iLoadDcxInternal(), iLoadDdsCubemapInternal(), iLoadDoomFlatInternal(), iLoadDoomInternal(), iLoadExrInternal(), iLoadHdrInternal(), iLoadIconInternal(), iLoadIffInternal(), iLoadLifInternal(), iLoadPcdInternal(), iLoadPixInternal(), iLoadSunInternal(), iLoadTplInternal(), iLoadWalInternal(), iLoadWbmpInternal(), iLoadWdpInternal(), iLoadXpmInternal(), ilprintf(), ilReadRLE4Bmp(), ilReadUncompBmp(), ilRemoveAlpha(), ilRleCompress(), ilSaveCHeader(), ilSaveJascPal(), ilSetAlpha(), ilSetError(), ilShutDown(), ilSwapColours(), iluAlienify(), iluBlurAvg(), iluBlurGaussian(), iluColoursUsed(), iluCompareImage(), iluContrast(), iluEdgeDetectP(), iluEdgeDetectS(), iluEqualize(), iluGammaCorrect(), iluInvertAlpha(), iluNegative(), iluNoisify(), iluPixelize(), iluReplaceColour(), iluScaleAlpha(), iluScaleColours(), iluSharpen(), iMemSwap(), iNeuQuant(), initnet(), inxbuild(), inxsearch(), ipad(), iQuantizeImage(), iReadColMapTga(), iReadLump(), iReadNonRleSgi(), iSaveBitmapInternal(), iSaveDdsInternal(), iSaveHdrInternal(), iSaveJp2Internal(), iSavePcxInternal(), iSavePngInternal(), iSavePnmInternal(), iSaveRleSgi(), iSaveSgiInternal(), iSaveTargaInternal(), iSaveWbmpInternal(), iScanFill(), iSunGetRle(), iSwitchTypes(), iUncompressDcx(), iUncompressDcxSmall(), iUncompressPcx(), iUncompressSmall(), iUncompressTgaData(), iWriteLump(), learn(), M3d(), Maximize(), n2(), PbmMaximize(), PreMult(), ReadCMYK(), ReadIndexed(), ReadLayerBlock(), ReadMipmaps(), readpng_get_image(), readScanlines(), RemoveInterlace(), RMSAlpha(), sgiSwitchData(), TplGetIndexImage(), unbiasnet(), UncompRLE(), WbmpGetMultibyte(), WbmpPutMultibyte(), WriteHeader(), XpmDestroyHashTable(), XpmGetColour(), XpmGetInt(), XpmGets(), XpmGetsInternal(), and zoom().

ILint K

Referenced by iQuantizeImage().

ILint mb[33][33][33]

Referenced by Cut(), iQuantizeImage(), Maximize(), and Var().

ILint mg[33][33][33]

Referenced by Cut(), iQuantizeImage(), Maximize(), and Var().

ILint mr[33][33][33]

Referenced by Cut(), iQuantizeImage(), Maximize(), and Var().

ILushort* Qadd

Referenced by Hist3d(), and iQuantizeImage().

ILuint size

Referenced by GifGetData(), Hist3d(), iFlipBuffer(), iFlipNewBuffer(), and iQuantizeImage().

ILint WindD

Referenced by iQuantizeImage().

ILint WindH

Referenced by iQuantizeImage().

ILint WindW

Referenced by iQuantizeImage().

ILint wt[33][33][33]

Referenced by Cut(), iQuantizeImage(), Maximize(), and Var().