DITHER Class Reference

#include <mi32/dither.h>

List of all members.

Public Member Functions

virtual ~DITHER ()
virtual bool CanUseCMYKcm () const
double ComputeCoverage (int level, double DotGain)
virtual void DitherLineCMYK (const UINT8 *const *trans, const UINT8 *in, UINT8 **out, const UINT8 *mask, int lin, int col, int NumCols)
virtual void DitherLineGray (const UINT8 *trans, const UINT8 *in, UINT8 *out, const UINT8 *mask, int lin, int col, int numcols)
virtual void DitherLineRGB24 (const UINT8 *const *trans, const UINT8 *in, UINT8 **out, const UINT8 *mask, int lin, int col, int NumCols)
virtual void DitherSolidColor (const UINT8 *rgb, UINT8 **out, int lin, int col, int cols, UINT32 flags)
virtual void DitherSolidColor (const COLOR &color, UINT8 **out, int lin, int col, int numcols)
void DitherSolidGray (UINT8 in, UINT8 *out, int lin, int col, int numcols)
int GetMaxVal () const
int GetNumLevels () const
virtual bool HasDotGainCompensation () const
virtual bool HasVariableScreenAngle () const
virtual bool HasVariableScreenFreq () const
virtual void SetDotGain (int comp, double size)
virtual void SetScreenAngle (int comp, double angle)
virtual void SetScreenFreq (double HalftoneDPI, double PrinterDPI)
bool SetUseCMYKcm (bool val=true)

Static Public Member Functions

static DITHERAllocate (const char *PatternName, int numcolors, int cols, bool bForceMono)
static char ** GetPatternList (int *countp, bool bAllowErrorDiffusion=true)
static MISTRING GetPatternLongName (const char *name)
static const char * GetPatternName (int num)
static int GetPatternNum (const char *name)

Protected Member Functions

 DITHER ()

Constructor & Destructor Documentation

virtual DITHER::~DITHER (  )  [virtual]
DITHER::DITHER (  )  [protected]

Constructor is protected. Can only call static method to allocate one.

GENERATING_DOXYGEN_OUTPUT


Member Function Documentation

static DITHER* DITHER::Allocate ( const char *  PatternName,
int  numcolors,
int  cols,
bool  bForceMono 
) [static]

Allocate a dither pattern.

virtual bool DITHER::CanUseCMYKcm (  )  const [inline, virtual]
double DITHER::ComputeCoverage ( int  level,
double  DotGain 
)

Returns the ammount of area covered (0.0 to 1.0) at a given halftone level and DotGain.

If DotGain is 1.0, this is trival. If greater than 1.0, then it takes into account the size of the dots and overlap between adjacent dots.

Parameters:
level range 0 to GetNumLevels()-1
DotGain 1.0="ideal", 1.1 means dot is 10% bigger than "ideal"
virtual void DITHER::DitherLineCMYK ( const UINT8 *const *  trans,
const UINT8 in,
UINT8 **  out,
const UINT8 mask,
int  lin,
int  col,
int  NumCols 
) [virtual]

Dither a line of CMYK data.

Input values are in the range of 0-255 in is expected to hold data like CMYKCMYK... The output is assumed to be 3 seperate buffers:C,M,Y with values of 0 and 255 Trans is a lookup table with 256 values which scales input values into the range the pattern wants (0 to GetMaxVal()), with a possible gama curve thrown in. NOTE: is in RGB space, not CMYK space

virtual void DITHER::DitherLineGray ( const UINT8 trans,
const UINT8 in,
UINT8 out,
const UINT8 mask,
int  lin,
int  col,
int  numcols 
) [inline, virtual]

Dither a gray image line to a binary output raster.

Trans is a lookup table with 256 values which scales input values into the range the pattern wants (0 to GetMaxVal()), with a possible gama curve thrown in.

virtual void DITHER::DitherLineRGB24 ( const UINT8 *const *  trans,
const UINT8 in,
UINT8 **  out,
const UINT8 mask,
int  lin,
int  col,
int  NumCols 
) [virtual]

Dither a line of RGB data.

Input values are in the range of 0-255 in is expected to hold data like RGBRGBRGB... The output is assumed to be 3 seperate buffers:C,M,Y with values of 0 and 255 Trans is a lookup table with 256 values which scales input values into the range the pattern wants (0 to GetMaxVal()), with a possible gama curve thrown in.

virtual void DITHER::DitherSolidColor ( const UINT8 rgb,
UINT8 **  out,
int  lin,
int  col,
int  cols,
UINT32  flags 
) [virtual]

Dither a solid color.

Input values are in the range of 0-255 The output is assumed to be 3 seperate buffers:C,M,Y with values of 0 and 255 The version that takes a COLOR is prefered. This version might be deprecated some day

virtual void DITHER::DitherSolidColor ( const COLOR color,
UINT8 **  out,
int  lin,
int  col,
int  numcols 
) [virtual]

Dither a solid color.

The output is assumed to be 3 seperate buffers:C,M,Y with values of 0 and 255

void DITHER::DitherSolidGray ( UINT8  in,
UINT8 out,
int  lin,
int  col,
int  numcols 
) [inline]

Dither a solid gray.

int DITHER::GetMaxVal (  )  const [inline]

Get the maximum value supported by the pattern.

int DITHER::GetNumLevels (  )  const [inline]

Get the number of levels supported by the pattern.

static char** DITHER::GetPatternList ( int *  countp,
bool  bAllowErrorDiffusion = true 
) [static]

Bet the list of dither patterns.

static MISTRING DITHER::GetPatternLongName ( const char *  name  )  [static]
static const char* DITHER::GetPatternName ( int  num  )  [static]

Get the name of a dither pattern given its pattern number Note, the name is in resource format (all lowercase, underscores, etc).

static int DITHER::GetPatternNum ( const char *  name  )  [static]

Get a dither pattern number given its name.

virtual bool DITHER::HasDotGainCompensation (  )  const [inline, virtual]

Return true if SetDotGain() is implemented If you override this, you must also implement SetDotGain().

virtual bool DITHER::HasVariableScreenAngle (  )  const [inline, virtual]

Return true if SetScreenAngle() is implemented If you override this, you must also implement SetScreenAngle().

virtual bool DITHER::HasVariableScreenFreq (  )  const [inline, virtual]

Return true if SetScreenFreq() is implemented If you override this, you must also implement SetScreenFreq().

virtual void DITHER::SetDotGain ( int  comp,
double  size 
) [virtual]

Set the ammount of "dot gain" for each componant If you override this, you should also override HasDotGainCompensation() and make it return true.

Parameters:
size 1.0 == "ideal", 1.2 == 20% than ideal, etc.
virtual void DITHER::SetScreenAngle ( int  comp,
double  angle 
) [virtual]

Set the screen angles If you override this, you should also override HasVariableScreenAngle () and make it return true You should also call SetScreenAngle() in your Init() method to setup a default.

Parameters:
angle screen angle in degrees
virtual void DITHER::SetScreenFreq ( double  HalftoneDPI,
double  PrinterDPI 
) [virtual]

Set the screen interval If you override this, you should also override HasVariableScreenFreq () and make it return true You should also call SetScreenFreq() in your Init() method to setup a default.

bool DITHER::SetUseCMYKcm ( bool  val = true  )  [inline]

The documentation for this class was generated from the following file:

Generated on Sun Oct 7 21:33:18 2012 for TNTsdk 2012 by  doxygen 1.6.1