ELinks 0.18.0
sixel.c File Reference

Terminal sixel routines. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sixel.h>
#include "elinks.h"
#include "document/document.h"
#include "osdep/osdep.h"
#include "terminal/hardio.h"
#include "terminal/screen.h"
#include "terminal/terminal.h"
#include "util/memcount.h"
Include dependency graph for sixel.c:

Data Structures

struct  sixel_decoder
struct  sixel_encoder

Macros

#define SIXEL_COLOR_OPTION_DEFAULT   0 /* use default settings */
#define SIXEL_COLOR_OPTION_MONOCHROME   1 /* use monochrome palette */
#define SIXEL_COLOR_OPTION_BUILTIN   2 /* use builtin palette */
#define SIXEL_COLOR_OPTION_MAPFILE   3 /* use mapfile option */
#define SIXEL_COLOR_OPTION_HIGHCOLOR   4 /* use highcolor option */

Functions

static void init_allocator (void)
static int sixel_write_callback (char *data, int size, void *priv)
static SIXELSTATUS sixel_encoder_output_without_macro (sixel_frame_t *frame, sixel_dither_t *dither, sixel_output_t *output, sixel_encoder_t *encoder)
static SIXELSTATUS sixel_encoder_output_with_macro (sixel_frame_t *frame, sixel_dither_t *dither, sixel_output_t *output, sixel_encoder_t *encoder)
static SIXELSTATUS sixel_prepare_monochrome_palette (sixel_dither_t **dither, int finvert)
static SIXELSTATUS sixel_prepare_builtin_palette (sixel_dither_t **dither, int builtin_palette)
static SIXELSTATUS sixel_encoder_prepare_palette (sixel_encoder_t *encoder, sixel_frame_t *frame, sixel_dither_t **dither)
static SIXELSTATUS sixel_encoder_do_clip (sixel_encoder_t *encoder, sixel_frame_t *frame)
static SIXELSTATUS sixel_encoder_do_resize (sixel_encoder_t *encoder, sixel_frame_t *frame)
static SIXELSTATUS sixel_encoder_encode_frame (sixel_encoder_t *encoder, sixel_frame_t *frame, sixel_output_t *output)
void try_to_draw_images (struct terminal *term)
void delete_image (struct image *im)
int add_image_to_document (struct document *doc, struct string *pixels, int lineno)
struct image * copy_frame (struct image *src, int box_width, int box_height, int cell_width, int cell_height, int dx, int dy)

Variables

static sixel_allocator_t * el_sixel_allocator

Detailed Description

Terminal sixel routines.

Macro Definition Documentation

◆ SIXEL_COLOR_OPTION_BUILTIN

#define SIXEL_COLOR_OPTION_BUILTIN   2 /* use builtin palette */

◆ SIXEL_COLOR_OPTION_DEFAULT

#define SIXEL_COLOR_OPTION_DEFAULT   0 /* use default settings */

◆ SIXEL_COLOR_OPTION_HIGHCOLOR

#define SIXEL_COLOR_OPTION_HIGHCOLOR   4 /* use highcolor option */

◆ SIXEL_COLOR_OPTION_MAPFILE

#define SIXEL_COLOR_OPTION_MAPFILE   3 /* use mapfile option */

◆ SIXEL_COLOR_OPTION_MONOCHROME

#define SIXEL_COLOR_OPTION_MONOCHROME   1 /* use monochrome palette */

Function Documentation

◆ add_image_to_document()

int add_image_to_document ( struct document * doc,
struct string * pixels,
int lineno )

◆ copy_frame()

struct image * copy_frame ( struct image * src,
int box_width,
int box_height,
int cell_width,
int cell_height,
int dx,
int dy )

◆ delete_image()

void delete_image ( struct image * im)

◆ init_allocator()

void init_allocator ( void )
static

◆ sixel_encoder_do_clip()

SIXELSTATUS sixel_encoder_do_clip ( sixel_encoder_t * encoder,
sixel_frame_t * frame )
static

◆ sixel_encoder_do_resize()

SIXELSTATUS sixel_encoder_do_resize ( sixel_encoder_t * encoder,
sixel_frame_t * frame )
static

◆ sixel_encoder_encode_frame()

SIXELSTATUS sixel_encoder_encode_frame ( sixel_encoder_t * encoder,
sixel_frame_t * frame,
sixel_output_t * output )
static

◆ sixel_encoder_output_with_macro()

SIXELSTATUS sixel_encoder_output_with_macro ( sixel_frame_t * frame,
sixel_dither_t * dither,
sixel_output_t * output,
sixel_encoder_t * encoder )
static

◆ sixel_encoder_output_without_macro()

SIXELSTATUS sixel_encoder_output_without_macro ( sixel_frame_t * frame,
sixel_dither_t * dither,
sixel_output_t * output,
sixel_encoder_t * encoder )
static

◆ sixel_encoder_prepare_palette()

SIXELSTATUS sixel_encoder_prepare_palette ( sixel_encoder_t * encoder,
sixel_frame_t * frame,
sixel_dither_t ** dither )
static

◆ sixel_prepare_builtin_palette()

SIXELSTATUS sixel_prepare_builtin_palette ( sixel_dither_t ** dither,
int builtin_palette )
static

◆ sixel_prepare_monochrome_palette()

SIXELSTATUS sixel_prepare_monochrome_palette ( sixel_dither_t ** dither,
int finvert )
static

◆ sixel_write_callback()

int sixel_write_callback ( char * data,
int size,
void * priv )
static

◆ try_to_draw_images()

void try_to_draw_images ( struct terminal * term)

Variable Documentation

◆ el_sixel_allocator

sixel_allocator_t* el_sixel_allocator
static