#include <stddef.h>
#ifndef LIBSIXEL_SIXEL_H
#define LIBSIXEL_SIXEL_H
#ifdef _WIN32
# define SIXELAPI __declspec(dllexport)
#else
# define SIXELAPI
#endif
#define LIBSIXEL_VERSION "1.7.3"
#define LIBSIXEL_ABI_VERSION "1:6:0"
#define SIXEL_OUTPUT_PACKET_SIZE 16384
#define SIXEL_PALETTE_MIN 2
#define SIXEL_PALETTE_MAX 256
#define SIXEL_USE_DEPRECATED_SYMBOLS 1
typedef int SIXELSTATUS;
#define SIXEL_OK 0x0000
#define SIXEL_FALSE 0x1000
#define SIXEL_RUNTIME_ERROR (SIXEL_FALSE | 0x0100)
#define SIXEL_LOGIC_ERROR (SIXEL_FALSE | 0x0200)
#define SIXEL_FEATURE_ERROR (SIXEL_FALSE | 0x0300)
#define SIXEL_LIBC_ERROR (SIXEL_FALSE | 0x0400)
#define SIXEL_CURL_ERROR (SIXEL_FALSE | 0x0500)
#define SIXEL_JPEG_ERROR (SIXEL_FALSE | 0x0600)
#define SIXEL_PNG_ERROR (SIXEL_FALSE | 0x0700)
#define SIXEL_GDK_ERROR (SIXEL_FALSE | 0x0800)
#define SIXEL_GD_ERROR (SIXEL_FALSE | 0x0900)
#define SIXEL_STBI_ERROR (SIXEL_FALSE | 0x0a00)
#define SIXEL_STBIW_ERROR (SIXEL_FALSE | 0x0b00)
#define SIXEL_INTERRUPTED (SIXEL_OK | 0x0001)
#define SIXEL_BAD_ALLOCATION (SIXEL_RUNTIME_ERROR | 0x0001)
#define SIXEL_BAD_ARGUMENT (SIXEL_RUNTIME_ERROR | 0x0002)
#define SIXEL_BAD_INPUT (SIXEL_RUNTIME_ERROR | 0x0003)
#define SIXEL_NOT_IMPLEMENTED (SIXEL_FEATURE_ERROR | 0x0001)
#define SIXEL_SUCCEEDED(status) (((status) & 0x1000) == 0)
#define SIXEL_FAILED(status) (((status) & 0x1000) != 0)
#define SIXEL_LARGE_AUTO 0x0
#define SIXEL_LARGE_NORM 0x1
#define SIXEL_LARGE_LUM 0x2
#define SIXEL_REP_AUTO 0x0
#define SIXEL_REP_CENTER_BOX 0x1
#define SIXEL_REP_AVERAGE_COLORS 0x2
#define SIXEL_REP_AVERAGE_PIXELS 0x3
#define SIXEL_DIFFUSE_AUTO 0x0
#define SIXEL_DIFFUSE_NONE 0x1
#define SIXEL_DIFFUSE_ATKINSON 0x2
#define SIXEL_DIFFUSE_FS 0x3
#define SIXEL_DIFFUSE_JAJUNI 0x4
#define SIXEL_DIFFUSE_STUCKI 0x5
#define SIXEL_DIFFUSE_BURKES 0x6
#define SIXEL_QUALITY_AUTO 0x0
#define SIXEL_QUALITY_HIGH 0x1
#define SIXEL_QUALITY_LOW 0x2
#define SIXEL_QUALITY_FULL 0x3
#define SIXEL_QUALITY_HIGHCOLOR 0x4
#define SIXEL_BUILTIN_MONO_DARK 0x0
#define SIXEL_BUILTIN_MONO_LIGHT 0x1
#define SIXEL_BUILTIN_XTERM16 0x2
#define SIXEL_BUILTIN_XTERM256 0x3
#define SIXEL_BUILTIN_VT340_MONO 0x4
#define SIXEL_BUILTIN_VT340_COLOR 0x5
#define SIXEL_BUILTIN_G1 0x6
#define SIXEL_BUILTIN_G2 0x7
#define SIXEL_BUILTIN_G4 0x8
#define SIXEL_BUILTIN_G8 0x9
#define SIXEL_FORMATTYPE_COLOR (0)
#define SIXEL_FORMATTYPE_GRAYSCALE (1 << 6)
#define SIXEL_FORMATTYPE_PALETTE (1 << 7)
#define SIXEL_PIXELFORMAT_RGB555 (SIXEL_FORMATTYPE_COLOR | 0x01)
#define SIXEL_PIXELFORMAT_RGB565 (SIXEL_FORMATTYPE_COLOR | 0x02)
#define SIXEL_PIXELFORMAT_RGB888 (SIXEL_FORMATTYPE_COLOR | 0x03)
#define SIXEL_PIXELFORMAT_BGR555 (SIXEL_FORMATTYPE_COLOR | 0x04)
#define SIXEL_PIXELFORMAT_BGR565 (SIXEL_FORMATTYPE_COLOR | 0x05)
#define SIXEL_PIXELFORMAT_BGR888 (SIXEL_FORMATTYPE_COLOR | 0x06)
#define SIXEL_PIXELFORMAT_ARGB8888 (SIXEL_FORMATTYPE_COLOR | 0x10)
#define SIXEL_PIXELFORMAT_RGBA8888 (SIXEL_FORMATTYPE_COLOR | 0x11)
#define SIXEL_PIXELFORMAT_ABGR8888 (SIXEL_FORMATTYPE_COLOR | 0x12)
#define SIXEL_PIXELFORMAT_BGRA8888 (SIXEL_FORMATTYPE_COLOR | 0x13)
#define SIXEL_PIXELFORMAT_G1 (SIXEL_FORMATTYPE_GRAYSCALE | 0x00)
#define SIXEL_PIXELFORMAT_G2 (SIXEL_FORMATTYPE_GRAYSCALE | 0x01)
#define SIXEL_PIXELFORMAT_G4 (SIXEL_FORMATTYPE_GRAYSCALE | 0x02)
#define SIXEL_PIXELFORMAT_G8 (SIXEL_FORMATTYPE_GRAYSCALE | 0x03)
#define SIXEL_PIXELFORMAT_AG88 (SIXEL_FORMATTYPE_GRAYSCALE | 0x13)
#define SIXEL_PIXELFORMAT_GA88 (SIXEL_FORMATTYPE_GRAYSCALE | 0x23)
#define SIXEL_PIXELFORMAT_PAL1 (SIXEL_FORMATTYPE_PALETTE | 0x00)
#define SIXEL_PIXELFORMAT_PAL2 (SIXEL_FORMATTYPE_PALETTE | 0x01)
#define SIXEL_PIXELFORMAT_PAL4 (SIXEL_FORMATTYPE_PALETTE | 0x02)
#define SIXEL_PIXELFORMAT_PAL8 (SIXEL_FORMATTYPE_PALETTE | 0x03)
#define SIXEL_PALETTETYPE_AUTO 0
#define SIXEL_PALETTETYPE_HLS 1
#define SIXEL_PALETTETYPE_RGB 2
#define SIXEL_ENCODEPOLICY_AUTO 0
#define SIXEL_ENCODEPOLICY_FAST 1
#define SIXEL_ENCODEPOLICY_SIZE 2
#define SIXEL_RES_NEAREST 0
#define SIXEL_RES_GAUSSIAN 1
#define SIXEL_RES_HANNING 2
#define SIXEL_RES_HAMMING 3
#define SIXEL_RES_BILINEAR 4
#define SIXEL_RES_WELSH 5
#define SIXEL_RES_BICUBIC 6
#define SIXEL_RES_LANCZOS2 7
#define SIXEL_RES_LANCZOS3 8
#define SIXEL_RES_LANCZOS4 9
#define SIXEL_FORMAT_GIF 0x0
#define SIXEL_FORMAT_PNG 0x1
#define SIXEL_FORMAT_BMP 0x2
#define SIXEL_FORMAT_JPG 0x3
#define SIXEL_FORMAT_TGA 0x4
#define SIXEL_FORMAT_WBMP 0x5
#define SIXEL_FORMAT_TIFF 0x6
#define SIXEL_FORMAT_SIXEL 0x7
#define SIXEL_FORMAT_PNM 0x8
#define SIXEL_FORMAT_GD2 0x9
#define SIXEL_FORMAT_PSD 0xa
#define SIXEL_FORMAT_HDR 0xb
#define SIXEL_LOOP_AUTO 0
#define SIXEL_LOOP_FORCE 1
#define SIXEL_LOOP_DISABLE 2
#define SIXEL_OPTFLAG_INPUT ('i')
#define SIXEL_OPTFLAG_OUTPUT ('o')
#define SIXEL_OPTFLAG_OUTFILE ('o')
#define SIXEL_OPTFLAG_7BIT_MODE ('7')
#define SIXEL_OPTFLAG_8BIT_MODE ('8')
#define SIXEL_OPTFLAG_HAS_GRI_ARG_LIMIT ('R')
#define SIXEL_OPTFLAG_COLORS ('p')
#define SIXEL_OPTFLAG_MAPFILE ('m')
#define SIXEL_OPTFLAG_MONOCHROME ('e')
#define SIXEL_OPTFLAG_INSECURE ('k')
#define SIXEL_OPTFLAG_INVERT ('i')
#define SIXEL_OPTFLAG_HIGH_COLOR ('I')
#define SIXEL_OPTFLAG_USE_MACRO ('u')
#define SIXEL_OPTFLAG_MACRO_NUMBER ('n')
#define SIXEL_OPTFLAG_COMPLEXION_SCORE ('C')
#define SIXEL_OPTFLAG_IGNORE_DELAY ('g')
#define SIXEL_OPTFLAG_STATIC ('S')
#define SIXEL_OPTFLAG_DIFFUSION ('d')
#define SIXEL_OPTFLAG_FIND_LARGEST ('f')
#define SIXEL_OPTFLAG_SELECT_COLOR ('s')
#define SIXEL_OPTFLAG_CROP ('c')
#define SIXEL_OPTFLAG_WIDTH ('w')
#define SIXEL_OPTFLAG_HEIGHT ('h')
#define SIXEL_OPTFLAG_RESAMPLING ('r')
#define SIXEL_OPTFLAG_QUALITY ('q')
#define SIXEL_OPTFLAG_LOOPMODE ('l')
#define SIXEL_OPTFLAG_PALETTE_TYPE ('t')
#define SIXEL_OPTFLAG_BUILTIN_PALETTE ('b')
#define SIXEL_OPTFLAG_ENCODE_POLICY ('E')
#define SIXEL_OPTFLAG_BGCOLOR ('B')
#define SIXEL_OPTFLAG_PENETRATE ('P')
#define SIXEL_OPTFLAG_PIPE_MODE ('D')
#define SIXEL_OPTFLAG_VERBOSE ('v')
#define SIXEL_OPTFLAG_VERSION ('V')
#define SIXEL_OPTFLAG_HELP ('H')
#if SIXEL_USE_DEPRECATED_SYMBOLS
enum characterSize {
CSIZE_7BIT = 0,
CSIZE_8BIT = 1,
};
enum methodForLargest {
LARGE_AUTO = 0,
LARGE_NORM = 1,
LARGE_LUM = 2
};
enum methodForRep {
REP_AUTO = 0,
REP_CENTER_BOX = 1,
REP_AVERAGE_COLORS = 2,
REP_AVERAGE_PIXELS = 3
};
enum methodForDiffuse {
DIFFUSE_AUTO = 0,
DIFFUSE_NONE = 1,
DIFFUSE_ATKINSON = 2,
DIFFUSE_FS = 3,
DIFFUSE_JAJUNI = 4,
DIFFUSE_STUCKI = 5,
DIFFUSE_BURKES = 6
};
enum qualityMode {
QUALITY_AUTO = 0,
QUALITY_HIGH = 1,
QUALITY_LOW = 2,
QUALITY_FULL = 3,
QUALITY_HIGHCOLOR = 4,
};
enum builtinDither {
BUILTIN_MONO_DARK = 0,
BUILTIN_MONO_LIGHT = 1,
BUILTIN_XTERM16 = 2,
BUILTIN_XTERM256 = 3,
BUILTIN_VT340_MONO = 4,
BUILTIN_VT340_COLOR = 5,
};
enum formatType {
FORMATTYPE_COLOR = 0,
FORMATTYPE_GRAYSCALE = 1 << 6,
FORMATTYPE_PALETTE = 1 << 7,
};
enum pixelFormat {
PIXELFORMAT_RGB555 = FORMATTYPE_COLOR | 0x01,
PIXELFORMAT_RGB565 = FORMATTYPE_COLOR | 0x02,
PIXELFORMAT_RGB888 = FORMATTYPE_COLOR | 0x03,
PIXELFORMAT_BGR555 = FORMATTYPE_COLOR | 0x04,
PIXELFORMAT_BGR565 = FORMATTYPE_COLOR | 0x05,
PIXELFORMAT_BGR888 = FORMATTYPE_COLOR | 0x06,
PIXELFORMAT_ARGB8888 = FORMATTYPE_COLOR | 0x10,
PIXELFORMAT_RGBA8888 = FORMATTYPE_COLOR | 0x11,
PIXELFORMAT_G1 = FORMATTYPE_GRAYSCALE | 0x00,
PIXELFORMAT_G2 = FORMATTYPE_GRAYSCALE | 0x01,
PIXELFORMAT_G4 = FORMATTYPE_GRAYSCALE | 0x02,
PIXELFORMAT_G8 = FORMATTYPE_GRAYSCALE | 0x03,
PIXELFORMAT_AG88 = FORMATTYPE_GRAYSCALE | 0x13,
PIXELFORMAT_GA88 = FORMATTYPE_GRAYSCALE | 0x23,
PIXELFORMAT_PAL1 = FORMATTYPE_PALETTE | 0x00,
PIXELFORMAT_PAL2 = FORMATTYPE_PALETTE | 0x01,
PIXELFORMAT_PAL4 = FORMATTYPE_PALETTE | 0x02,
PIXELFORMAT_PAL8 = FORMATTYPE_PALETTE | 0x03,
};
enum paletteType {
PALETTETYPE_AUTO = 0,
PALETTETYPE_HLS = 1,
PALETTETYPE_RGB = 2,
};
enum encodePolicy {
ENCODEPOLICY_AUTO = 0,
ENCODEPOLICY_FAST = 1,
ENCODEPOLICY_SIZE = 2,
};
enum methodForResampling {
RES_NEAREST = 0,
RES_GAUSSIAN = 1,
RES_HANNING = 2,
RES_HAMMING = 3,
RES_BILINEAR = 4,
RES_WELSH = 5,
RES_BICUBIC = 6,
RES_LANCZOS2 = 7,
RES_LANCZOS3 = 8,
RES_LANCZOS4 = 9,
};
#endif
typedef void *(* sixel_malloc_t)(size_t);
typedef void *(* sixel_calloc_t)(size_t, size_t);
typedef void *(* sixel_realloc_t)(void *, size_t);
typedef void (* sixel_free_t)(void *);
struct sixel_allocator;
typedef struct sixel_allocator sixel_allocator_t;
#ifdef __cplusplus
extern "C" {
#endif
SIXELSTATUS
sixel_allocator_new(
sixel_allocator_t **ppallocator,
sixel_malloc_t fn_malloc,
sixel_calloc_t fn_calloc,
sixel_realloc_t fn_realloc,
sixel_free_t fn_free);
SIXELAPI void
sixel_allocator_ref(
sixel_allocator_t *allocator);
SIXELAPI void
sixel_allocator_unref(sixel_allocator_t *allocator);
SIXELAPI void *
sixel_allocator_malloc(
sixel_allocator_t *allocator,
size_t n);
SIXELAPI void *
sixel_allocator_calloc(
sixel_allocator_t *allocator,
size_t nelm,
size_t elsize);
SIXELAPI void *
sixel_allocator_realloc(
sixel_allocator_t *allocator,
void *p,
size_t n);
SIXELAPI void
sixel_allocator_free(
sixel_allocator_t *allocator,
void *p);
#ifdef HAVE_TESTS
extern volatile int sixel_debug_malloc_counter;
void *
sixel_bad_malloc(size_t size);
void *
sixel_bad_calloc(size_t count, size_t size);
void *
sixel_bad_realloc(void *ptr, size_t size);
#endif
#ifdef __cplusplus
}
#endif
struct sixel_output;
typedef struct sixel_output sixel_output_t;
typedef int (* sixel_write_function)(char *data, int size, void *priv);
#ifdef __cplusplus
extern "C" {
#endif
SIXELAPI SIXELSTATUS
sixel_output_new(
sixel_output_t **output,
sixel_write_function fn_write,
void *priv,
sixel_allocator_t *allocator);
SIXELAPI __attribute__((deprecated)) sixel_output_t *
sixel_output_create(
sixel_write_function fn_write,
void *priv);
SIXELAPI void
sixel_output_destroy(sixel_output_t *output);
SIXELAPI void
sixel_output_ref(sixel_output_t *output);
SIXELAPI void
sixel_output_unref(sixel_output_t *output);
SIXELAPI int
sixel_output_get_8bit_availability(
sixel_output_t *output);
SIXELAPI void
sixel_output_set_8bit_availability(
sixel_output_t *output,
int availability);
SIXELAPI void
sixel_output_set_gri_arg_limit(
sixel_output_t *output,
int value);
SIXELAPI void
sixel_output_set_penetrate_multiplexer(
sixel_output_t *output,
int penetrate);
SIXELAPI void
sixel_output_set_skip_dcs_envelope(
sixel_output_t *output,
int skip);
SIXELAPI void
sixel_output_set_palette_type(
sixel_output_t *output,
int palettetype);
SIXELAPI void
sixel_output_set_encode_policy(
sixel_output_t *output,
int encode_policy);
#ifdef __cplusplus
}
#endif
struct sixel_dither;
typedef struct sixel_dither sixel_dither_t;
#ifdef __cplusplus
extern "C" {
#endif
SIXELAPI SIXELSTATUS
sixel_dither_new(
sixel_dither_t **ppdither,
int ncolors,
sixel_allocator_t *allocator);
SIXELAPI __attribute__((deprecated)) sixel_dither_t *
sixel_dither_create(int ncolors);
SIXELAPI sixel_dither_t *
sixel_dither_get(int builtin_dither);
SIXELAPI void
sixel_dither_destroy(sixel_dither_t *dither);
SIXELAPI void
sixel_dither_ref(sixel_dither_t *dither);
SIXELAPI void
sixel_dither_unref(sixel_dither_t *dither);
SIXELAPI SIXELSTATUS
sixel_dither_initialize(
sixel_dither_t *dither,
unsigned char *data,
int width,
int height,
int pixelformat,
int method_for_largest,
int method_for_rep,
int quality_mode);
SIXELAPI void
sixel_dither_set_diffusion_type(
sixel_dither_t *dither,
int method_for_diffuse);
SIXELAPI int
sixel_dither_get_num_of_palette_colors(
sixel_dither_t *dither);
SIXELAPI int
sixel_dither_get_num_of_histogram_colors(
sixel_dither_t *dither);
SIXELAPI __attribute__((deprecated)) int
sixel_dither_get_num_of_histgram_colors(
sixel_dither_t *dither);
SIXELAPI unsigned char *
sixel_dither_get_palette(
sixel_dither_t *dither);
SIXELAPI void
sixel_dither_set_palette(
sixel_dither_t *dither,
unsigned char *palette);
SIXELAPI void
sixel_dither_set_complexion_score(
sixel_dither_t *dither,
int score);
SIXELAPI void
sixel_dither_set_body_only(
sixel_dither_t *dither,
int bodyonly);
SIXELAPI void
sixel_dither_set_optimize_palette(
sixel_dither_t *dither,
int do_opt);
SIXELAPI void
sixel_dither_set_pixelformat(
sixel_dither_t *dither,
int pixelformat);
SIXELAPI void
sixel_dither_set_transparent(
sixel_dither_t *dither,
int transparent);
#ifdef __cplusplus
}
#endif
typedef void * (* sixel_allocator_function)(size_t size);
#ifdef __cplusplus
extern "C" {
#endif
SIXELAPI SIXELSTATUS
sixel_encode(
unsigned char *pixels,
int width,
int height,
int depth,
sixel_dither_t *dither,
sixel_output_t *context);
SIXELAPI SIXELSTATUS
sixel_decode_raw(
unsigned char *p,
int len,
unsigned char **pixels,
int *pwidth,
int *pheight,
unsigned char **palette,
int *ncolors,
sixel_allocator_t *allocator);
SIXELAPI __attribute__((deprecated)) SIXELSTATUS
sixel_decode(
unsigned char *sixels,
int size,
unsigned char **pixels,
int *pwidth,
int *pheight,
unsigned char **palette,
int *ncolors,
sixel_allocator_function fn_malloc);
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C" {
#endif
SIXELAPI void
sixel_helper_set_additional_message(
const char *message
);
SIXELAPI char const *
sixel_helper_get_additional_message(void);
SIXELAPI char const *
sixel_helper_format_error(
SIXELSTATUS status
);
SIXELAPI int
sixel_helper_compute_depth(
int pixelformat
);
SIXELAPI SIXELSTATUS
sixel_helper_normalize_pixelformat(
unsigned char *dst,
int *dst_pixelformat,
unsigned char const *src,
int src_pixelformat,
int width,
int height
);
SIXELAPI SIXELSTATUS
sixel_helper_scale_image(
unsigned char *dst,
unsigned char const *src,
int srcw,
int srch,
int pixelformat,
int dstw,
int dsth,
int method_for_resampling,
sixel_allocator_t *allocator
);
#ifdef __cplusplus
}
#endif
#if SIXEL_USE_DEPRECATED_SYMBOLS
enum imageFormat {
FORMAT_GIF = 0,
FORMAT_PNG = 1,
FORMAT_BMP = 2,
FORMAT_JPG = 3,
FORMAT_TGA = 4,
FORMAT_WBMP = 5,
FORMAT_TIFF = 6,
FORMAT_SIXEL = 7,
FORMAT_PNM = 8,
FORMAT_GD2 = 9,
FORMAT_PSD = 10,
FORMAT_HDR = 11,
};
enum loopControl {
LOOP_AUTO = 0,
LOOP_FORCE = 1,
LOOP_DISABLE = 2,
};
#endif
struct sixel_frame;
typedef struct sixel_frame sixel_frame_t;
#ifdef __cplusplus
extern "C" {
#endif
SIXELAPI SIXELSTATUS
sixel_frame_new(
sixel_frame_t **ppframe,
sixel_allocator_t *allocator);
SIXELAPI __attribute__((deprecated)) sixel_frame_t *
sixel_frame_create(void);
SIXELAPI void
sixel_frame_ref(sixel_frame_t *frame);
SIXELAPI void
sixel_frame_unref(sixel_frame_t *frame);
SIXELAPI SIXELSTATUS
sixel_frame_init(
sixel_frame_t *frame,
unsigned char *pixels,
int width,
int height,
int pixelformat,
unsigned char *palette,
int ncolors
);
SIXELAPI unsigned char *
sixel_frame_get_pixels(sixel_frame_t *frame);
SIXELAPI unsigned char *
sixel_frame_get_palette(sixel_frame_t *frame);
SIXELAPI int
sixel_frame_get_width(sixel_frame_t *frame);
SIXELAPI int
sixel_frame_get_height(sixel_frame_t *frame);
SIXELAPI int
sixel_frame_get_ncolors(sixel_frame_t *frame);
SIXELAPI int
sixel_frame_get_pixelformat(sixel_frame_t *frame);
SIXELAPI int
sixel_frame_get_transparent(sixel_frame_t *frame);
SIXELAPI int
sixel_frame_get_multiframe(sixel_frame_t *frame);
SIXELAPI int
sixel_frame_get_delay(sixel_frame_t *frame);
SIXELAPI int
sixel_frame_get_frame_no(sixel_frame_t *frame);
SIXELAPI int
sixel_frame_get_loop_no(sixel_frame_t *frame);
SIXELAPI int
sixel_frame_strip_alpha(
sixel_frame_t *frame,
unsigned char *bgcolor);
SIXELAPI SIXELSTATUS
sixel_frame_resize(
sixel_frame_t *frame,
int width,
int height,
int method_for_resampling);
SIXELAPI SIXELSTATUS
sixel_frame_clip(
sixel_frame_t *frame,
int x,
int y,
int width,
int height);
typedef SIXELSTATUS (* sixel_load_image_function)(
sixel_frame_t *frame,
void *context);
SIXELAPI SIXELSTATUS
sixel_helper_load_image_file(
char const *filename,
int fstatic,
int fuse_palette,
int reqcolors,
unsigned char *bgcolor,
int loop_control,
sixel_load_image_function fn_load,
int finsecure,
int const *cancel_flag,
void *context,
sixel_allocator_t *allocator);
SIXELAPI SIXELSTATUS
sixel_helper_write_image_file(
unsigned char *data,
int width,
int height,
unsigned char *palette,
int pixelformat,
char const *filename,
int imageformat,
sixel_allocator_t *allocator);
#ifdef __cplusplus
}
#endif
struct sixel_encoder;
typedef struct sixel_encoder sixel_encoder_t;
#ifdef __cplusplus
extern "C" {
#endif
SIXELAPI SIXELSTATUS
sixel_encoder_new(
sixel_encoder_t **ppencoder,
sixel_allocator_t *allocator);
SIXELAPI __attribute__((deprecated)) sixel_encoder_t *
sixel_encoder_create(void);
SIXELAPI void
sixel_encoder_ref(sixel_encoder_t *encoder);
SIXELAPI void
sixel_encoder_unref(sixel_encoder_t *encoder);
SIXELAPI SIXELSTATUS
sixel_encoder_set_cancel_flag(
sixel_encoder_t *encoder,
int *cancel_flag);
SIXELAPI SIXELSTATUS
sixel_encoder_setopt(
sixel_encoder_t *encoder,
int arg,
char const *optarg);
SIXELAPI SIXELSTATUS
sixel_encoder_encode(
sixel_encoder_t *encoder,
char const *filename);
SIXELAPI SIXELSTATUS
sixel_encoder_encode_bytes(
sixel_encoder_t *encoder,
unsigned char *bytes,
int width,
int height,
int pixelformat,
unsigned char *palette,
int ncolors);
#ifdef __cplusplus
}
#endif
struct sixel_decoder;
typedef struct sixel_decoder sixel_decoder_t;
#ifdef __cplusplus
extern "C" {
#endif
SIXELAPI SIXELSTATUS
sixel_decoder_new(
sixel_decoder_t **ppdecoder,
sixel_allocator_t *allocator);
SIXELAPI __attribute__((deprecated)) sixel_decoder_t *
sixel_decoder_create(void);
SIXELAPI void
sixel_decoder_ref(sixel_decoder_t *decoder);
SIXELAPI void
sixel_decoder_unref(sixel_decoder_t *decoder);
SIXELAPI SIXELSTATUS
sixel_decoder_setopt(
sixel_decoder_t *decoder,
int arg,
char const *optarg);
SIXELAPI SIXELSTATUS
sixel_decoder_decode(
sixel_decoder_t *decoder);
#ifdef __cplusplus
}
#endif
#endif