![]() |
Coin3D is Free Software, published under the BSD 3-clause license. |
https://coin3d.github.io https://www.kongsberg.com/en/kogt/ |
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <config.h>
#include <simage.h>
#include <string.h>
#include <ctype.h>
Go to the source code of this file.
Data Structures | |
struct | _saver_data |
Macros | |
#define | SIMAGE_ERROR_BUFSIZE 512 /* hack warning. Must match define in simage.c */ |
Typedefs | |
typedef struct _saver_data | saver_data |
Functions | |
static char * | safe_strdup (const char *str) |
static void | safe_strfree (char *str) |
static int | simage_strcasecmp (const char *str1, const char *str2) |
static void | add_saver_data (saver_data *saver, int(*error_func)(char *, int), const char *extensions, const char *fullname, const char *description, int is_internal, int addbefore) |
static void * | add_saver (saver_data *saver, int(*save_func)(const char *, const unsigned char *, int, int, int), int(*error_func)(char *, int), const char *extensions, const char *fullname, const char *description, int is_internal, int addbefore) |
static void * | add_saver_ext (saver_data *saver, int(*save_func)(const char *, const unsigned char *, int, int, int, const char *), int(*error_func)(char *, int), const char *extensions, const char *fullname, const char *description, int is_internal, int addbefore) |
static saver_data * | find_saver (const char *filenameextension) |
static void | str_tolower (char *str) |
static void | add_internal_savers (void) |
int | simage_save_image (const char *filename, const unsigned char *bytes, int width, int height, int numcomponents, const char *filenameextension) |
void * | simage_add_saver (int(*save_func)(const char *name, const unsigned char *bytes, int width, int height, int nc), int(*error_func)(char *textbuffer, int bufferlen), const char *extensions, const char *fullname, const char *description, int addbefore) |
void | simage_remove_saver (void *handle) |
int | simage_check_save_supported (const char *filenameextension) |
int | simage_get_num_savers (void) |
void * | simage_get_saver_handle (int idx) |
const char * | simage_get_saver_extensions (void *handle) |
const char * | simage_get_saver_fullname (void *handle) |
const char * | simage_get_saver_description (void *handle) |
Variables | |
static saver_data * | first_saver = NULL |
static saver_data * | last_saver = NULL |
static char | jpegext [] = "jpg,jpeg" |
static const char | jpegfull [] = "The Independent JPEG Group file format" |
static char | pngext [] = "png" |
static const char | pngfull [] = "The PNG file format" |
static char | tiffext [] = "tiff,tif" |
static const char | tifffull [] = "The Tag Image File Format" |
static char | rgbext [] = "rgb,rgba,bw,inta,int" |
static const char | rgbfull [] ="The SGI RGB file format" |
static char | gifext [] = "gif" |
static const char | giffull [] = "The Graphics Interchange Format" |
static char | epsext [] = "eps,ps" |
static const char | epsfull [] ="Encapsulated postscript" |
char | simage_error_msg [] |
#define SIMAGE_ERROR_BUFSIZE 512 /* hack warning. Must match define in simage.c */ |
Definition at line 428 of file simage_write.c.
Referenced by simage_save_image().
typedef struct _saver_data saver_data |
Definition at line 43 of file simage_write.c.
|
static |
Definition at line 263 of file simage_write.c.
References add_saver(), add_saver_ext(), simage_cgimage_error(), simage_cgimage_get_savers(), simage_cgimage_save(), simage_eps_error(), simage_eps_save(), simage_gdiplus_error(), simage_gdiplus_get_savers(), simage_gdiplus_save(), simage_gif_error(), simage_gif_save(), simage_jpeg_error(), simage_jpeg_save(), simage_png_error(), simage_png_save(), simage_qimage_error(), simage_qimage_get_savers(), simage_qimage_save(), simage_quicktime_error(), simage_quicktime_get_savers(), simage_quicktime_save(), simage_rgb_error(), simage_rgb_save(), simage_tiff_error(), simage_tiff_save(), and str_tolower().
Referenced by simage_add_saver(), simage_check_save_supported(), simage_get_num_savers(), and simage_save_image().
|
static |
Definition at line 168 of file simage_write.c.
References add_saver_data(), _saver_data::error_func, _saver_data::save_func, and _saver_data::save_func_ext.
Referenced by add_internal_savers(), and simage_add_saver().
|
static |
Definition at line 138 of file simage_write.c.
References _saver_data::description, _saver_data::error_func, _saver_data::extensions, first_saver, _saver_data::fullname, _saver_data::is_internal, _saver_data::next, and safe_strdup().
Referenced by add_saver(), and add_saver_ext().
|
static |
Definition at line 188 of file simage_write.c.
References add_saver_data(), _saver_data::error_func, _saver_data::save_func, and _saver_data::save_func_ext.
Referenced by add_internal_savers().
|
static |
Definition at line 214 of file simage_write.c.
References _saver_data::extensions, first_saver, _saver_data::next, and simage_strcasecmp().
Referenced by simage_check_save_supported(), and simage_save_image().
|
static |
Definition at line 89 of file simage_write.c.
Referenced by add_saver_data().
|
static |
Definition at line 100 of file simage_write.c.
Referenced by simage_remove_saver().
void* simage_add_saver | ( | int(*)(const char *name, const unsigned char *bytes, int width, int height, int nc) | save_func, |
int(*)(char *textbuffer, int bufferlen) | error_func, | ||
const char * | extensions, | ||
const char * | fullname, | ||
const char * | description, | ||
int | addbefore | ||
) |
Definition at line 469 of file simage_write.c.
References add_internal_savers(), add_saver(), _saver_data::error_func, and _saver_data::save_func.
int simage_check_save_supported | ( | const char * | filenameextension | ) |
Checks if export is available for a file type. Returns 1 if a saver of type filenameextension is supported, 0 otherwise. The built-in savers are gif, jpg/jpeg, png, tif/tiff and rgb.
Definition at line 515 of file simage_write.c.
References add_internal_savers(), and find_saver().
int simage_get_num_savers | ( | void | ) |
Definition at line 524 of file simage_write.c.
References add_internal_savers(), first_saver, and _saver_data::next.
const char* simage_get_saver_description | ( | void * | handle | ) |
Definition at line 567 of file simage_write.c.
References _saver_data::description.
const char* simage_get_saver_extensions | ( | void * | handle | ) |
Definition at line 553 of file simage_write.c.
References _saver_data::extensions.
const char* simage_get_saver_fullname | ( | void * | handle | ) |
Definition at line 560 of file simage_write.c.
References _saver_data::fullname.
void* simage_get_saver_handle | ( | int | idx | ) |
Definition at line 542 of file simage_write.c.
References first_saver, and _saver_data::next.
void simage_remove_saver | ( | void * | handle | ) |
Definition at line 489 of file simage_write.c.
References _saver_data::description, _saver_data::extensions, first_saver, _saver_data::fullname, _saver_data::is_internal, _saver_data::next, and safe_strfree().
int simage_save_image | ( | const char * | filename, |
const unsigned char * | bytes, | ||
int | w, | ||
int | h, | ||
int | numcomponents, | ||
const char * | filenameextension | ||
) |
Saves image in the format specified in filenameextension. Use simage_check_write_supported first to verify that the file format is supported.
Definition at line 433 of file simage_write.c.
References add_internal_savers(), _saver_data::error_func, find_saver(), _saver_data::save_func, _saver_data::save_func_ext, and SIMAGE_ERROR_BUFSIZE.
Referenced by s_image_save().
|
static |
Definition at line 110 of file simage_write.c.
Referenced by find_saver().
|
static |
Definition at line 254 of file simage_write.c.
Referenced by add_internal_savers().
|
static |
Definition at line 250 of file simage_write.c.
|
static |
Definition at line 251 of file simage_write.c.
|
static |
Definition at line 85 of file simage_write.c.
Referenced by add_saver_data(), find_saver(), simage_get_num_savers(), simage_get_saver_handle(), and simage_remove_saver().
|
static |
Definition at line 248 of file simage_write.c.
|
static |
Definition at line 249 of file simage_write.c.
|
static |
Definition at line 240 of file simage_write.c.
|
static |
Definition at line 241 of file simage_write.c.
|
static |
Definition at line 86 of file simage_write.c.
|
static |
Definition at line 242 of file simage_write.c.
|
static |
Definition at line 243 of file simage_write.c.
|
static |
Definition at line 246 of file simage_write.c.
|
static |
Definition at line 247 of file simage_write.c.
char simage_error_msg[] |
Definition at line 289 of file simage.c.
Referenced by simage_get_last_error().
|
static |
Definition at line 244 of file simage_write.c.
|
static |
Definition at line 245 of file simage_write.c.