MagickCore  6.8.5
quantize.c File Reference
Include dependency graph for quantize.c:

Data Structures

struct  _RealPixelPacket
struct  _NodeInfo
struct  _Nodes
struct  _CubeInfo

Macros

#define CacheShift   2
#define ErrorQueueLength   16
#define MaxNodes   266817
#define MaxTreeDepth   8
#define NodesInAList   1920
#define AssignImageTag   "Assign/Image"
#define ClassifyImageTag   "Classify/Image"
#define RedShift(pixel)   (((pixel) >> CacheShift) << (0*(8-CacheShift)))
#define GreenShift(pixel)   (((pixel) >> CacheShift) << (1*(8-CacheShift)))
#define BlueShift(pixel)   (((pixel) >> CacheShift) << (2*(8-CacheShift)))
#define AlphaShift(pixel)   (((pixel) >> CacheShift) << (3*(8-CacheShift)))
#define DitherImageTag   "Dither/Image"
#define DitherImageTag   "Dither/Image"
#define PosterizeImageTag   "Posterize/Image"
#define PosterizePixel(pixel)
#define ReduceImageTag   "Reduce/Image"

Typedefs

typedef struct _RealPixelPacket RealPixelPacket
typedef struct _NodeInfo NodeInfo
typedef struct _Nodes Nodes
typedef struct _CubeInfo CubeInfo

Functions

static CubeInfoGetCubeInfo (const QuantizeInfo *, const size_t, const size_t)
static NodeInfoGetNodeInfo (CubeInfo *, const size_t, const size_t, NodeInfo *)
static MagickBooleanType AssignImageColors (Image *, CubeInfo *)
static MagickBooleanType ClassifyImageColors (CubeInfo *, const Image *, ExceptionInfo *)
static MagickBooleanType DitherImage (Image *, CubeInfo *)
static MagickBooleanType SetGrayscaleImage (Image *)
static size_t DefineImageColormap (Image *, CubeInfo *, NodeInfo *)
static void ClosestColor (const Image *, CubeInfo *, const NodeInfo *)
static void DestroyCubeInfo (CubeInfo *)
static void PruneLevel (const Image *, CubeInfo *, const NodeInfo *)
static void PruneToCubeDepth (const Image *, CubeInfo *, const NodeInfo *)
static void ReduceImageColors (const Image *, CubeInfo *)
MagickExport QuantizeInfoAcquireQuantizeInfo (const ImageInfo *image_info)
static void AssociateAlphaPixel (const CubeInfo *cube_info, const PixelPacket *pixel, RealPixelPacket *alpha_pixel)
static Quantum ClampPixel (const MagickRealType value)
static size_t ColorToNodeId (const CubeInfo *cube_info, const RealPixelPacket *pixel, size_t index)
static MagickBooleanType IsSameColor (const Image *image, const PixelPacket *p, const PixelPacket *q)
static void SetAssociatedAlpha (const Image *image, CubeInfo *cube_info)
MagickExport QuantizeInfoCloneQuantizeInfo (const QuantizeInfo *quantize_info)
MagickExport MagickBooleanType CompressImageColormap (Image *image)
MagickExport QuantizeInfoDestroyQuantizeInfo (QuantizeInfo *quantize_info)
static RealPixelPacket ** DestroyPixelThreadSet (RealPixelPacket **pixels)
static RealPixelPacket ** AcquirePixelThreadSet (const size_t count)
static ssize_t CacheOffset (CubeInfo *cube_info, const RealPixelPacket *pixel)
static MagickBooleanType FloydSteinbergDither (Image *image, CubeInfo *cube_info)
static MagickBooleanType RiemersmaDither (Image *, CacheView *, CubeInfo *, const unsigned int)
static void Riemersma (Image *image, CacheView *image_view, CubeInfo *cube_info, const size_t level, const unsigned int direction)
static ssize_t MagickMax (const ssize_t x, const ssize_t y)
static ssize_t MagickMin (const ssize_t x, const ssize_t y)
MagickExport MagickBooleanType GetImageQuantizeError (Image *image)
MagickExport void GetQuantizeInfo (QuantizeInfo *quantize_info)
static double MagickRound (double x)
MagickExport MagickBooleanType PosterizeImage (Image *image, const size_t levels, const MagickBooleanType dither)
MagickExport MagickBooleanType PosterizeImageChannel (Image *image, const ChannelType channel, const size_t levels, const MagickBooleanType dither)
static void PruneChild (const Image *image, CubeInfo *cube_info, const NodeInfo *node_info)
static MagickBooleanType DirectToColormapImage (Image *image, ExceptionInfo *exception)
MagickExport MagickBooleanType QuantizeImage (const QuantizeInfo *quantize_info, Image *image)
MagickExport MagickBooleanType QuantizeImages (const QuantizeInfo *quantize_info, Image *images)
static void Reduce (const Image *image, CubeInfo *cube_info, const NodeInfo *node_info)
MagickExport MagickBooleanType RemapImage (const QuantizeInfo *quantize_info, Image *image, const Image *remap_image)
MagickExport MagickBooleanType RemapImages (const QuantizeInfo *quantize_info, Image *images, const Image *remap_image)
static int IntensityCompare (const void *x, const void *y)

Macro Definition Documentation

#define AlphaShift (   pixel)    (((pixel) >> CacheShift) << (3*(8-CacheShift)))

Referenced by CacheOffset().

#define AssignImageTag   "Assign/Image"
#define BlueShift (   pixel)    (((pixel) >> CacheShift) << (2*(8-CacheShift)))

Referenced by CacheOffset().

#define CacheShift   2

Referenced by GetCubeInfo().

#define ClassifyImageTag   "Classify/Image"

Referenced by ClassifyImageColors().

#define DitherImageTag   "Dither/Image"
#define DitherImageTag   "Dither/Image"
#define ErrorQueueLength   16
#define GreenShift (   pixel)    (((pixel) >> CacheShift) << (1*(8-CacheShift)))

Referenced by CacheOffset().

#define MaxNodes   266817

Referenced by ClassifyImageColors().

#define NodesInAList   1920

Referenced by GetNodeInfo().

#define PosterizeImageTag   "Posterize/Image"

Referenced by PosterizeImageChannel().

#define PosterizePixel (   pixel)
Value:
QuantumScale*pixel*(levels-1)))/MagickMax((ssize_t) levels-1,1))

Referenced by PosterizeImageChannel().

#define RedShift (   pixel)    (((pixel) >> CacheShift) << (0*(8-CacheShift)))

Referenced by CacheOffset().

#define ReduceImageTag   "Reduce/Image"

Referenced by ReduceImageColors().

Typedef Documentation

typedef struct _CubeInfo CubeInfo
typedef struct _NodeInfo NodeInfo
typedef struct _Nodes Nodes

Function Documentation

static RealPixelPacket** AcquirePixelThreadSet ( const size_t  count)
static
static Quantum ClampPixel ( const MagickRealType  value)
inlinestatic
static size_t ColorToNodeId ( const CubeInfo cube_info,
const RealPixelPacket pixel,
size_t  index 
)
inlinestatic
static RealPixelPacket** DestroyPixelThreadSet ( RealPixelPacket **  pixels)
static
static int IntensityCompare ( const void *  x,
const void *  y 
)
static

References PixelPacketIntensity().

Referenced by SetGrayscaleImage().

static MagickBooleanType IsSameColor ( const Image image,
const PixelPacket p,
const PixelPacket q 
)
inlinestatic
static ssize_t MagickMax ( const ssize_t  x,
const ssize_t  y 
)
inlinestatic

Referenced by DitherImage().

static ssize_t MagickMin ( const ssize_t  x,
const ssize_t  y 
)
inlinestatic

Referenced by PosterizeImageChannel().

static double MagickRound ( double  x)
inlinestatic
MagickExport MagickBooleanType PosterizeImage ( Image image,
const size_t  levels,
const MagickBooleanType  dither 
)
static void PruneLevel ( const Image image,
CubeInfo cube_info,
const NodeInfo node_info 
)
static void PruneToCubeDepth ( const Image image,
CubeInfo cube_info,
const NodeInfo node_info 
)
static void Riemersma ( Image image,
CacheView image_view,
CubeInfo cube_info,
const size_t  level,
const unsigned int  direction 
)
static
static void SetAssociatedAlpha ( const Image image,
CubeInfo cube_info 
)
inlinestatic