#include "asimage.h"
#include "xcf.h"
#include "xpm.h"
Go to the source code of this file.
#define AS_IMPORT_FAST (0x01<<5) |
#define AS_IMPORT_RESIZED (AS_IMPORT_RESIZE_V|AS_IMPORT_RESIZE_H) |
#define AS_IMPORT_SCALED_BOTH (AS_IMPORT_SCALED_H|AS_IMPORT_SCALED_V) |
#define AS_IMPORT_SCALED_H (0x01<<3) |
#define AS_IMPORT_SCALED_V (0x01<<4) |
#define AS_THUMBNAIL_DONT_ENLARGE (0x01<<1) |
#define AS_THUMBNAIL_DONT_REDUCE (0x01<<2) |
#define AS_THUMBNAIL_PROPORTIONAL (0x01<<0) |
Definition at line 224 of file import.h.
Referenced by get_thumbnail_asimage(), and handle_asxml_tag_img().
#define ASILEB_Binary (0x01<<1) |
#define DEFAULT_PNG_IMAGE_GAMMA 0.45455 |
#define IS_ASIMAGE_LIST_ENTRY | ( | e | ) | (((e)!=NULL)&&((e)->magic==MAGIC_ASIMAGE_LIST_ENTRY)&&((e)->ref_count>0)) |
Definition at line 90 of file import.h.
Referenced by destroy_asimage_list(), ref_asimage_list_entry(), and unref_asimage_list_entry().
#define MAGIC_ASIMAGE_LIST_ENTRY 0xA3A311E4 |
#define SCALE_PREVIEW_H AS_IMPORT_SCALED_H |
#define SCALE_PREVIEW_V AS_IMPORT_SCALED_V |
#define SCREEN_GAMMA 2.2 |
Definition at line 33 of file import.h.
Referenced by create_generic_imageman(), TASImage::DrawText(), file2pixmap(), TASImage::ReadImage(), and WinMain().
typedef ASImage*(*) as_image_loader_func(const char *path, ASImageImportParams *params) |
enum ASImageFileTypes |
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.
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.
ASImageFileTypes check_asimage_file_type | ( | const char * | realfilename | ) |
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 | ) |
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 * | params | |||
) |
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 | ( | struct 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().
ASImage* get_asimage_extra | ( | ASImageManager * | imageman, | |
const char * | file, | |||
ASImageImportParams * | params | |||
) |
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 | ( | struct 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.
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.
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 | |||
) |
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* 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.
ASImageListEntry* ref_asimage_list_entry | ( | ASImageListEntry * | entry | ) |
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 | |||
) |
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().
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().
as_image_loader_func as_image_file_loaders[ASIT_Unknown] |
Definition at line 138 of file import.c.
Referenced by direntry2ASImageListEntry(), and file2ASImage_extra().