ELinks 0.19.1
sixel.c File Reference

Terminal sixel routines. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sixel.h>
#include <fcntl.h>
#include <sys/stat.h>
#include "elinks.h"
#include "document/document.h"
#include "osdep/osdep.h"
#include "terminal/hardio.h"
#include "terminal/image.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 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, struct string *text)
void delete_image (struct image *im)
int add_image_to_document (struct document *doc, char *data, int datalen, int lineno, struct image **imagine)
struct image * copy_frame (struct image *src, struct el_box *box, int cell_width, int cell_height, int dx, int dy)

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,
char * data,
int datalen,
int lineno,
struct image ** imagine )

◆ copy_frame()

struct image * copy_frame ( struct image * src,
struct el_box * box,
int cell_width,
int cell_height,
int dx,
int dy )

◆ delete_image()

void delete_image ( struct image * im)

◆ 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,
struct string * text )