Homepage > Man Pages > Category > Subroutines
Homepage > Man Pages > Name > L

libcaca importers/exporters from/to various -

man page of libcaca importers/exporters from/to various -

libcaca importers/exporters from/to various -: __extern ssize_t caca_import_canvas_from_memory

NAME

libcaca importers/exporters from/to various - Functions __extern ssize_t caca_import_canvas_from_memory (caca_canvas_t *, void const *, size_t, char const *) Import a memory buffer into a canvas. __extern ssize_t caca_import_canvas_from_file (caca_canvas_t *, char const *, char const *) Import a file into a canvas. __extern ssize_t caca_import_area_from_memory (caca_canvas_t *, int, int, void const *, size_t, char const *) Import a memory buffer into a canvas area. __extern ssize_t caca_import_area_from_file (caca_canvas_t *, int, int, char const *, char const *) Import a file into a canvas area. __extern char const *const caca_get_import_list (void) Get available import formats. __extern void * caca_export_canvas_to_memory (caca_canvas_t const *, char const *, size_t *) Export a canvas into a foreign format. __extern void * caca_export_area_to_memory (caca_canvas_t const *, int, int, int, int, char const *, size_t *) Export a canvas portion into a foreign format. __extern char const *const caca_get_export_list (void) Get available export formats.

DETAILED DESCRIPTION

formats These functions import various file formats into a new canvas, or export the current canvas to various text formats.

FUNCTION DOCUMENTATION

__extern ssize_t caca_import_canvas_from_memory (caca_canvas_t *cv, void const *data, size_tlen, char const *format) Import a memory buffer into the given libcaca canvas's current frame. The current frame is resized accordingly and its contents are replaced with the imported data. Valid values for format are: o "": attempt to autodetect the file format. o "caca": import native libcaca files. o "text": import ASCII text files. o "ansi": import ANSI files. o "utf8": import UTF-8 files with ANSI colour codes. The number of bytes read is returned. If the file format is valid, but not enough data was available, 0 is returned. If an error occurs, -1 is returned and errno is set accordingly: o ENOMEM Not enough memory to allocate canvas. o EINVAL Invalid format requested. Parameters: cv A libcaca canvas in which to import the file. data A memory area containing the data to be loaded into the canvas. len The size in bytes of the memory area. format A string describing the input format. Returns: The number of bytes read, or 0 if there was not enough data, or -1 if an error occurred. Referenced by caca_import_area_from_memory(), and caca_import_canvas_from_file(). __extern ssize_t caca_import_canvas_from_file (caca_canvas_t *cv, char const *filename, char const *format) Import a file into the given libcaca canvas's current frame. The current frame is resized accordingly and its contents are replaced with the imported data. Valid values for format are: o "": attempt to autodetect the file format. o "caca": import native libcaca files. o "text": import ASCII text files. o "ansi": import ANSI files. o "utf8": import UTF-8 files with ANSI colour codes. The number of bytes read is returned. If the file format is valid, but not enough data was available, 0 is returned. If an error occurs, -1 is returned and errno is set accordingly: o ENOSYS File access is not implemented on this system. o ENOMEM Not enough memory to allocate canvas. o EINVAL Invalid format requested. caca_import_file() may also fail and set errno for any of the errors specified for the routine fopen(). Parameters: cv A libcaca canvas in which to import the file. filename The name of the file to load. format A string describing the input format. Returns: The number of bytes read, or 0 if there was not enough data, or -1 if an error occurred. References caca_file_close(), caca_file_eof(), caca_file_open(), caca_file_read(), and caca_import_canvas_from_memory(). Referenced by caca_import_area_from_file(). __extern ssize_t caca_import_area_from_memory (caca_canvas_t *cv, intx, inty, void const *data, size_tlen, char const *format) Import a memory buffer into the given libcaca canvas's current frame, at the specified position. For more information, see caca_import_canvas_from_memory(). If an error occurs, -1 is returned and errno is set accordingly: o EINVAL Unsupported format requested or invalid coordinates. o ENOMEM Not enough memory to allocate canvas. Parameters: cv A libcaca canvas in which to import the file. x The leftmost coordinate of the area to import to. y The topmost coordinate of the area to import to. data A memory area containing the data to be loaded into the canvas. len The size in bytes of the memory area. format A string describing the input format. Returns: The number of bytes read, or 0 if there was not enough data, or -1 if an error occurred. References caca_blit(), caca_create_canvas(), caca_free_canvas(), and caca_import_canvas_from_memory(). __extern ssize_t caca_import_area_from_file (caca_canvas_t *cv, intx, inty, char const *filename, char const *format) Import a file into the given libcaca canvas's current frame, at the specified position. For more information, see caca_import_canvas_from_file(). If an error occurs, -1 is returned and errno is set accordingly: o ENOSYS File access is not implemented on this system. o ENOMEM Not enough memory to allocate canvas. o EINVAL Unsupported format requested or invalid coordinates. caca_import_file() may also fail and set errno for any of the errors specified for the routine fopen(). Parameters: cv A libcaca canvas in which to import the file. x The leftmost coordinate of the area to import to. y The topmost coordinate of the area to import to. filename The name of the file to load. format A string describing the input format. Returns: The number of bytes read, or 0 if there was not enough data, or -1 if an error occurred. References caca_blit(), caca_create_canvas(), caca_free_canvas(), and caca_import_canvas_from_file(). __extern char const* const caca_get_import_list (void) Return a list of available import formats. The list is a NULL-terminated array of strings, interleaving a string containing the internal value for the import format, to be used with caca_import_canvas(), and a string containing the natural language description for that import format. This function never fails. Returns: An array of strings. __extern void* caca_export_canvas_to_memory (caca_canvas_t const *cv, char const *format, size_t *bytes) This function exports a libcaca canvas into various foreign formats such as ANSI art, HTML, IRC colours, etc. The returned pointer should be passed to free() to release the allocated storage when it is no longer needed. Valid values for format are: o "caca": export native libcaca files. o "ansi": export ANSI art (CP437 charset with ANSI colour codes). o "html": export an HTML page with CSS information. o "html3": export an HTML table that should be compatible with most navigators, including textmode ones. o "irc": export UTF-8 text with mIRC colour codes. o "ps": export a PostScript document. o "svg": export an SVG vector image. o "tga": export a TGA image. o "troff": export a troff source. If an error occurs, NULL is returned and errno is set accordingly: o EINVAL Unsupported format requested. o ENOMEM Not enough memory to allocate output buffer. Parameters: cv A libcaca canvas format A string describing the requested output format. bytes A pointer to a size_t where the number of allocated bytes will be written. Returns: A pointer to the exported memory area, or NULL in case of error. Referenced by caca_export_area_to_memory(). __extern void* caca_export_area_to_memory (caca_canvas_t const *cv, intx, inty, intw, inth, char const *format, size_t *bytes) This function exports a portion of a libcaca canvas into various formats. For more information, see caca_export_canvas_to_memory(). If an error occurs, NULL is returned and errno is set accordingly: o EINVAL Unsupported format requested or invalid coordinates. o ENOMEM Not enough memory to allocate output buffer. Parameters: cv A libcaca canvas x The leftmost coordinate of the area to export. y The topmost coordinate of the area to export. w The width of the area to export. h The height of the area to export. format A string describing the requested output format. bytes A pointer to a size_t where the number of allocated bytes will be written. Returns: A pointer to the exported memory area, or NULL in case of error. References caca_blit(), caca_create_canvas(), caca_export_canvas_to_memory(), and caca_free_canvas(). __extern char const* const caca_get_export_list (void) Return a list of available export formats. The list is a NULL-terminated array of strings, interleaving a string containing the internal value for the export format, to be used with caca_export_memory(), and a string containing the natural language description for that export format. This function never fails. Returns: An array of strings.

AUTHOR

Generated automatically by Doxygen for libcaca from the source code. Version 0.99.beta17 libcaca importers/exporters from/to various(3caca) LIBCACA IMPORTERS/EXPORTERS FROM/TO VARIOUS -(3)
 
 
 

Copyright © 2011–2018 by topics-of-interest.com . All rights reserved. Hosted by all-inkl.
Contact · Imprint · Privacy

Page generated in 41.56ms.

www.daelim-wiki.de | brennholz-eichelberg.de | und-verkauft.de