quantize.c File Reference

#include "MagickCore/studio.h"
#include "MagickCore/artifact.h"
#include "MagickCore/attribute.h"
#include "MagickCore/cache-view.h"
#include "MagickCore/color.h"
#include "MagickCore/color-private.h"
#include "MagickCore/colormap.h"
#include "MagickCore/colorspace.h"
#include "MagickCore/colorspace-private.h"
#include "MagickCore/enhance.h"
#include "MagickCore/exception.h"
#include "MagickCore/exception-private.h"
#include "MagickCore/histogram.h"
#include "MagickCore/image.h"
#include "MagickCore/image-private.h"
#include "MagickCore/list.h"
#include "MagickCore/memory_.h"
#include "MagickCore/memory-private.h"
#include "MagickCore/monitor.h"
#include "MagickCore/monitor-private.h"
#include "MagickCore/option.h"
#include "MagickCore/pixel-accessor.h"
#include "MagickCore/pixel-private.h"
#include "MagickCore/quantize.h"
#include "MagickCore/quantum.h"
#include "MagickCore/quantum-private.h"
#include "MagickCore/resource_.h"
#include "MagickCore/string_.h"
#include "MagickCore/string-private.h"
#include "MagickCore/thread-private.h"

Data Structures

struct  _DoublePixelPacket
struct  _NodeInfo
struct  _Nodes
struct  _CubeInfo

Defines

#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 _DoublePixelPacket DoublePixelPacket
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 *, ExceptionInfo *)
static MagickBooleanType ClassifyImageColors (CubeInfo *, const Image *, ExceptionInfo *)
static MagickBooleanType DitherImage (Image *, CubeInfo *, ExceptionInfo *)
static MagickBooleanType SetGrayscaleImage (Image *, ExceptionInfo *)
static size_t DefineImageColormap (Image *, CubeInfo *, NodeInfo *)
static void ClosestColor (const Image *, CubeInfo *, const NodeInfo *)
static void DestroyCubeInfo (CubeInfo *)
static void PruneLevel (CubeInfo *, const NodeInfo *)
static void PruneToCubeDepth (CubeInfo *, const NodeInfo *)
static void ReduceImageColors (const Image *, CubeInfo *)
MagickExport QuantizeInfoAcquireQuantizeInfo (const ImageInfo *image_info)
static void AssociateAlphaPixel (const Image *image, const CubeInfo *cube_info, const Quantum *pixel, DoublePixelPacket *alpha_pixel)
static void AssociateAlphaPixelInfo (const CubeInfo *cube_info, const PixelInfo *pixel, DoublePixelPacket *alpha_pixel)
static size_t ColorToNodeId (const CubeInfo *cube_info, const DoublePixelPacket *pixel, size_t index)
static void SetAssociatedAlpha (const Image *image, CubeInfo *cube_info)
MagickExport QuantizeInfoCloneQuantizeInfo (const QuantizeInfo *quantize_info)
MagickExport MagickBooleanType CompressImageColormap (Image *image, ExceptionInfo *exception)
MagickExport QuantizeInfoDestroyQuantizeInfo (QuantizeInfo *quantize_info)
static DoublePixelPacket ** DestroyPixelThreadSet (DoublePixelPacket **pixels)
static DoublePixelPacket ** AcquirePixelThreadSet (const size_t count)
static ssize_t CacheOffset (CubeInfo *cube_info, const DoublePixelPacket *pixel)
static MagickBooleanType FloydSteinbergDither (Image *image, CubeInfo *cube_info, ExceptionInfo *exception)
static MagickBooleanType RiemersmaDither (Image *, CacheView *, CubeInfo *, const unsigned int, ExceptionInfo *)
static void Riemersma (Image *image, CacheView *image_view, CubeInfo *cube_info, const size_t level, const unsigned int direction, ExceptionInfo *exception)
MagickExport MagickBooleanType GetImageQuantizeError (Image *image, ExceptionInfo *exception)
MagickExport void GetQuantizeInfo (QuantizeInfo *quantize_info)
static double MagickRound (double x)
MagickExport MagickBooleanType PosterizeImage (Image *image, const size_t levels, const DitherMethod dither_method, ExceptionInfo *exception)
static void PruneChild (CubeInfo *cube_info, const NodeInfo *node_info)
MagickExport MagickBooleanType QuantizeImage (const QuantizeInfo *quantize_info, Image *image, ExceptionInfo *exception)
MagickExport MagickBooleanType QuantizeImages (const QuantizeInfo *quantize_info, Image *images, ExceptionInfo *exception)
static size_t QuantizeErrorFlatten (const CubeInfo *cube_info, const NodeInfo *node_info, const ssize_t offset, double *quantize_error)
static void Reduce (CubeInfo *cube_info, const NodeInfo *node_info)
static int QuantizeErrorCompare (const void *error_p, const void *error_q)
MagickExport MagickBooleanType RemapImage (const QuantizeInfo *quantize_info, Image *image, const Image *remap_image, ExceptionInfo *exception)
MagickExport MagickBooleanType RemapImages (const QuantizeInfo *quantize_info, Image *images, const Image *remap_image, ExceptionInfo *exception)
static int IntensityCompare (const void *x, const void *y)

Define 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 MaxTreeDepth   8
#define NodesInAList   1920
#define PosterizeImageTag   "Posterize/Image"

Referenced by PosterizeImage().

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

Referenced by PosterizeImage().

#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 DoublePixelPacket** AcquirePixelThreadSet ( const size_t  count  )  [static]
MagickExport QuantizeInfo* AcquireQuantizeInfo ( const ImageInfo image_info  ) 
static MagickBooleanType AssignImageColors ( Image image,
CubeInfo cube_info,
ExceptionInfo exception 
) [static]
static void AssociateAlphaPixel ( const Image image,
const CubeInfo cube_info,
const Quantum pixel,
DoublePixelPacket alpha_pixel 
) [inline, static]
static void AssociateAlphaPixelInfo ( const CubeInfo cube_info,
const PixelInfo pixel,
DoublePixelPacket alpha_pixel 
) [inline, static]
static ssize_t CacheOffset ( CubeInfo cube_info,
const DoublePixelPacket pixel 
) [inline, static]
static MagickBooleanType ClassifyImageColors ( CubeInfo cube_info,
const Image image,
ExceptionInfo exception 
)
MagickExport QuantizeInfo* CloneQuantizeInfo ( const QuantizeInfo quantize_info  ) 
static void ClosestColor ( const Image image,
CubeInfo cube_info,
const NodeInfo node_info 
) [static]
static size_t ColorToNodeId ( const CubeInfo cube_info,
const DoublePixelPacket pixel,
size_t  index 
) [inline, static]
MagickExport MagickBooleanType CompressImageColormap ( Image image,
ExceptionInfo exception 
)
static size_t DefineImageColormap ( Image image,
CubeInfo cube_info,
NodeInfo node_info 
) [static]
static void DestroyCubeInfo ( CubeInfo cube_info  ) 
static DoublePixelPacket** DestroyPixelThreadSet ( DoublePixelPacket **  pixels  )  [static]
MagickExport QuantizeInfo* DestroyQuantizeInfo ( QuantizeInfo quantize_info  ) 
static MagickBooleanType DitherImage ( Image image,
CubeInfo cube_info,
ExceptionInfo exception 
)
static MagickBooleanType FloydSteinbergDither ( Image image,
CubeInfo cube_info,
ExceptionInfo exception 
) [static]
static CubeInfo * GetCubeInfo ( const QuantizeInfo quantize_info,
const size_t  depth,
const size_t  maximum_colors 
) [static]
MagickExport MagickBooleanType GetImageQuantizeError ( Image image,
ExceptionInfo exception 
)
static NodeInfo * GetNodeInfo ( CubeInfo cube_info,
const size_t  id,
const size_t  level,
NodeInfo parent 
) [static]
MagickExport void GetQuantizeInfo ( QuantizeInfo quantize_info  ) 
static int IntensityCompare ( const void *  x,
const void *  y 
) [static]

References GetPixelInfoIntensity().

Referenced by SetGrayscaleImage().

static double MagickRound ( double  x  )  [inline, static]
MagickExport MagickBooleanType PosterizeImage ( Image image,
const size_t  levels,
const DitherMethod  dither_method,
ExceptionInfo exception 
)
static void PruneChild ( CubeInfo cube_info,
const NodeInfo node_info 
) [static]
static void PruneLevel ( CubeInfo cube_info,
const NodeInfo node_info 
)
static void PruneToCubeDepth ( CubeInfo cube_info,
const NodeInfo node_info 
)
static int QuantizeErrorCompare ( const void *  error_p,
const void *  error_q 
) [static]

References MagickEpsilon.

Referenced by ReduceImageColors().

static size_t QuantizeErrorFlatten ( const CubeInfo cube_info,
const NodeInfo node_info,
const ssize_t  offset,
double *  quantize_error 
) [static]
MagickExport MagickBooleanType QuantizeImage ( const QuantizeInfo quantize_info,
Image image,
ExceptionInfo exception 
)
MagickExport MagickBooleanType QuantizeImages ( const QuantizeInfo quantize_info,
Image images,
ExceptionInfo exception 
)
static void Reduce ( CubeInfo cube_info,
const NodeInfo node_info 
) [static]
static void ReduceImageColors ( const Image image,
CubeInfo cube_info 
)
MagickExport MagickBooleanType RemapImage ( const QuantizeInfo quantize_info,
Image image,
const Image remap_image,
ExceptionInfo exception 
)
MagickExport MagickBooleanType RemapImages ( const QuantizeInfo quantize_info,
Image images,
const Image remap_image,
ExceptionInfo exception 
)
static void Riemersma ( Image image,
CacheView image_view,
CubeInfo cube_info,
const size_t  level,
const unsigned int  direction,
ExceptionInfo exception 
) [static]
static MagickBooleanType RiemersmaDither ( Image image,
CacheView image_view,
CubeInfo cube_info,
const unsigned int  direction,
ExceptionInfo exception 
) [static]
static void SetAssociatedAlpha ( const Image image,
CubeInfo cube_info 
) [inline, static]
static MagickBooleanType SetGrayscaleImage ( Image image,
ExceptionInfo exception 
)

Generated on 17 Jul 2019 for MagickCore by  doxygen 1.6.1