#include "config.h"
#include <png.h>
#include <X11/Xmd.h>
#include <jpeglib.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.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 "xcf.h"
#include "xpm.h"
#include "ungif.h"
#include "import.h"
#include "export.h"
#include "ascmap.h"
#include "bmp.h"
Go to the source code of this file.
#define GIF_GCE_BYTES 4 |
Referenced by ASImage2gif().
#define GIF_NETSCAPE_EXT_BYTES 3 |
Referenced by ASImage2gif().
#define SHOW_PENDING_IMPLEMENTATION_NOTE | ( | f | ) | show_error( "I'm sorry, but " f " image writing is pending implementation. Appreciate your patience" ) |
Definition at line 258 of file export.c.
Referenced by ASImage2ico(), ASImage2ppm(), and ASImage2xcf().
void asim_png_flush_data | ( | png_structp | png_ptr | ) |
void asim_png_write_data | ( | png_structp | png_ptr, | |
png_bytep | data, | |||
png_size_t | length | |||
) |
Definition at line 667 of file export.c.
References ASImPNGBuffer::allocated_size, ASImPNGBuffer::buffer, png_get_io_ptr(), realloc(), and ASImPNGBuffer::used_size.
Referenced by ASImage2PNGBuff().
Bool ASImage2bmp | ( | ASImage * | im, | |
const char * | path, | |||
ASImageExportParams * | params | |||
) |
Definition at line 976 of file export.c.
References ASImage2DBI, tagBITMAPFILEHEADER::bfOffBits, tagBITMAPFILEHEADER::bfReserved1, tagBITMAPFILEHEADER::bfReserved2, tagBITMAPFILEHEADER::bfSize, tagBITMAPFILEHEADER::bfType, tagBITMAPINFOHEADER::biCompression, tagBITMAPINFOHEADER::biHeight, tagBITMAPINFOHEADER::biPlanes, tagBITMAPINFOHEADER::biSize, tagBITMAPINFOHEADER::biWidth, bmbits, bmi, tagBITMAPINFO::bmiHeader, BMP_SIGNATURE, bmp_write16(), bmp_write32(), False, fclose(), free(), fwrite, get_default_asvisual(), ASImage::height, NULL, open_writeable_image_file(), outfile, SHOW_TIME, START_TIME, True, and ASImage::width.
Referenced by TASImage::WriteImage().
Bool ASImage2file | ( | ASImage * | im, | |
const char * | dir, | |||
const char * | file, | |||
ASImageFileTypes | type, | |||
ASImageExportParams * | params | |||
) |
Definition at line 144 of file export.c.
References as_image_file_writers, ASIT_Unknown, False, free(), NULL, params, safemalloc, show_error, strcpy(), and unix_path2dos_path().
Referenced by save_asimage_to_file(), and TASImage::WriteImage().
Bool ASImage2gif | ( | ASImage * | im, | |
const char * | path, | |||
ASImageExportParams * | params | |||
) |
Definition at line 1036 of file export.c.
References APPLICATION_EXT_FUNC_CODE, ASIT_Gif, ColorMapObject::ColorCount, GifImageDesc::ColorMap, colormap_asimage(), ColorMapObject::Colors, ASColormap::count, destroy_colormap(), DGifCloseFile(), EGifCloseFile(), EGifOpenFileHandle(), EGifPutExtension(), EGifPutExtensionFirst(), EGifPutExtensionLast(), EGifPutImageDesc(), EGifPutLine(), EGifPutScreenDesc(), ASColormap::entries, EXPORT_ALPHA, EXPORT_ANIMATION_REPEATS, EXPORT_APPEND, False, FALSE, fclose(), fopen, fprintf(), free(), free_gif_saved_images(), FreeMapObject(), get_asimage_chanmask(), get_flags, get_gif_saved_images(), ASImageExportParams::gif, GIF_ERROR, GIF_GCE_BYTES, GIF_NETSCAPE_EXT_BYTES, GIF_OK, GRAPHICS_EXT_FUNC_CODE, ASImage::height, GifFileType::Image, infile, LOCAL_DEBUG_CALLER_OUT, MakeMapObject(), MIN, NULL, open_gif_read(), open_writeable_image_file(), outfile, params, safemalloc, GifFileType::SBackGroundColor, SCL_DO_ALPHA, GifFileType::SColorMap, GifFileType::SColorResolution, GifFileType::SHeight, SHOW_TIME, START_TIME, GifFileType::SWidth, True, ASGifExportParams::type, ASImageExportParams::type, ASImage::width, write_gif_saved_images(), x, x01, and y.
Bool ASImage2ico | ( | ASImage * | im, | |
const char * | path, | |||
ASImageExportParams * | params | |||
) |
Definition at line 1025 of file export.c.
References False, SHOW_PENDING_IMPLEMENTATION_NOTE, SHOW_TIME, and START_TIME.
Bool ASImage2jpeg | ( | ASImage * | im, | |
const char * | path, | |||
ASImageExportParams * | params | |||
) |
Definition at line 740 of file export.c.
References ASIT_Jpeg, b, ASScanline::blue, ASImageDecoder::buffer, ASImageDecoder::decode_image_scanline, EXPORT_GRAYSCALE, False, fclose(), free(), g, get_flags, ASScanline::green, ASImage::height, i, jpeg_compress_struct::image_height, jpeg_compress_struct::image_width, jpeg_compress_struct::in_color_space, jpeg_compress_struct::input_components, int, JCS_GRAYSCALE, JCS_RGB, ASImageExportParams::jpeg, jpeg_create_compress, jpeg_destroy_compress(), jpeg_finish_compress(), jpeg_set_defaults(), jpeg_set_quality(), jpeg_start_compress(), jpeg_std_error(), jpeg_stdio_dest(), jpeg_write_scanlines(), LOCAL_DEBUG_OUT, MIN, NULL, open_writeable_image_file(), outfile, params, ASScanline::red, safemalloc, SCL_DO_BLUE, SCL_DO_GREEN, SCL_DO_RED, SHOW_TIME, start_image_decoding(), START_TIME, stop_image_decoding(), TRUE, True, ASJpegExportParams::type, ASImageExportParams::type, void, ASImage::width, and y.
Bool ASImage2png | ( | ASImage * | im, | |
const char * | path, | |||
register ASImageExportParams * | params | |||
) |
Definition at line 642 of file export.c.
References ASImage2png_int(), False, fclose(), NULL, open_writeable_image_file(), and outfile.
static Bool ASImage2png_int | ( | ASImage * | im, | |
void * | data, | |||
png_rw_ptr | write_fn, | |||
png_flush_ptr | flush_fn, | |||
register ASImageExportParams * | params | |||
) | [static] |
Definition at line 480 of file export.c.
References a, ASScanline::alpha, ARGB32_BLUE16, ARGB32_GREEN16, ARGB32_RED16, ASIT_Png, b, ASImage::back_color, png_color_16_struct::blue, ASScanline::blue, ASImageDecoder::buffer, ASPngExportParams::compression, ASImageDecoder::decode_image_scanline, EXPORT_ALPHA, EXPORT_GRAYSCALE, False, ASPngExportParams::flags, free(), g, get_asimage_chanmask(), get_flags, ASScanline::green, png_color_16_struct::green, ASImage::height, i, info_ptr, int, LOCAL_DEBUG_OUT, MIN, NULL, PNG_COLOR_TYPE_GRAY, PNG_COLOR_TYPE_GRAY_ALPHA, PNG_COLOR_TYPE_RGB, PNG_COLOR_TYPE_RGB_ALPHA, PNG_COMPRESSION_TYPE_DEFAULT, png_create_info_struct(), png_create_write_struct(), png_destroy_info_struct(), png_destroy_write_struct(), PNG_FILTER_TYPE_DEFAULT, png_init_io(), PNG_INTERLACE_NONE, PNG_LIBPNG_VER_STRING, png_set_bKGD(), png_set_compression_level(), png_set_IHDR(), png_set_write_fn(), png_write_end(), png_write_info(), png_write_rows(), ASScanline::red, png_color_16_struct::red, safecalloc, safemalloc, SCL_DO_ALL, SCL_DO_ALPHA, SCL_DO_BLUE, SCL_DO_GREEN, SCL_DO_RED, SHOW_TIME, start_image_decoding(), START_TIME, stop_image_decoding(), True, ASImage::width, and y.
Referenced by ASImage2png(), and ASImage2PNGBuff().
Bool ASImage2PNGBuff | ( | ASImage * | im, | |
CARD8 ** | buffer, | |||
int * | size, | |||
ASImageExportParams * | params | |||
) |
Definition at line 689 of file export.c.
References asim_png_flush_data(), asim_png_write_data(), ASImage2png_int(), ASImPNGBuffer::buffer, False, free(), NULL, params, True, and ASImPNGBuffer::used_size.
Referenced by TASImage::GetImageBuffer().
Bool ASImage2ppm | ( | ASImage * | im, | |
const char * | path, | |||
ASImageExportParams * | params | |||
) |
Definition at line 919 of file export.c.
References False, SHOW_PENDING_IMPLEMENTATION_NOTE, SHOW_TIME, and START_TIME.
Bool ASImage2tiff | ( | ASImage * | im, | |
const char * | path, | |||
ASImageExportParams * | params | |||
) |
Definition at line 1240 of file export.c.
References a, ASScanline::alpha, ASImage2tiff(), ASIT_Tiff, b, ASScanline::blue, buf, ASImageDecoder::buffer, ASTiffExportParams::compression_type, ASImageDecoder::decode_image_scanline, EXPORT_ALPHA, EXPORT_GRAYSCALE, False, g, get_asimage_chanmask(), get_flags, ASScanline::green, ASImage::height, i, k, LOCAL_DEBUG_OUT, NULL, out, params, ASScanline::red, row, SCL_DO_ALL, SCL_DO_ALPHA, SCL_DO_BLUE, SCL_DO_GREEN, SCL_DO_RED, SHOW_TIME, SHOW_UNSUPPORTED_NOTE, start_image_decoding(), START_TIME, stop_image_decoding(), TIFF_COMPRESSION_NONE, True, ASTiffExportParams::type, and ASImage::width.
Referenced by ASImage2tiff().
Bool ASImage2xcf | ( | ASImage * | im, | |
const char * | path, | |||
ASImageExportParams * | params | |||
) |
Definition at line 895 of file export.c.
References False, free_xcf_image(), NULL, print_xcf_image(), SHOW_PENDING_IMPLEMENTATION_NOTE, SHOW_TIME, and START_TIME.
Referenced by TASImage::WriteImage().
Bool ASImage2xpm | ( | ASImage * | im, | |
const char * | path, | |||
ASImageExportParams * | params | |||
) |
Definition at line 271 of file export.c.
References ASIT_Xpm, ASColormapEntry::blue, build_xpm_charmap(), ASXpmCharmap::char_code, colormap_asimage(), ASColormap::count, ASXpmCharmap::count, ASXpmCharmap::cpp, destroy_colormap(), destroy_xpm_charmap(), ASColormap::entries, EXPORT_ALPHA, False, fclose(), fprintf(), free(), get_flags, ASColormapEntry::green, ASColormap::has_opaque, ASImage::height, height, LOCAL_DEBUG_CALLER_OUT, LOCAL_DEBUG_OUT, NULL, open_writeable_image_file(), outfile, params, ptr, ASColormapEntry::red, show_error, SHOW_TIME, START_TIME, True, ASImageExportParams::type, ASXpmExportParams::type, ASImage::width, x, ASImageExportParams::xpm, and y.
Bool ASImage2xpmRawBuff | ( | ASImage * | im, | |
CARD8 ** | buffer, | |||
int * | size, | |||
ASImageExportParams * | params | |||
) |
Definition at line 354 of file export.c.
References ASIT_Xpm, ASColormapEntry::blue, build_xpm_charmap(), calloc(), ASXpmCharmap::char_code, colormap_asimage(), ASColormap::count, ASXpmCharmap::count, ASXpmCharmap::cpp, destroy_colormap(), destroy_xpm_charmap(), ASColormap::entries, EXPORT_ALPHA, False, free(), get_flags, ASColormapEntry::green, ASColormap::has_opaque, ASImage::height, LOCAL_DEBUG_OUT, NULL, params, ptr, ASColormapEntry::red, SHOW_TIME, sprintf(), START_TIME, True, ASImageExportParams::type, ASXpmExportParams::type, ASImage::width, x, ASImageExportParams::xpm, and y.
Referenced by TASImage::CreateThumbnail(), and TASImage::GetImageBuffer().
static size_t bmp_write16 | ( | FILE * | fp, | |
CARD16 * | data, | |||
int | count | |||
) | [static] |
static size_t bmp_write32 | ( | FILE * | fp, | |
CARD32 * | data, | |||
int | count | |||
) | [static] |
static FILE* open_writeable_image_file | ( | const char * | path | ) | [static] |
Definition at line 186 of file export.c.
References fopen, fp, NULL, and show_error.
Referenced by ASImage2bmp(), ASImage2gif(), ASImage2jpeg(), ASImage2png(), and ASImage2xpm().
void scanline2raw | ( | register CARD8 * | row, | |
ASScanline * | buf, | |||
CARD8 * | gamma_table, | |||
unsigned int | width, | |||
Bool | grayscale, | |||
Bool | do_alpha | |||
) |
as_image_writer_func as_image_file_writers[ASIT_Unknown] |
Initial value:
{ ASImage2xpm , ASImage2xpm , ASImage2xpm , ASImage2png , ASImage2jpeg, ASImage2xcf , ASImage2ppm , ASImage2ppm , ASImage2bmp , ASImage2ico , ASImage2ico , ASImage2gif , ASImage2tiff, NULL, NULL, NULL }
Definition at line 123 of file export.c.
Referenced by ASImage2file().