#include "config.h"
#include <stdlib.h>
#include <unistd.h>
#include <ctype.h>
#include <sys/time.h>
#include <time.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <stddef.h>
#include <fcntl.h>
#include <string.h>
#include "afterbase.h"
#include "asimage.h"
#include "ascmap.h"
#include "xpm.h"
Go to the source code of this file.
#define MAXPRINTABLE 92 |
ASXpmCharmap* build_xpm_charmap | ( | ASColormap * | cmap, | |
Bool | has_alpha, | |||
ASXpmCharmap * | reusable_memory | |||
) |
Definition at line 952 of file xpm.c.
References ASXpmCharmap::char_code, ASColormap::count, ASXpmCharmap::count, ASXpmCharmap::cpp, i, int, k, MAXPRINTABLE, printable, ptr, and safemalloc.
Referenced by ASImage2xpm(), and ASImage2xpmRawBuff().
Definition at line 777 of file xpm.c.
References add_hash_item, argb, ARGB32_ALPHA8, ASXpmFile::bpp, calloc(), casestring_compare, casestring_hash_value, ASXpmFile::cmap, ASXpmFile::cmap2, ASXpmFile::cmap_name_xref, ASXpmFile::cmap_size, create_ashash, destroy_ashash, ASXpmFile::do_alpha, False, free(), ASXpmFile::full_alpha, get_xpm_string(), i, int, LOCAL_DEBUG_OUT, lookup_xpm_color(), mystrndup, name, NULL, parse_xpm_cmap_entry(), safecalloc, size_t, ASXpmFile::str_buf, string_compare, string_hash_value, string_value_destroy(), True, XPM_Success, and XpmRGB_Colors.
Referenced by xpm_file2ASImage().
void close_xpm_file | ( | ASXpmFile ** | xpm_file | ) |
Definition at line 505 of file xpm.c.
References close, destroy_ashash, free(), free_scanline(), i, NULL, and True.
Referenced by open_xpm_data(), open_xpm_file(), open_xpm_raw_data(), xpm2ASImage(), xpm_data2ASImage(), and xpmRawBuff2ASImage().
Definition at line 877 of file xpm.c.
References a, ASScanline::alpha, ARGB32_ALPHA8, ARGB32_BLUE8, ARGB32_GREEN8, ARGB32_RED8, AS_HASHABLE, b, ASScanline::blue, c, ASHashData::c32, ASXpmFile::cmap, ASXpmFile::data, data, ASXpmFile::do_alpha, False, free(), g, get_hash_item, get_xpm_string(), ASScanline::green, i, k, NULL, ASScanline::red, safemalloc, ASXpmFile::scl, True, ASHashData::vptr, ASXpmFile::width, and XPM_Success.
Referenced by xpm_file2ASImage().
Definition at line 728 of file xpm.c.
References create_asimage(), ASXpmFile::height, NULL, and ASXpmFile::width.
Referenced by xpm_file2ASImage().
void destroy_xpm_charmap | ( | ASXpmCharmap * | xpm_cmap, | |
Bool | reusable | |||
) |
Definition at line 981 of file xpm.c.
References ASXpmCharmap::char_code, and free().
Referenced by ASImage2xpm(), and ASImage2xpmRawBuff().
static char get_xpm_char | ( | ASXpmFile * | xpm_file | ) | [inline, static] |
Definition at line 333 of file xpm.c.
References AS_XPM_BUFFER_SIZE, AS_XPM_BUFFER_UNDO, ASXpmFile::buffer, ASXpmFile::bytes_in, c, ASXpmFile::curr_byte, ASXpmFile::data, ASXpmFile::fd, i, ASXpmFile::parse_state, read, and XPM_Outside.
Referenced by read_next_xpm_string(), seek_next_xpm_image(), seek_next_xpm_string(), and skip_xpm_comments().
ASXpmStatus get_xpm_string | ( | ASXpmFile * | xpm_file | ) |
Definition at line 664 of file xpm.c.
References ASXpmFile::buffer, ASXpmFile::curr_img, ASXpmFile::curr_img_line, ASXpmFile::data, NULL, ASXpmFile::parse_state, read_next_xpm_string(), seek_next_xpm_image(), seek_next_xpm_string(), ASXpmFile::str_buf, ASXpmFile::str_buf_size, XPM_EndOfFile, XPM_EndOfImage, XPM_Error, XPM_InFile, XPM_InImage, and XPM_Success.
Referenced by build_xpm_colormap(), convert_xpm_scanline(), open_xpm_data(), open_xpm_file(), and open_xpm_raw_data().
static ARGB32 lookup_xpm_color | ( | char ** | colornames, | |
ASHashTable * | xpm_color_names | |||
) | [static] |
Definition at line 739 of file xpm.c.
References AS_HASHABLE, ASH_Success, ASHashData::c32, get_hash_item, LOCAL_DEBUG_OUT, parse_argb_color, and ASHashData::vptr.
Referenced by build_xpm_colormap().
ASXpmFile* open_xpm_data | ( | const char ** | data | ) |
Definition at line 594 of file xpm.c.
References AS_XPM_BUFFER_UNDO, ASXpmFile::bpp, ASXpmFile::buffer, close_xpm_file(), ASXpmFile::curr_byte, ASXpmFile::data, False, get_xpm_string(), ASXpmFile::height, MAX_IMPORT_IMAGE_SIZE, MAX_XPM_BPP, NULL, ASXpmFile::parse_state, parse_xpm_header(), prepare_scanline(), safecalloc, ASXpmFile::scl, ASXpmFile::width, XPM_InFile, and XPM_Success.
Referenced by xpm_data2ASImage().
ASXpmFile* open_xpm_file | ( | const char * | realfilename | ) |
Definition at line 542 of file xpm.c.
References AS_XPM_BUFFER_SIZE, AS_XPM_BUFFER_UNDO, ASXpmFile::bpp, ASXpmFile::buffer, ASXpmFile::bytes_in, close_xpm_file(), ASXpmFile::cmap_size, ASXpmFile::curr_byte, ASXpmFile::data, False, ASXpmFile::fd, get_xpm_string(), ASXpmFile::height, MAX_IMPORT_IMAGE_SIZE, MAX_XPM_BPP, NULL, open, ASXpmFile::parse_state, parse_xpm_header(), prepare_scanline(), read, safecalloc, safemalloc, ASXpmFile::scl, True, ASXpmFile::width, XPM_InFile, and XPM_Success.
Referenced by xpm2ASImage().
ASXpmFile* open_xpm_raw_data | ( | const char * | data | ) |
Definition at line 629 of file xpm.c.
References AS_XPM_BUFFER_UNDO, ASXpmFile::bpp, ASXpmFile::buffer, ASXpmFile::bytes_in, close_xpm_file(), ASXpmFile::curr_byte, ASXpmFile::curr_img_line, ASXpmFile::data, False, get_xpm_string(), ASXpmFile::height, MAX_IMPORT_IMAGE_SIZE, MAX_XPM_BPP, NULL, ASXpmFile::parse_state, parse_xpm_header(), prepare_scanline(), safecalloc, ASXpmFile::scl, ASXpmFile::width, XPM_InFile, and XPM_Success.
Referenced by xpmRawBuff2ASImage().
Definition at line 456 of file xpm.c.
References ASXpmFile::bpp, False, NULL, ptr, ASXpmFile::str_buf, and True.
Referenced by build_xpm_colormap().
Definition at line 698 of file xpm.c.
References ASXpmFile::bpp, ASXpmFile::cmap_size, False, ASXpmFile::height, NULL, ptr, ASXpmFile::str_buf, True, and ASXpmFile::width.
Referenced by open_xpm_data(), open_xpm_file(), and open_xpm_raw_data().
Definition at line 429 of file xpm.c.
References c, ASXpmFile::curr_img_line, get_xpm_char(), i, ASXpmFile::parse_state, realloc(), ASXpmFile::str_buf, ASXpmFile::str_buf_size, True, XPM_InImage, and XPM_InString.
Referenced by get_xpm_string().
Definition at line 414 of file xpm.c.
References c, get_xpm_char(), ASXpmFile::parse_state, skip_xpm_comments(), XPM_InFile, and XPM_InImage.
Referenced by get_xpm_string().
Definition at line 399 of file xpm.c.
References c, get_xpm_char(), ASXpmFile::parse_state, skip_xpm_comments(), XPM_InImage, and XPM_InString.
Referenced by get_xpm_string().
static void skip_xpm_comments | ( | ASXpmFile * | xpm_file | ) | [inline, static] |
Definition at line 380 of file xpm.c.
References c, get_xpm_char(), ASXpmFile::parse_state, unget_xpm_char(), and XPM_InComments.
Referenced by seek_next_xpm_image(), and seek_next_xpm_string().
void string_value_destroy | ( | ASHashableValue | value, | |
void * | data | |||
) |
static void unget_xpm_char | ( | ASXpmFile * | xpm_file, | |
char | c | |||
) | [inline, static] |
Definition at line 368 of file xpm.c.
References ASXpmFile::buffer, and ASXpmFile::curr_byte.
Referenced by skip_xpm_comments().
Definition at line 87 of file xpm.c.
Referenced by asim_apply_path(), asim_parse_argb_color(), build_xpm_colormap(), TASImage::GetRgbaArray(), handle_asxml_tag_background(), handle_asxml_tag_color(), TGLPadPainter::SaveImage(), and trans_graph().
char* printable [static] |
Initial value:
" .XoO+@#$%&*=-;:>,<1234567890qwertyuipasdfghjklzxcvbnmMNBVCZASDFGHJKLPIUYTREWQ!~^/()_`'][{}|"
Definition at line 82 of file xpm.c.
Referenced by build_xpm_charmap().
struct { ... } XpmRGB_Colors[] [static] |
Referenced by build_xpm_colormap().