import.c File Reference

#include "config.h"
#include <png.h>
#include <X11/Xmd.h>
#include <jpeglib.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#include "afterbase.h"
#include "libungif/gif_lib.h"
#include <tiff.h>
#include <tiffio.h>
#include "asimage.h"
#include "imencdec.h"
#include "bmp.h"
#include "scanline.h"
#include "ximage.h"
#include "xcf.h"
#include "xpm.h"
#include "ungif.h"
#include "import.h"
#include "asimagexml.h"
#include "transform.h"

Go to the source code of this file.

Classes

struct  ASImageListAuxData
struct  ASImPNGReadBuffer
struct  my_error_mgr
struct  ASTGAHeader
struct  ASTGAColorMap
struct  ASTGAImageData

Defines

#define DEBUG_TIFF
#define AS_THUMBNAIL_NAME_FORMAT   "%s_scaled_to_%dx%d"
#define FILE_HEADER_SIZE   512
#define PPM_BUFFER_SIZE   71
#define PHOTOMETRIC_CFA   32803
#define TGA_NoImageData   0
#define TGA_ColormappedImage   1
#define TGA_TrueColorImage   2
#define TGA_BWImage   3
#define TGA_RLEColormappedImage   9
#define TGA_RLETrueColorImage   10
#define TGA_RLEBWImage   11
#define TGA_LeftToRight   (0x01<<4)
#define TGA_TopToBottom   (0x01<<5)

Typedefs

typedef my_error_mgrmy_error_ptr

Functions

static char * locate_image_file (const char *file, char **paths)
static ASImageFileTypes check_image_type (const char *realfilename)
char * locate_image_file_in_path (const char *file, ASImageImportParams *iparams)
ASImagefile2ASImage_extra (const char *file, ASImageImportParams *iparams)
void init_asimage_import_params (ASImageImportParams *iparams)
ASImagefile2ASImage (const char *file, ASFlagType what, double gamma, unsigned int compression,...)
Pixmap file2pixmap (ASVisual *asv, Window root, const char *realfilename, Pixmap *mask_out)
static ASImageload_image_from_path (const char *file, char **path, double gamma)
ASImageFileTypes get_asimage_file_type (ASImageManager *imageman, const char *file)
ASImageget_asimage (ASImageManager *imageman, const char *file, ASFlagType what, unsigned int compression)
void calculate_proportions (int src_w, int src_h, int *pdst_w, int *pdst_h)
void print_asimage_func (ASHashableValue value)
ASImageget_thumbnail_asimage (ASImageManager *imageman, const char *file, int thumb_width, int thumb_height, ASFlagType flags)
Bool reload_asimage_manager (ASImageManager *imman)
ASImageListEntryref_asimage_list_entry (ASImageListEntry *entry)
ASImageListEntryunref_asimage_list_entry (ASImageListEntry *entry)
ASImageListEntrycreate_asimage_list_entry ()
void destroy_asimage_list (ASImageListEntry **plist)
void destroy_asimage_list_entry_buffer (ASImageListEntryBuffer **pbuffer)
Bool direntry2ASImageListEntry (const char *fname, const char *fullname, struct stat *stat_info, void *aux_data)
ASImageListEntryget_asimage_list (ASVisual *asv, const char *dir, ASFlagType preview_type, double gamma, unsigned int preview_width, unsigned int preview_height, unsigned int preview_compression, unsigned int *count_ret, int(*select)(const char *))
char * format_asimage_list_entry_details (ASImageListEntry *entry, Bool vertical)
Bool load_asimage_list_entry_data (ASImageListEntry *entry, size_t max_bytes)
static FILE * open_image_file (const char *path)
ASImageFileTypes check_asimage_file_type (const char *realfilename)
static ASImagexpm_file2ASImage (ASXpmFile *xpm_file, unsigned int compression)
ASImagexpm2ASImage (const char *path, ASImageImportParams *params)
ASXpmFileopen_xpm_data (const char **data)
ASXpmFileopen_xpm_raw_data (const char *data)
ASImagexpm_data2ASImage (const char **data, ASImageImportParams *params)
ASImagexpmRawBuff2ASImage (const char *data, ASImageImportParams *params)
static void apply_gamma (register CARD8 *raw, register CARD8 *gamma_table, unsigned int width)
ASImagepng2ASImage_int (void *data, png_rw_ptr read_fn, ASImageImportParams *params)
static void asim_png_read_data (png_structp png_ptr, png_bytep data, png_size_t length)
ASImagePNGBuff2ASimage (CARD8 *buffer, ASImageImportParams *params)
ASImagepng2ASImage (const char *path, ASImageImportParams *params)
 my_error_exit (j_common_ptr cinfo)
ASImagejpeg2ASImage (const char *path, ASImageImportParams *params)
ASImagexcf2ASImage (const char *path, ASImageImportParams *params)
ASImageppm2ASImage (const char *path, ASImageImportParams *params)
static size_t bmp_read32 (FILE *fp, CARD32 *data, int count)
static size_t bmp_read16 (FILE *fp, CARD16 *data, int count)
ASImageread_bmp_image (FILE *infile, size_t data_offset, BITMAPINFOHEADER *bmp_info, ASScanline *buf, CARD8 *gamma_table, unsigned int width, unsigned int height, Bool add_colormap, unsigned int compression)
ASImagebmp2ASImage (const char *path, ASImageImportParams *params)
ASImageico2ASImage (const char *path, ASImageImportParams *params)
int gif_interlaced2y (int line, int height)
ASImagegif2ASImage (const char *path, ASImageImportParams *params)
ASImagetiff2ASImage (const char *path, ASImageImportParams *params)
static ASImageload_xml2ASImage (ASImageManager *imman, const char *path, unsigned int compression, int width, int height)
ASImagexml2ASImage (const char *path, ASImageImportParams *params)
ASImagesvg2ASImage (const char *path, ASImageImportParams *params)
static Bool load_tga_colormapped (FILE *infile, ASTGAHeader *tga, ASTGAColorMap *cmap, ASScanline *buf, CARD8 *read_buf, CARD8 *gamma_table)
static Bool load_tga_truecolor (FILE *infile, ASTGAHeader *tga, ASTGAColorMap *cmap, ASScanline *buf, CARD8 *read_buf, CARD8 *gamma_table)
static Bool load_tga_bw (FILE *infile, ASTGAHeader *tga, ASTGAColorMap *cmap, ASScanline *buf, CARD8 *read_buf, CARD8 *gamma_table)
static Bool load_tga_rle_colormapped (FILE *infile, ASTGAHeader *tga, ASTGAColorMap *cmap, ASScanline *buf, CARD8 *read_buf, CARD8 *gamma_table)
static Bool load_tga_rle_truecolor (FILE *infile, ASTGAHeader *tga, ASTGAColorMap *cmap, ASScanline *buf, CARD8 *read_buf, CARD8 *gamma_table)
static Bool load_tga_rle_bw (FILE *infile, ASTGAHeader *tga, ASTGAColorMap *cmap, ASScanline *buf, CARD8 *read_buf, CARD8 *gamma_table)
ASImagetga2ASImage (const char *path, ASImageImportParams *params)
ASImageconvert_argb2ASImage (ASVisual *asv, int width, int height, ARGB32 *argb, CARD8 *gamma_table)
ASImageargb2ASImage (const char *path, ASImageImportParams *params)

Variables

as_image_loader_func as_image_file_loaders [ASIT_Unknown]
const char * as_image_file_type_names [ASIT_Unknown+1]


Define Documentation

#define AS_THUMBNAIL_NAME_FORMAT   "%s_scaled_to_%dx%d"

Referenced by get_thumbnail_asimage().

#define DEBUG_TIFF

Definition at line 23 of file import.c.

#define FILE_HEADER_SIZE   512

Referenced by check_image_type().

#define PHOTOMETRIC_CFA   32803

Referenced by tiff2ASImage().

#define PPM_BUFFER_SIZE   71

Referenced by ppm2ASImage().

#define TGA_BWImage   3

Definition at line 2753 of file import.c.

Referenced by tga2ASImage().

#define TGA_ColormappedImage   1

Definition at line 2751 of file import.c.

Referenced by tga2ASImage().

#define TGA_LeftToRight   (0x01<<4)

Definition at line 2771 of file import.c.

#define TGA_NoImageData   0

Definition at line 2750 of file import.c.

Referenced by tga2ASImage().

#define TGA_RLEBWImage   11

Definition at line 2756 of file import.c.

Referenced by tga2ASImage().

#define TGA_RLEColormappedImage   9

Definition at line 2754 of file import.c.

Referenced by tga2ASImage().

#define TGA_RLETrueColorImage   10

Definition at line 2755 of file import.c.

Referenced by tga2ASImage().

#define TGA_TopToBottom   (0x01<<5)

Definition at line 2772 of file import.c.

Referenced by tga2ASImage().

#define TGA_TrueColorImage   2

Definition at line 2752 of file import.c.

Referenced by tga2ASImage().


Typedef Documentation

typedef struct my_error_mgr* my_error_ptr

Definition at line 1526 of file import.c.


Function Documentation

static void apply_gamma ( register CARD8 *  raw,
register CARD8 *  gamma_table,
unsigned int  width 
) [inline, static]

Definition at line 1207 of file import.c.

References i.

Referenced by jpeg2ASImage().

ASImage* argb2ASImage ( const char *  path,
ASImageImportParams params 
)

Definition at line 3011 of file import.c.

References convert_argb2ASImage(), free(), load_binary_file, NULL, params, and show_error.

static void asim_png_read_data ( png_structp  png_ptr,
png_bytep  data,
png_size_t  length 
) [static]

Definition at line 1469 of file import.c.

References buf.

Referenced by PNGBuff2ASimage().

ASImage* bmp2ASImage ( const char *  path,
ASImageImportParams params 
)

Definition at line 2023 of file import.c.

References tagBITMAPFILEHEADER::bfOffBits, tagBITMAPFILEHEADER::bfSize, tagBITMAPFILEHEADER::bfType, bmp_read16(), bmp_read32(), BMP_SIGNATURE, buf, False, fclose(), fprintf(), free_scanline(), infile, NULL, open_image_file(), params, read_bmp_image(), show_error, SHOW_TIME, START_TIME, and True.

static size_t bmp_read16 ( FILE *  fp,
CARD16 *  data,
int  count 
) [static]

Definition at line 1903 of file import.c.

References fread, size_t, and total.

Referenced by bmp2ASImage(), ico2ASImage(), and read_bmp_image().

static size_t bmp_read32 ( FILE *  fp,
CARD32 *  data,
int  count 
) [static]

Definition at line 1880 of file import.c.

References fread, size_t, and total.

Referenced by bmp2ASImage(), ico2ASImage(), and read_bmp_image().

void calculate_proportions ( int  src_w,
int  src_h,
int *  pdst_w,
int *  pdst_h 
)

Definition at line 447 of file import.c.

Referenced by get_thumbnail_asimage().

ASImageFileTypes check_asimage_file_type ( const char *  realfilename  ) 

Definition at line 1076 of file import.c.

References ASIT_Unknown, check_image_type(), and NULL.

static ASImageFileTypes check_image_type ( const char *  realfilename  )  [static]

Definition at line 946 of file import.c.

References ASIT_Bmp, ASIT_Cur, ASIT_Gif, ASIT_GZCompressedXpm, ASIT_HTML, ASIT_Ico, ASIT_Jpeg, ASIT_Pcx, ASIT_Png, ASIT_Pnm, ASIT_Ppm, ASIT_SVG, ASIT_Targa, ASIT_Tiff, ASIT_Unknown, ASIT_Xbm, ASIT_Xcf, ASIT_XML, ASIT_XMLScript, ASIT_Xpm, ASIT_ZCompressedXpm, DEBUG_OUT, fclose(), FILE_HEADER_SIZE, fp, fread, i, mystrncasecmp, NULL, open_image_file(), size_t, type, XCF_SIGNATURE, and XCF_SIGNATURE_LEN.

Referenced by check_asimage_file_type(), direntry2ASImageListEntry(), file2ASImage_extra(), and get_asimage_file_type().

ASImage* convert_argb2ASImage ( ASVisual asv,
int  width,
int  height,
ARGB32 argb,
CARD8 *  gamma_table 
)

Definition at line 2970 of file import.c.

References ARGB32_ALPHA8, ARGB32_BLUE8, ARGB32_GREEN8, ARGB32_RED8, ASA_ASImage, ASIMAGE_QUALITY_DEFAULT, buf, c, create_asimage(), destroy_asimage(), free_scanline(), ASImage::height, NULL, ASImageOutput::output_image_scanline, prepare_scanline(), SCL_DO_ALPHA, SCL_DO_BLUE, SCL_DO_GREEN, SCL_DO_RED, set_asstorage_block_size(), set_flags, start_image_output(), stop_image_output(), True, and ASImage::width.

Referenced by argb2ASImage().

ASImageListEntry* create_asimage_list_entry (  ) 

Definition at line 662 of file import.c.

References entry, MAGIC_ASIMAGE_LIST_ENTRY, and safecalloc.

Referenced by direntry2ASImageListEntry().

void destroy_asimage_list ( ASImageListEntry **  plist  ) 

Definition at line 671 of file import.c.

References IS_ASIMAGE_LIST_ENTRY, ASImageListEntry::next, NULL, and unref_asimage_list_entry().

void destroy_asimage_list_entry_buffer ( ASImageListEntryBuffer **  pbuffer  ) 

Definition at line 686 of file import.c.

References free(), NULL, and pbuffer.

Referenced by unref_asimage_list_entry().

Bool direntry2ASImageListEntry ( const char *  fname,
const char *  fullname,
struct stat *  stat_info,
void *  aux_data 
)

Definition at line 710 of file import.c.

References as_image_file_loaders, ASA_ASImage, ASIMAGE_QUALITY_DEFAULT, ASIT_Unknown, check_image_type(), create_asimage_list_entry(), ASImageListEntry::d_mode, ASImageListEntry::d_mtime, ASImageListEntry::d_size, data, destroy_asimage(), False, ASImageListEntry::fullfilename, get_flags, ASImage::height, mystrdup, ASImageListEntry::name, NULL, ASImageListEntry::prev, ASImageListEntry::preview, S_ISDIR, scale_asimage(), SCALE_PREVIEW_H, SCALE_PREVIEW_V, tile_asimage(), TINT_NONE, True, ASImageListEntry::type, and ASImage::width.

Referenced by get_asimage_list().

ASImage* file2ASImage ( const char *  file,
ASFlagType  what,
double  gamma,
unsigned int  compression,
  ... 
)

Definition at line 324 of file import.c.

References AS_IMPORT_SCALED_H, AS_IMPORT_SCALED_V, ASImageImportParams::compression, file2ASImage_extra(), ASImageImportParams::flags, ASImageImportParams::gamma, ASImageImportParams::height, i, init_asimage_import_params(), MAX_SEARCH_PATHS, NULL, ASImageImportParams::search_path, and ASImageImportParams::width.

Referenced by TASImage::DrawText(), file2pixmap(), and WinMain().

ASImage* file2ASImage_extra ( const char *  file,
ASImageImportParams iparams 
)

Definition at line 253 of file import.c.

References as_image_file_loaders, ASIT_Unknown, check_image_type(), clone_asimage(), forget_asimage(), free(), ASImageImportParams::gamma, getenv(), ASImage::imageman, locate_image_file_in_path(), NULL, ASImage::ref_count, release_asimage(), show_error, and show_progress.

Referenced by file2ASImage(), get_thumbnail_asimage(), load_image_from_path(), and TASImage::ReadImage().

Pixmap file2pixmap ( ASVisual asv,
Window  root,
const char *  realfilename,
Pixmap *  mask_out 
)

Definition at line 354 of file import.c.

References asimage2mask(), asimage2pixmap(), destroy_asimage(), ASVisual::dpy, False, file2ASImage(), ROOT::Math::Cephes::gamma(), get_asimage_chanmask(), get_flags, getenv(), mask, None, NULL, SCL_DO_ALPHA, and SCREEN_GAMMA.

char* format_asimage_list_entry_details ( ASImageListEntry entry,
Bool  vertical 
)

Definition at line 823 of file import.c.

References as_image_file_type_names, ASIT_Unknown, entry, mystrdup, safemalloc, sprintf(), and type.

ASImage* get_asimage ( ASImageManager imageman,
const char *  file,
ASFlagType  what,
unsigned int  compression 
)

Definition at line 429 of file import.c.

References ASIM_NAME_IS_FILENAME, fetch_asimage(), ASImage::flags, ASImageManager::gamma, load_image_from_path(), NULL, ASImageManager::search_path, set_flags, and store_asimage().

Referenced by handle_asxml_tag_img(), handle_asxml_tag_recall(), and handle_asxml_tag_text().

ASImageFileTypes get_asimage_file_type ( ASImageManager imageman,
const char *  file 
)

Definition at line 406 of file import.c.

References ASIT_Unknown, check_image_type(), free(), init_asimage_import_params(), locate_image_file_in_path(), NULL, ASImageManager::search_path, and ASImageImportParams::search_path.

ASImageListEntry* get_asimage_list ( ASVisual asv,
const char *  dir,
ASFlagType  preview_type,
double  gamma,
unsigned int  preview_width,
unsigned int  preview_height,
unsigned int  preview_compression,
unsigned int *  count_ret,
int(*)(const char *)  select 
)

Definition at line 791 of file import.c.

References ASImageListAuxData::asv, direntry2ASImageListEntry(), ASImageListAuxData::last, my_scandir_ext, NULL, ASImageListAuxData::pcurr, ASImageListAuxData::preview_compression, ASImageListAuxData::preview_height, ASImageListAuxData::preview_type, and ASImageListAuxData::preview_width.

ASImage* get_thumbnail_asimage ( ASImageManager imageman,
const char *  file,
int  thumb_width,
int  thumb_height,
ASFlagType  flags 
)

Definition at line 463 of file import.c.

References AS_IMPORT_FAST, AS_IMPORT_RESIZED, AS_IMPORT_SCALED_BOTH, AS_THUMBNAIL_DONT_ENLARGE, AS_THUMBNAIL_DONT_REDUCE, AS_THUMBNAIL_NAME_FORMAT, AS_THUMBNAIL_PROPORTIONAL, ASA_ASImage, ASIMAGE_QUALITY_FAST, calculate_proportions(), destroy_asimage(), dup_asimage(), fetch_asimage(), file2ASImage_extra(), ASImageImportParams::flags, free(), ASImageManager::gamma, ASImageImportParams::gamma, get_flags, ASImage::height, ASImageImportParams::height, ASImage::imageman, init_asimage_import_params(), NULL, query_asimage(), safemalloc, scale_asimage(), ASImageManager::search_path, ASImageImportParams::search_path, sprintf(), store_asimage(), ASImageImportParams::width, and ASImage::width.

Referenced by handle_asxml_tag_img().

ASImage* gif2ASImage ( const char *  path,
ASImageImportParams params 
)

Definition at line 2174 of file import.c.

References a, APPLICATION_EXT_FUNC_CODE, ASStorage_Bitmap, ASStorage_RLEDiffCompress, b, GifColorType::Blue, ExtensionBlock::ByteCount, ExtensionBlock::Bytes, c, ASImage::channels, GifImageDesc::ColorMap, ColorMapObject::Colors, create_asimage(), DGifCloseFile(), SavedImage::ExtensionBlockCount, SavedImage::ExtensionBlocks, False, fclose(), fp, fprintf(), free(), free_gif_saved_images(), ExtensionBlock::Function, g, get_gif_saved_images(), GIF_ERROR, gif_interlaced2y(), GIF_OK, GRAPHICS_EXT_FUNC_CODE, GifColorType::Green, ASImage::height, height, GifImageDesc::Height, IC_ALPHA, IC_BLUE, IC_GREEN, IC_RED, SavedImage::ImageDesc, int, GifImageDesc::Interlace, MAX_IMPORT_IMAGE_SIZE, NULL, open_gif_read(), open_image_file(), params, SavedImage::RasterBits, GifColorType::Red, safemalloc, GifFileType::SBackGroundColor, GifFileType::SColorMap, set_asstorage_block_size(), show_error, SHOW_TIME, START_TIME, store_data(), True, GifImageDesc::Width, ASImage::width, width, x, x01, and y.

int gif_interlaced2y ( int  line,
int  height 
)

Definition at line 2143 of file import.c.

Referenced by gif2ASImage().

ASImage* ico2ASImage ( const char *  path,
ASImageImportParams params 
)

Definition at line 2060 of file import.c.

References ASStorage_32BitRLE, ASStorage_Bitmap, bmp_read16(), bmp_read32(), buf, ASImage::channels, fclose(), fprintf(), fread, free(), free_scanline(), fseek, IC_ALPHA, ICONDIR, infile, NULL, open_image_file(), params, read_bmp_image(), safemalloc, SEEK_SET, show_error, SHOW_TIME, START_TIME, store_data(), True, ASImage::width, x, x80, and y.

void init_asimage_import_params ( ASImageImportParams iparams  ) 

Definition at line 306 of file import.c.

References ASA_ASImage, ASImageImportParams::compression, ASImageImportParams::filter, ASImageImportParams::flags, ASImageImportParams::format, ASImageImportParams::gamma, ASImageImportParams::gamma_table, ASImageImportParams::height, NULL, SCL_DO_ALL, ASImageImportParams::search_path, ASImageImportParams::subimage, and ASImageImportParams::width.

Referenced by file2ASImage(), get_asimage_file_type(), get_thumbnail_asimage(), and load_image_from_path().

ASImage* jpeg2ASImage ( const char *  path,
ASImageImportParams params 
)

Definition at line 1541 of file import.c.

References apply_gamma(), AS_IMPORT_FAST, AS_IMPORT_SCALED_BOTH, ASStorage_32BitRLE, ASStorage_RLEDiffCompress, buf, buffer, ASImage::channels, create_asimage(), dup_data(), False, FALSE, fclose(), free_scanline(), get_flags, h, ASImage::height, IC_BLUE, IC_GREEN, IC_RED, infile, JDCT_IFAST, jpeg_abort_decompress(), jpeg_create_decompress, jpeg_destroy_decompress(), jpeg_finish_decompress(), jpeg_read_header(), jpeg_read_scanlines(), jpeg_std_error(), jpeg_stdio_src(), JPOOL_IMAGE, LOCAL_DEBUG_OUT, my_error_exit(), NULL, open_image_file(), params, prepare_scanline(), my_error_mgr::pub, ratio, raw2scanline(), set_asstorage_block_size(), my_error_mgr::setjmp_buffer, SHOW_TIME, START_TIME, store_data(), TRUE, True, void, w, ASImage::width, and y.

Bool load_asimage_list_entry_data ( ASImageListEntry entry,
size_t  max_bytes 
)

Definition at line 841 of file import.c.

References ASILEB_Binary, ASIT_HTML, ASIT_Unknown, ASIT_XML, ASIT_XMLScript, ASIT_Xpm, clear_flags, entry, False, fclose(), fopen, fp, fread, free(), fseek, i, len, malloc(), min, NULL, ptr, safecalloc, SEEK_SET, set_flags, size_t, and True.

static ASImage* load_image_from_path ( const char *  file,
char **  path,
double  gamma 
) [static]

Definition at line 394 of file import.c.

References file2ASImage_extra(), ASImageImportParams::gamma, init_asimage_import_params(), and ASImageImportParams::search_path.

Referenced by get_asimage(), and reload_asimage_manager().

static Bool load_tga_bw ( FILE *  infile,
ASTGAHeader tga,
ASTGAColorMap cmap,
ASScanline buf,
CARD8 *  read_buf,
CARD8 *  gamma_table 
) [static]

Definition at line 2843 of file import.c.

References True.

Referenced by tga2ASImage().

static Bool load_tga_colormapped ( FILE *  infile,
ASTGAHeader tga,
ASTGAColorMap cmap,
ASScanline buf,
CARD8 *  read_buf,
CARD8 *  gamma_table 
) [static]

Definition at line 2793 of file import.c.

References True.

Referenced by tga2ASImage().

static Bool load_tga_rle_bw ( FILE *  infile,
ASTGAHeader tga,
ASTGAColorMap cmap,
ASScanline buf,
CARD8 *  read_buf,
CARD8 *  gamma_table 
) [static]

Definition at line 2861 of file import.c.

References True.

Referenced by tga2ASImage().

static Bool load_tga_rle_colormapped ( FILE *  infile,
ASTGAHeader tga,
ASTGAColorMap cmap,
ASScanline buf,
CARD8 *  read_buf,
CARD8 *  gamma_table 
) [static]

Definition at line 2849 of file import.c.

References True.

Referenced by tga2ASImage().

static Bool load_tga_rle_truecolor ( FILE *  infile,
ASTGAHeader tga,
ASTGAColorMap cmap,
ASScanline buf,
CARD8 *  read_buf,
CARD8 *  gamma_table 
) [static]

Definition at line 2855 of file import.c.

References True.

Referenced by tga2ASImage().

static Bool load_tga_truecolor ( FILE *  infile,
ASTGAHeader tga,
ASTGAColorMap cmap,
ASScanline buf,
CARD8 *  read_buf,
CARD8 *  gamma_table 
) [static]

Definition at line 2799 of file import.c.

References buf, ASTGAHeader::Depth, False, fread, i, ASTGAHeader::ImageSpec, SCL_DO_ALPHA, SCL_DO_BLUE, SCL_DO_GREEN, SCL_DO_RED, set_flags, and True.

Referenced by tga2ASImage().

static ASImage* load_xml2ASImage ( ASImageManager imman,
const char *  path,
unsigned int  compression,
int  width,
int  height 
) [static]

Definition at line 2595 of file import.c.

References compose_asimage_xml_at_size(), free(), load_file, mystrndup, None, NULL, and show_error.

Referenced by xml2ASImage().

static char * locate_image_file ( const char *  file,
char **  paths 
) [static]

Definition at line 901 of file import.c.

References CheckFile, find_file, free(), i, mystrdup, NULL, R_OK, show_progress, and unix_path2dos_path().

Referenced by locate_image_file_in_path().

char* locate_image_file_in_path ( const char *  file,
ASImageImportParams iparams 
)

Definition at line 187 of file import.c.

References free(), i, locate_image_file(), NULL, safemalloc, ASImageImportParams::search_path, strcpy(), ASImageImportParams::subimage, and unix_path2dos_path().

Referenced by file2ASImage_extra(), and get_asimage_file_type().

my_error_exit ( j_common_ptr  cinfo  ) 

Definition at line 1529 of file import.c.

References my_error_mgr::setjmp_buffer.

Referenced by jpeg2ASImage().

static FILE* open_image_file ( const char *  path  )  [static]

Definition at line 933 of file import.c.

References fopen, fp, NULL, and show_error.

Referenced by bmp2ASImage(), check_image_type(), gif2ASImage(), ico2ASImage(), jpeg2ASImage(), png2ASImage(), ppm2ASImage(), tga2ASImage(), and xcf2ASImage().

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_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().

ASImage* png2ASImage ( const char *  path,
ASImageImportParams params 
)

Definition at line 1488 of file import.c.

References fclose(), fp, NULL, open_image_file(), params, and png2ASImage_int().

ASImage* png2ASImage_int ( void *  data,
png_rw_ptr  read_fn,
ASImageImportParams params 
)

Definition at line 1220 of file import.c.

References ASStorage_32Bit, ASStorage_Bitmap, ASStorage_RLEDiffCompress, b, bit_depth, buf, ASImage::channels, clear_flags, color_type, create_asimage(), DEFAULT_PNG_IMAGE_GAMMA, dup_data(), False, free(), free_scanline(), height, i, IC_ALPHA, IC_BLUE, IC_GREEN, IC_RED, info_ptr, intent, NULL, params, png_bytep, PNG_COLOR_MASK_ALPHA, PNG_COLOR_TYPE_GRAY, PNG_COLOR_TYPE_GRAY_ALPHA, PNG_COLOR_TYPE_PALETTE, PNG_COLOR_TYPE_RGB, png_create_info_struct(), png_create_read_struct(), PNG_FILLER_AFTER, png_get_gAMA(), png_get_IHDR(), png_get_rowbytes(), png_get_sRGB(), png_get_valid(), PNG_INFO_tRNS, png_init_io(), PNG_LIBPNG_VER_STRING, png_read_end(), png_read_image(), png_read_info(), png_read_update_info(), png_set_expand(), png_set_filler(), png_set_gamma(), png_set_packing(), png_set_read_fn(), png_set_strip_16(), png_uint_32, prepare_scanline(), raw2scanline(), row, row_pointers, safemalloc, set_asstorage_block_size(), set_flags, size_t, START_TIME, store_data(), True, ASImage::width, width, and y.

Referenced by png2ASImage(), and PNGBuff2ASimage().

ASImage* PNGBuff2ASimage ( CARD8 *  buffer,
ASImageImportParams params 
)

Definition at line 1477 of file import.c.

References asim_png_read_data(), buf, NULL, params, and png2ASImage_int().

Referenced by TASPluginGS::File2ASImage(), and TASImage::SetImageBuffer().

ASImage* ppm2ASImage ( const char *  path,
ASImageImportParams params 
)

Definition at line 1794 of file import.c.

References asimage_add_line(), buf, buffer, colors, create_asimage(), data, False, fclose(), fread, free(), free_scanline(), height, i, IC_ALPHA, IC_BLUE, IC_GREEN, IC_RED, infile, LOCAL_DEBUG_OUT, MAX_IMPORT_IMAGE_SIZE, NULL, open_image_file(), params, PPM_BUFFER_SIZE, prepare_scanline(), raw2scanline(), safemalloc, show_error, SHOW_TIME, size_t, START_TIME, True, type, ASImage::width, width, and y.

void print_asimage_func ( ASHashableValue  value  ) 

Definition at line 293 of file asimage.c.

References ASImage::alt, ASImage::ASImageAlternative::argb32, ASImage::back_color, ASImage::blue, ASImage::flags, fprintf(), ASImage::green, ASImage::height, ASImage::imageman, k, ASImage::magic, MAGIC_ASIMAGE, ASImage::ASImageAlternative::mask_ximage, ASImage::name, NULL, query_storage_slot(), ASImage::red, ASImage::ref_count, ASStorageSlot::size, ASImage::ASImageAlternative::vector, ASImage::width, and ASImage::ASImageAlternative::ximage.

Referenced by destroy_asimage(), and print_asimage_registry().

ASImage* read_bmp_image ( FILE *  infile,
size_t  data_offset,
BITMAPINFOHEADER bmp_info,
ASScanline buf,
CARD8 *  gamma_table,
unsigned int  width,
unsigned int  height,
Bool  add_colormap,
unsigned int  compression 
)

Definition at line 1927 of file import.c.

References asimage_add_line(), tagBITMAPINFOHEADER::biBitCount, tagBITMAPINFOHEADER::biCompression, tagBITMAPINFOHEADER::biHeight, tagBITMAPINFOHEADER::biPlanes, tagBITMAPINFOHEADER::biSize, tagBITMAPINFOHEADER::biSizeImage, tagBITMAPINFOHEADER::biWidth, bmp_read16(), bmp_read32(), buf, create_asimage(), data, dib_data_to_scanline(), False, fprintf(), fread, free(), fseek, IC_BLUE, IC_GREEN, IC_RED, long, MAX_IMPORT_IMAGE_SIZE, NULL, prepare_scanline(), safemalloc, SEEK_SET, True, ASImage::width, and y.

Referenced by bmp2ASImage(), and ico2ASImage().

ASImageListEntry* ref_asimage_list_entry ( ASImageListEntry entry  ) 

Definition at line 610 of file import.c.

References entry, IS_ASIMAGE_LIST_ENTRY, and NULL.

Bool reload_asimage_manager ( ASImageManager imman  ) 

Definition at line 575 of file import.c.

References ASIM_NAME_IS_FILENAME, asimage_replace(), destroy_asimage(), False, ASImage::flags, free(), ASImageManager::gamma, get_flags, ASImageManager::image_hash, load_image_from_path(), ASImage::name, NULL, ASImageManager::search_path, and True.

ASImage* svg2ASImage ( const char *  path,
ASImageImportParams params 
)

Definition at line 2735 of file import.c.

References NULL, and show_error.

ASImage* tga2ASImage ( const char *  path,
ASImageImportParams params 
)

Definition at line 2870 of file import.c.

References ASA_ASImage, ASIMAGE_QUALITY_DEFAULT, buf, ASTGAHeader::ColormapSpec, create_asimage(), destroy_asimage(), False, fclose(), fread, free(), free_scanline(), fseek, get_flags, ASImage::height, ASTGAHeader::ImageSpec, infile, int, load_tga_bw(), load_tga_colormapped(), load_tga_rle_bw(), load_tga_rle_colormapped(), load_tga_rle_truecolor(), load_tga_truecolor(), MAX_IMPORT_IMAGE_SIZE, NULL, open_image_file(), params, prepare_scanline(), read_buf(), safecalloc, safemalloc, SEEK_CUR, set_asstorage_block_size(), show_error, SHOW_TIME, start_image_output(), START_TIME, stop_image_output(), TGA_BWImage, TGA_ColormappedImage, TGA_NoImageData, TGA_RLEBWImage, TGA_RLEColormappedImage, TGA_RLETrueColorImage, TGA_TopToBottom, TGA_TrueColorImage, toggle_image_output_direction(), True, and ASImage::width.

ASImage* tiff2ASImage ( const char *  path,
ASImageImportParams params 
)

Definition at line 2319 of file import.c.

References a, advance_asim_strip(), ASA_ASImage, ASIMAGE_QUALITY_DEFAULT, ASStorage_Bitmap, ASStorage_RLEDiffCompress, b, bits, ASScanline::blue, c, ASImage::channels, create_asim_strip(), create_asimage(), data, decode_BG_12_be(), decode_GB_12_be(), decode_GR_12_be(), decode_RG_12_be(), depth, destroy_asim_strip(), destroy_asimage(), dup_data(), False, ASScanline::flags, free(), g, get_flags, ASImage::height, height, IC_ALPHA, IC_BLUE, IC_GREEN, IC_RED, interpolate_asim_strip_custom_rggb2(), ASIMStrip::lines, load_asim_strip(), LOCAL_DEBUG_OUT, MAX_IMPORT_IMAGE_SIZE, NULL, ASImageOutput::output_image_scanline, params, PHOTOMETRIC_CFA, ASScanline::red, row, safemalloc, SCL_DO_BLUE, SCL_DO_GREEN, SCL_DO_RED, set_asstorage_block_size(), set_flags, show_error, SHOW_TIME, start_image_output(), START_TIME, stop_image_output(), store_data(), True, ASImage::width, width, x, and y.

ASImageListEntry* unref_asimage_list_entry ( ASImageListEntry entry  ) 

Definition at line 623 of file import.c.

References destroy_asimage_list_entry_buffer(), entry, free(), IS_ASIMAGE_LIST_ENTRY, ASImageListEntry::next, NULL, ASImageListEntry::prev, and safe_asimage_destroy().

Referenced by destroy_asimage_list().

ASImage* xcf2ASImage ( const char *  path,
ASImageImportParams params 
)

Definition at line 1744 of file import.c.

References fclose(), free_xcf_image(), XcfImage::height, infile, XcfImage::layers, LOCAL_DEBUG_OUT, NULL, open_image_file(), print_xcf_image(), read_xcf_image(), SHOW_TIME, START_TIME, and XcfImage::width.

ASImage* xml2ASImage ( const char *  path,
ASImageImportParams params 
)

Definition at line 2621 of file import.c.

References AS_IMPORT_SCALED_H, AS_IMPORT_SCALED_V, get_flags, height, load_xml2ASImage(), NULL, params, SHOW_TIME, START_TIME, and width.

ASImage* xpm2ASImage ( const char *  path,
ASImageImportParams params 
)

Definition at line 1129 of file import.c.

References close_xpm_file(), LOCAL_DEBUG_CALLER_OUT, NULL, open_xpm_file(), params, show_error, SHOW_TIME, START_TIME, and xpm_file2ASImage().

ASImage* xpm_data2ASImage ( const char **  data,
ASImageImportParams params 
)

Definition at line 1153 of file import.c.

References close_xpm_file(), LOCAL_DEBUG_CALLER_OUT, NULL, open_xpm_data(), params, show_error, SHOW_TIME, START_TIME, and xpm_file2ASImage().

Referenced by TASImage::SetImageBuffer().

static ASImage* xpm_file2ASImage ( ASXpmFile xpm_file,
unsigned int  compression 
) [static]

Definition at line 1091 of file import.c.

References ASScanline::alpha, ASStorage_32Bit, ASStorage_Bitmap, ASStorage_RLEDiffCompress, ASScanline::blue, build_xpm_colormap(), ASImage::channels, convert_xpm_scanline(), create_xpm_image(), ASXpmFile::do_alpha, ASXpmFile::full_alpha, ASScanline::green, ASXpmFile::height, IC_ALPHA, IC_BLUE, IC_GREEN, IC_RED, line, LOCAL_DEBUG_OUT, NULL, print_component(), ASScanline::red, ASXpmFile::scl, set_asstorage_block_size(), store_data(), ASXpmFile::str_buf, ASXpmFile::width, and ASImage::width.

Referenced by xpm2ASImage(), xpm_data2ASImage(), and xpmRawBuff2ASImage().

ASImage* xpmRawBuff2ASImage ( const char *  data,
ASImageImportParams params 
)

Definition at line 1174 of file import.c.

References close_xpm_file(), LOCAL_DEBUG_CALLER_OUT, NULL, open_xpm_raw_data(), params, show_error, SHOW_TIME, START_TIME, and xpm_file2ASImage().

Referenced by TASImage::SetImageBuffer().


Variable Documentation

as_image_loader_func as_image_file_loaders[ASIT_Unknown]

Initial value:

{
        xpm2ASImage ,
        xpm2ASImage ,
        xpm2ASImage ,
        png2ASImage ,
        jpeg2ASImage,
        xcf2ASImage ,
        ppm2ASImage ,
        ppm2ASImage ,
        bmp2ASImage ,
        ico2ASImage ,
        ico2ASImage ,
        gif2ASImage ,
        tiff2ASImage,
        xml2ASImage ,
        svg2ASImage ,
        NULL,
        tga2ASImage,
        NULL,
        NULL,
        NULL
}

Definition at line 138 of file import.c.

Referenced by direntry2ASImageListEntry(), and file2ASImage_extra().

const char* as_image_file_type_names[ASIT_Unknown+1]

Initial value:

{
        "XPM" ,
        "Z-compressed XPM" ,
        "GZ-compressed XPM" ,
        "PNG" ,
        "JPEG",
        "GIMP Xcf" ,
        "PPM" ,
        "PNM" ,
        "MS Windows Bitmap" ,
        "MS Windows Icon" ,
        "MS Windows Cursor" ,
        "GIF" ,
        "TIFF",
        "AfterStep XML" ,
        "Scalable Vector Graphics (SVG)" ,
        "XBM",
        "Targa",
        "PCX",
        "HTML",
        "XML",
        "Unknown"
}

Definition at line 162 of file import.c.

Referenced by format_asimage_list_entry_details().


Generated on Tue Jul 5 15:57:55 2011 for ROOT_528-00b_version by  doxygen 1.5.1