File: colormap.h

package info (click to toggle)
graphicsmagick 1.3.30%2Bhg15796-1~deb9u4
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 178,512 kB
  • sloc: ansic: 998,889; xml: 91,899; sh: 77,027; cpp: 39,772; python: 29,412; makefile: 8,198; perl: 4,629; asm: 3,560; pascal: 3,096; tcl: 2,208; ada: 1,681; awk: 924; cs: 879; php: 368; sed: 10
file content (77 lines) | stat: -rw-r--r-- 2,125 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
  Copyright (C) 2003 - 2019 GraphicsMagick Group
  Copyright (C) 2002 ImageMagick Studio
  Copyright 1991-1999 E. I. du Pont de Nemours and Company

  This program is covered by multiple licenses, which are described in
  Copyright.txt. You should have received a copy of Copyright.txt with this
  package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.

  GraphicsMagick Colormap Methods
*/
#ifndef _MAGICK_COLORMAP_H
#define _MAGICK_COLORMAP_H

#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif

/*
  Include declarations.
*/
#include "magick/image.h"
#include "magick/error.h"

extern MagickExport MagickPassFail
  AllocateImageColormap(Image *,const unsigned long colors),
  CycleColormapImage(Image *image,const int amount),
  ReallocateImageColormap(Image *,const unsigned int colors),
  ReplaceImageColormap(Image *image,const PixelPacket *colormap,
    const unsigned int colors),
  SortColormapByIntensity(Image *image);

#if defined(MAGICK_IMPLEMENTATION)

#define VerifyColormapIndexWithColors(image,index,colors)     \
{ \
  if (index >= colors) \
    { \
      if (image->exception.severity < CorruptImageError ) \
        { \
          char \
            colormapIndexBuffer[MaxTextExtent]; \
          \
          FormatString(colormapIndexBuffer, \
                       "index %" MAGICK_SIZE_T_F "u >= %u colors, %.1024s", \
                       (MAGICK_SIZE_T) index, (unsigned int) colors, image->filename); \
          errno=0; \
          ThrowException(&image->exception,CorruptImageError, \
                         InvalidColormapIndex,colormapIndexBuffer); \
        } \
      index = 0U; \
    } \
}

#define VerifyColormapIndex(image,index) \
{ \
  VerifyColormapIndexWithColors(image,index,image->colors) \
}

extern MagickExport unsigned int
  MagickConstrainColormapIndex(Image *image, unsigned int index) MAGICK_FUNC_DEPRECATED;

#endif /* defined(MAGICK_IMPLEMENTATION) */

#if defined(__cplusplus) || defined(c_plusplus)
}
#endif

#endif /* _MAGICK_COLORMAP_H */

/*
 * Local Variables:
 * mode: c
 * c-basic-offset: 2
 * fill-column: 78
 * End:
 */