#include "config.h"#include <string.h>#include <sys/time.h>#include <time.h>#include <unistd.h>#include <stdlib.h>#include <stdarg.h>#include <ctype.h>#include "afterbase.h"#include "asimage.h"#include "import.h"#include "export.h"#include "imencdec.h"#include "ascmap.h"Go to the source code of this file.
Functions | |
| static ASMappedColor * | new_mapped_color (CARD32 red, CARD32 green, CARD32 blue, CARD32 indexed) |
| void | add_index_color (ASSortedColorHash *index, CARD32 indexed, unsigned int slot, CARD32 red, CARD32 green, CARD32 blue) |
| void | destroy_colorhash (ASSortedColorHash *index, Bool reusable) |
| void | fix_colorindex_shortcuts (ASSortedColorHash *index) |
| static void | add_colormap_item (register ASColormapEntry *pentry, ASMappedColor *pelem, int cmap_idx) |
| unsigned int | add_colormap_items (ASSortedColorHash *index, unsigned int start, unsigned int stop, unsigned int quota, unsigned int base, ASColormapEntry *entries) |
| ASColormap * | color_hash2colormap (ASColormap *cmap, unsigned int max_colors) |
| void | destroy_colormap (ASColormap *cmap, Bool reusable) |
| int | get_color_index (ASSortedColorHash *index, CARD32 indexed, unsigned int slot) |
| int * | colormap_asimage (ASImage *im, ASColormap *cmap, unsigned int max_colors, unsigned int dither, int opaque_threshold) |
| static void add_colormap_item | ( | register ASColormapEntry * | pentry, | |
| ASMappedColor * | pelem, | |||
| int | cmap_idx | |||
| ) | [inline, static] |
Definition at line 232 of file ascmap.c.
References ASMappedColor::blue, ASMappedColor::cmap_idx, ASMappedColor::green, LOCAL_DEBUG_OUT, and ASMappedColor::red.
Referenced by add_colormap_items().
| unsigned int add_colormap_items | ( | ASSortedColorHash * | index, | |
| unsigned int | start, | |||
| unsigned int | stop, | |||
| unsigned int | quota, | |||
| unsigned int | base, | |||
| ASColormapEntry * | entries | |||
| ) |
Definition at line 242 of file ascmap.c.
References add_colormap_item(), ASMappedColor::count, entries, NULL, and total.
Referenced by color_hash2colormap().
| void add_index_color | ( | ASSortedColorHash * | index, | |
| CARD32 | indexed, | |||
| unsigned int | slot, | |||
| CARD32 | red, | |||
| CARD32 | green, | |||
| CARD32 | blue | |||
| ) |
Definition at line 86 of file ascmap.c.
References ASSortedColorBucket::count, ASMappedColor::count, ASSortedColorBucket::head, ASMappedColor::indexed, new_mapped_color(), ASMappedColor::next, NULL, and ASSortedColorBucket::tail.
Referenced by colormap_asimage().
| ASColormap* color_hash2colormap | ( | ASColormap * | cmap, | |
| unsigned int | max_colors | |||
| ) |
Definition at line 309 of file ascmap.c.
References add_colormap_items(), ASColormap::count, ASColormap::entries, ASColormap::hash, LOCAL_DEBUG_OUT, MIN, NULL, safemalloc, and total.
Referenced by colormap_asimage().
| int* colormap_asimage | ( | ASImage * | im, | |
| ASColormap * | cmap, | |||
| unsigned int | max_colors, | |||
| unsigned int | dither, | |||
| int | opaque_threshold | |||
| ) |
Definition at line 407 of file ascmap.c.
References a, add_index_color(), ASScanline::alpha, ASFLAGS_EVERYTHING, b, blue, ASScanline::blue, ASSortedColorHash::buckets, ASSortedColorHash::buckets_num, ASImageDecoder::buffer, color_hash2colormap(), ASColormap::count, ASImageDecoder::decode_image_scanline, g, get_color_index(), green, ASScanline::green, ASColormap::has_opaque, ASColormap::hash, ASImage::height, INDEX_SHIFT_BLUE, INDEX_SHIFT_GREEN, INDEX_SHIFT_RED, INDEX_UNESHIFT_BLUE, INDEX_UNESHIFT_GREEN, INDEX_UNESHIFT_RED, LOCAL_DEBUG_OUT, MAKE_INDEXED_COLOR12, MAKE_INDEXED_COLOR15, MAKE_INDEXED_COLOR18, MAKE_INDEXED_COLOR21, MAKE_INDEXED_COLOR24, MAKE_INDEXED_COLOR3, MAKE_INDEXED_COLOR6, MAKE_INDEXED_COLOR9, MAX_COLOR_BUCKETS, NULL, print_asimage(), ASScanline::red, red, safecalloc, safemalloc, SCL_DO_ALL, SHOW_TIME, start_image_decoding(), START_TIME, stop_image_decoding(), True, ASImage::width, x, x07, and y.
Referenced by ASImage2gif(), ASImage2xpm(), ASImage2xpmRawBuff(), TASImage::Vectorize(), and vectorize_asimage().
| void destroy_colorhash | ( | ASSortedColorHash * | index, | |
| Bool | reusable | |||
| ) |
| void destroy_colormap | ( | ASColormap * | cmap, | |
| Bool | reusable | |||
| ) |
Definition at line 357 of file ascmap.c.
References destroy_colorhash(), ASColormap::entries, False, free(), and ASColormap::hash.
Referenced by ASImage2gif(), ASImage2xpm(), ASImage2xpmRawBuff(), TASImage::Vectorize(), and vectorize_asimage().
| void fix_colorindex_shortcuts | ( | ASSortedColorHash * | index | ) |
| int get_color_index | ( | ASSortedColorHash * | index, | |
| CARD32 | indexed, | |||
| unsigned int | slot | |||
| ) |
Definition at line 371 of file ascmap.c.
References ASMappedColor::cmap_idx, ASSortedColorBucket::head, ASMappedColor::indexed, LOCAL_DEBUG_OUT, ASMappedColor::next, NULL, and ASSortedColorBucket::tail.
Referenced by colormap_asimage().
| static ASMappedColor* new_mapped_color | ( | CARD32 | red, | |
| CARD32 | green, | |||
| CARD32 | blue, | |||
| CARD32 | indexed | |||
| ) | [inline, static] |
Definition at line 68 of file ascmap.c.
References ASMappedColor::blue, ASMappedColor::cmap_idx, ASMappedColor::count, ASMappedColor::green, INDEX_UNSHIFT_BLUE, INDEX_UNSHIFT_GREEN, INDEX_UNSHIFT_RED, ASMappedColor::indexed, malloc(), ASMappedColor::next, NULL, and ASMappedColor::red.
Referenced by add_index_color().
1.5.1