ascii-chat
Binary v0.16.50-198-g78f51665f
Library lib/v0.3.2-2240-g78f51665f
Video chat in your terminal
Loading...
Searching...
No Matches
common.h File Reference

Go to the source code of this file.

Data Structures

struct  ascii_frame_t
 When code needs to work with ascii frame, it keeps output, output_target, width, source_height here instead of scattering it across globals. Initialization establishes the handles and sizes; teardown must release any allocation, lock, thread, or callback context recorded in those fields. More...

Macros

#define ASCII_INLINE_SCRATCH_COLUMNS   512
#define ASCII_SCRATCH_PLANES   6
#define ASCII_FRAME_DECLARED
#define DECLARE_ASCII_PROCESSOR(isa)
#define DECLARE_HALF_PROCESSOR(isa)

Functions

asciichat_error_t ascii_frame_init (ascii_frame_t *frame, const image_t *image, const char *palette)
void ascii_frame_emit_row (ascii_frame_t *frame, ascii_color_t mode, bool background, bool more_rows, const simd_cells_t *ops)
char * ascii_frame_finish (ascii_frame_t *frame)
char * render_ascii_cells_sse2 (const image_t *, const char *, ascii_color_t, bool)
char * render_ascii_cells_ssse3 (const image_t *, const char *, ascii_color_t, bool)
char * render_ascii_cells_avx2 (const image_t *, const char *, ascii_color_t, bool)
char * render_ascii_cells_neon (const image_t *, const char *, ascii_color_t, bool)
char * render_ascii_cells_sve (const image_t *, const char *, ascii_color_t, bool)
asciichat_error_t ascii_half_frame_init (ascii_frame_t *frame, const uint8_t *rgb, int width, int height, int *stride, ascii_color_t mode)
void ascii_frame_emit_halfrow (ascii_frame_t *frame, ascii_color_t mode, bool more_rows, const simd_cells_t *ops)
char * render_halfblocks_sse2 (const uint8_t *, int, int, int, ascii_color_t)
char * render_halfblocks_ssse3 (const uint8_t *, int, int, int, ascii_color_t)
char * render_halfblocks_avx2 (const uint8_t *, int, int, int, ascii_color_t)
char * render_halfblocks_neon (const uint8_t *, int, int, int, ascii_color_t)
char * render_halfblocks_sve (const uint8_t *, int, int, int, ascii_color_t)
void ascii_emit_prepared_row (outbuf_t *out, ascii_color_t mode, const simd_cells_t *ops, const uint32_t *glyph, const uint32_t *fg, const uint32_t *bg, size_t width)
uint32_t ascii_background_contrast (ascii_color_t mode, uint32_t color, uint8_t luma)
void ascii_stabilizer_frame_row (ascii_frame_t *frame, ascii_color_t mode, bool background, const simd_cells_t *ops)
void ascii_stabilizer_halfrow (ascii_frame_t *frame, ascii_color_t mode, const simd_cells_t *ops)

Macro Definition Documentation

◆ ASCII_FRAME_DECLARED

#define ASCII_FRAME_DECLARED

◆ ASCII_INLINE_SCRATCH_COLUMNS

#define ASCII_INLINE_SCRATCH_COLUMNS   512

◆ ASCII_SCRATCH_PLANES

#define ASCII_SCRATCH_PLANES   6

◆ DECLARE_ASCII_PROCESSOR

#define DECLARE_ASCII_PROCESSOR ( isa)
Value:
char *render_ascii_cells_##isa(const image_t *, const char *, ascii_color_t, bool)

Definition at line 31 of file include/ascii-chat/video/ascii/render/common.h.

◆ DECLARE_HALF_PROCESSOR

#define DECLARE_HALF_PROCESSOR ( isa)
Value:
char *render_halfblocks_##isa(const uint8_t *, int, int, int, ascii_color_t)
unsigned char uint8_t

Definition at line 41 of file include/ascii-chat/video/ascii/render/common.h.

Function Documentation

◆ ascii_background_contrast()

uint32_t ascii_background_contrast ( ascii_color_t mode,
uint32_t color,
uint8_t luma )

Definition at line 122 of file video/ascii/render/common.c.

122 {
123 if (mode == ASCII_COLOR_16) {
124 uint8_t r, g, b;
125 get_16color_rgb((uint8_t)color, &r, &g, &b);
126 return (77 * r + 150 * g + 29 * b) / 256 < 127 ? 15u : 0;
127 }
128 return luma < 128 ? (mode == ASCII_COLOR_TRUE ? 0xffffffu : 15u) : 0;
129}
void get_16color_rgb(uint8_t color_index, uint8_t *r, uint8_t *g, uint8_t *b)
Definition ansi.c:396

References ASCII_COLOR_16, ASCII_COLOR_TRUE, and get_16color_rgb().

Referenced by ascii_frame_emit_row(), and ascii_glyph_render().

◆ ascii_emit_prepared_row()

void ascii_emit_prepared_row ( outbuf_t * out,
ascii_color_t mode,
const simd_cells_t * ops,
const uint32_t * glyph,
const uint32_t * fg,
const uint32_t * bg,
size_t width )

Definition at line 60 of file video/ascii/render/common.c.

60 {
61 if (mode == ASCII_COLOR_NONE) {
62 if (ops->emit_mono) {
63 ops->emit_mono(out, glyph, width);
64 } else {
65 for (size_t x = 0; x < width;) {
66 size_t run = ops->run(glyph + x, fg + x, bg + x, width - x);
67 emit_glyph_run(out, &glyph[x], glyph_bytes(glyph[x]), (uint32_t)run);
68 x += run;
69 }
70 }
71 return;
72 }
73 uint32_t current_fg = UINT32_MAX, current_bg = UINT32_MAX;
74 for (size_t x = 0; x < width;) {
75 size_t run = ops->run(glyph + x, fg + x, bg + x, width - x);
76 if (fg[x] == UINT32_MAX && bg[x] == UINT32_MAX && (current_fg != UINT32_MAX || current_bg != UINT32_MAX)) {
78 current_fg = current_bg = UINT32_MAX;
79 }
80 if (fg[x] != current_fg) {
81 emit_color(out, mode, false, (int)fg[x]);
82 current_fg = fg[x];
83 }
84 if (bg[x] != current_bg) {
85 emit_color(out, mode, true, (int)bg[x]);
86 current_bg = bg[x];
87 }
88 emit_glyph_run(out, &glyph[x], glyph_bytes(glyph[x]), (uint32_t)run);
89 x += run;
90 }
91}
unsigned int width
Definition fft.c:24
unsigned int uint32_t
void emit_reset(outbuf_t *out)
Emit ANSI reset sequence.
void emit_glyph_run(outbuf_t *out, const void *glyph, size_t bytes, uint32_t count)
static bool size_t gotel_query_t * out
Definition queries.h:8
size_t(* run)(const uint32_t *glyph, const uint32_t *fg, const uint32_t *bg, size_t count)
Definition cells.h:20
void(* emit_mono)(outbuf_t *out, const uint32_t *glyph, size_t count)
Definition cells.h:21

References ASCII_COLOR_NONE, emit_glyph_run(), simd_cells_t::emit_mono, emit_reset(), out, simd_cells_t::run, and width.

Referenced by ascii_frame_emit_halfrow(), ascii_frame_emit_row(), ascii_glyph_render(), and ascii_render_glyph_match_mode().

◆ ascii_frame_emit_halfrow()

void ascii_frame_emit_halfrow ( ascii_frame_t * frame,
ascii_color_t mode,
bool more_rows,
const simd_cells_t * ops )

Definition at line 184 of file video/ascii/render/common.c.

184 {
185 ascii_stabilizer_halfrow(frame, mode, ops);
186 ascii_emit_prepared_row(&frame->output, mode, ops, frame->glyph, frame->fg, frame->bg, frame->width);
187 emit_row_end(&frame->output, mode != ASCII_COLOR_NONE, more_rows);
188 ++frame->row;
189}
void emit_row_end(outbuf_t *out, bool colored, bool newline)
void ascii_stabilizer_halfrow(ascii_frame_t *frame, ascii_color_t mode, const simd_cells_t *ops)
Definition stabilize.c:175
void ascii_emit_prepared_row(outbuf_t *out, ascii_color_t mode, const simd_cells_t *ops, const uint32_t *glyph, const uint32_t *fg, const uint32_t *bg, size_t width)

References ASCII_COLOR_NONE, ascii_emit_prepared_row(), ascii_stabilizer_halfrow(), ascii_frame_t::bg, emit_row_end(), ascii_frame_t::fg, ascii_frame_t::glyph, ascii_frame_t::output, ascii_frame_t::row, and ascii_frame_t::width.

◆ ascii_frame_emit_row()

void ascii_frame_emit_row ( ascii_frame_t * frame,
ascii_color_t mode,
bool background,
bool more_rows,
const simd_cells_t * ops )

Definition at line 131 of file video/ascii/render/common.c.

131 {
132 ascii_stabilizer_frame_row(frame, mode, background, ops);
133 for (size_t x = 0; x < frame->width; ++x) {
134 frame->fg[x] = frame->bg[x] = UINT32_MAX;
135 if (mode == ASCII_COLOR_NONE)
136 continue;
137 uint32_t value = mode == ASCII_COLOR_TRUE ? frame->packed[x] : frame->index[x];
138 uint32_t contrast = ascii_background_contrast(mode, value, frame->luma[x]);
139 frame->fg[x] = background ? contrast : value;
140 frame->bg[x] = background ? value : UINT32_MAX;
141 }
142 ascii_emit_prepared_row(&frame->output, mode, ops, frame->glyph, frame->fg, frame->bg, frame->width);
143 emit_row_end(&frame->output, mode != ASCII_COLOR_NONE, more_rows);
144 ++frame->row;
145}
void ascii_stabilizer_frame_row(ascii_frame_t *frame, ascii_color_t mode, bool background, const simd_cells_t *ops)
Definition stabilize.c:123
uint32_t ascii_background_contrast(ascii_color_t mode, uint32_t color, uint8_t luma)

References ascii_background_contrast(), ASCII_COLOR_NONE, ASCII_COLOR_TRUE, ascii_emit_prepared_row(), ascii_stabilizer_frame_row(), ascii_frame_t::bg, emit_row_end(), ascii_frame_t::fg, ascii_frame_t::glyph, ascii_frame_t::index, ascii_frame_t::luma, ascii_frame_t::output, ascii_frame_t::packed, ascii_frame_t::row, and ascii_frame_t::width.

Referenced by ascii_frame_t::_Alignas().

◆ ascii_frame_finish()

char * ascii_frame_finish ( ascii_frame_t * frame)

Definition at line 146 of file video/ascii/render/common.c.

146 {
147 if (frame->scratch != frame->inline_scratch)
148 SAFE_FREE(frame->scratch);
149 ob_term(&frame->output);
150 if (frame->output_target)
151 *frame->output_target = frame->output;
152 return frame->output.buf;
153}
#define SAFE_FREE(ptr)
void ob_term(outbuf_t *ob)
Append null terminator to buffer.
char * buf
Buffer pointer (allocated, owned by caller, must be freed).

References outbuf_t::buf, ob_term(), ascii_frame_t::output, ascii_frame_t::output_target, SAFE_FREE, and ascii_frame_t::scratch.

Referenced by ascii_frame_t::_Alignas().

◆ ascii_frame_init()

asciichat_error_t ascii_frame_init ( ascii_frame_t * frame,
const image_t * image,
const char * palette )

Definition at line 93 of file video/ascii/render/common.c.

93 {
94 ASCII_OTEL_SCOPE(ASCII_FRAME_INIT);
96 memset(frame, 0, sizeof(*frame));
97 if (!image || !image->pixels || image->w <= 0 || image->h <= 0 || !palette || !palette[0])
98 return SET_ERRNO(ERROR_INVALID_PARAM, "Invalid image or palette");
99 size_t bytes, pixels, capacity, rows;
100 if (checked_size_mul((size_t)image->w, (size_t)image->h, &pixels) != ASCIICHAT_OK || checked_size_mul(pixels, 48u, &capacity) != ASCIICHAT_OK ||
101 checked_size_mul((size_t)image->h, 5u, &rows) != ASCIICHAT_OK || checked_size_add(capacity, rows, &capacity) != ASCIICHAT_OK || checked_size_add(capacity, 1u, &capacity) != ASCIICHAT_OK ||
102 checked_size_mul((size_t)image->w, 6 * sizeof(uint32_t), &bytes) != ASCIICHAT_OK)
103 return ERROR_INVALID_PARAM;
105 if (!cache)
106 return ERROR_INVALID_PARAM;
107 prepare_output(frame, capacity, target);
108 frame->width = (size_t)image->w;
111 for (size_t i = 0; i < 64; ++i)
112 memcpy(frame->table + i, cache->cache64[i].utf8_bytes, (size_t)cache->cache64[i].byte_len);
113 frame->scratch = bytes <= sizeof(frame->inline_scratch) ? frame->inline_scratch : SAFE_MALLOC(bytes, uint32_t *);
114 frame->packed = frame->scratch;
115 frame->index = frame->packed + frame->width;
116 frame->glyph = frame->index + frame->width;
117 frame->fg = frame->glyph + frame->width;
118 frame->bg = frame->fg + frame->width;
119 frame->luma = (uint8_t *)(frame->bg + frame->width);
120 return ASCIICHAT_OK;
121}
#define SET_ERRNO(code,...)
char cells[(512 *256 *2)]
Definition fft.c:22
unsigned int height
Definition fft.c:24
#define SAFE_MALLOC(size, cast)
@ ASCIICHAT_OK
Definition error_codes.h:50
@ ERROR_INVALID_PARAM
utf8_palette_cache_t * get_utf8_palette_cache(const char *ascii_chars)
Get UTF-8 palette cache for a character set.
struct utf8_palette_cache utf8_palette_cache_t
#define ascii_render_set_output_target
#define ASCII_OTEL_SCOPE(id)
Definition otel.h:77
ascii_stabilizer_t * ascii_stabilizer_target(void)
Definition stabilize.c:9
SIMD-friendly storage for one RGB pixel. r, g, and b hold the color channels and padding keeps the la...
int h
Image height in pixels (must be > 0).
rgb_pixel_t * pixels
Pixel data array (width * height RGB pixels, row-major order).
int w
Image width in pixels (must be > 0).
Dynamic output buffer (auto-expanding).

References ASCII_OTEL_SCOPE, ascii_render_set_output_target, ascii_stabilizer_target(), ASCIICHAT_OK, ascii_frame_t::bg, utf8_char_t::byte_len, utf8_palette_cache::cache64, cells, ERROR_INVALID_PARAM, ascii_frame_t::fg, get_utf8_palette_cache(), ascii_frame_t::glyph, image::h, height, ascii_frame_t::index, ascii_frame_t::luma, ascii_frame_t::packed, image::pixels, SAFE_MALLOC, ascii_frame_t::scratch, SET_ERRNO, ascii_frame_t::stabilizer, ascii_frame_t::table, utf8_char_t::utf8_bytes, image::w, ascii_frame_t::width, and width.

Referenced by ascii_frame_t::_Alignas().

◆ ascii_half_frame_init()

asciichat_error_t ascii_half_frame_init ( ascii_frame_t * frame,
const uint8_t * rgb,
int width,
int height,
int * stride,
ascii_color_t mode )

Definition at line 155 of file video/ascii/render/common.c.

155 {
156 ASCII_OTEL_SCOPE(ASCII_HALF_FRAME_INIT);
158 memset(frame, 0, sizeof(*frame));
159 size_t row_bytes, extent, bytes, capacity;
160 if (!rgb || width <= 0 || height <= 0 || mode < ASCII_COLOR_NONE || mode > ASCII_COLOR_TRUE || checked_size_mul((size_t)width, 3, &row_bytes) != ASCIICHAT_OK || row_bytes > INT_MAX)
161 return SET_ERRNO(ERROR_INVALID_PARAM, "Invalid half-block input");
162 if (*stride <= 0)
163 *stride = (int)row_bytes;
164 if ((size_t)*stride < row_bytes || checked_size_mul((size_t)*stride, (size_t)height, &extent) != ASCIICHAT_OK || checked_size_mul((size_t)width, 6 * sizeof(uint32_t), &bytes) != ASCIICHAT_OK ||
165 checked_size_mul((size_t)width, ((size_t)height + 1) / 2, &capacity) != ASCIICHAT_OK || checked_size_mul(capacity, 48u, &capacity) != ASCIICHAT_OK ||
166 checked_size_add(capacity, 1u, &capacity) != ASCIICHAT_OK)
167 return SET_ERRNO(ERROR_INVALID_PARAM, "Invalid half-block stride or size");
168 prepare_output(frame, capacity, target);
169 frame->width = (size_t)width;
170 frame->source_height = (size_t)height;
173 frame->scratch = bytes <= sizeof(frame->inline_scratch) ? frame->inline_scratch : SAFE_MALLOC(bytes, uint32_t *);
174 frame->packed = frame->scratch;
175 frame->index = frame->packed + width;
176 frame->glyph = frame->index + width;
177 frame->fg = frame->glyph + width;
178 frame->bg = frame->fg + width;
179 const char blocks[5][4] = {"\xe2\x96\x91", "\xe2\x96\x92", "\xe2\x96\x93", "\xe2\x96\x88", "\xe2\x96\x80"};
180 for (size_t i = 0; i < 5; ++i)
181 memcpy(frame->table + i, blocks[i], sizeof(blocks[i]) - 1);
182 return ASCIICHAT_OK;
183}

References ASCII_COLOR_TRUE, ASCII_OTEL_SCOPE, ascii_render_set_output_target, ascii_stabilizer_target(), ASCIICHAT_OK, ascii_frame_t::bg, cells, ERROR_INVALID_PARAM, ascii_frame_t::fg, ascii_frame_t::glyph, height, ascii_frame_t::index, ascii_frame_t::packed, SAFE_MALLOC, ascii_frame_t::scratch, SET_ERRNO, ascii_frame_t::source_height, ascii_frame_t::stabilizer, ascii_frame_t::table, ascii_frame_t::width, and width.

◆ ascii_stabilizer_frame_row()

void ascii_stabilizer_frame_row ( ascii_frame_t * frame,
ascii_color_t mode,
bool background,
const simd_cells_t * ops )

Definition at line 123 of file stabilize.c.

123 {
124 if (frame->stabilizer && !frame->temporal_preselected) {
125 const uint64_t elapsed = frame->stabilizer->elapsed_ns;
126 const bool recent = elapsed <= ASCII_TEMPORAL_MAX_INTERVAL_NS;
127 const unsigned weight = recent ? (unsigned)(elapsed * 256 / (elapsed + ASCII_TEMPORAL_COLOR_TIME_NS)) : 256;
128 for (size_t x = 0; x < frame->width; ++x) {
129 ascii_temporal_cell_t *cell = &frame->stabilizer->cells[frame->row * frame->width + x];
130 uint8_t luma = frame->luma[x];
131 uint32_t glyph = frame->glyph[x];
132 uint32_t color = frame->packed[x];
133 if (cell->valid && recent && abs((int)luma - (int)cell->samples[0]) <= ASCII_TEMPORAL_MOTION_LIMIT) {
134 if (cell->glyph != glyph) {
135 // Only nearby brightness bins can win the hysteresis test. Searching
136 // outward avoids scanning the entire 64-entry palette for every cell.
137 unsigned bin = luma >> 2;
138 int best_delta = (int)luma - ((int)bin * 4 + 2);
139 uint64_t best_error = (uint64_t)(best_delta * best_delta);
140 uint64_t margin = best_error / 8 + 128;
141 for (unsigned distance = 1; distance < 64; ++distance) {
142 bool found = false;
143 for (int direction = -1; direction <= 1; direction += 2) {
144 int index = (int)bin + direction * (int)distance;
145 if (index < 0 || index >= 64 || frame->table[index] != cell->glyph)
146 continue;
147 int delta = (int)luma - (index * 4 + 2);
148 uint64_t error = (uint64_t)(delta * delta);
149 if (error <= best_error || error - best_error <= margin)
150 glyph = cell->glyph;
151 found = true;
152 }
153 // Bins farther than this cannot fall within the error margin.
154 int nearest_delta = (int)distance * 4 - 3;
155 if (found || (uint64_t)(nearest_delta * nearest_delta) > best_error + margin)
156 break;
157 }
158 }
159 if (mode == ASCII_COLOR_NONE || source_color_motion(cell->source_color, color) <= ASCII_TEMPORAL_MOTION_LIMIT)
160 color = ascii_stabilizer_blend_color(cell->color, color, weight);
161 }
162 cell->source_color = frame->packed[x];
163 cell->samples[0] = luma;
164 cell->glyph = frame->glyph[x] = glyph;
165 cell->color = frame->packed[x] = color;
166 cell->valid = true;
167 if (background)
168 frame->luma[x] = (uint8_t)((77u * (color >> 16) + 150u * ((color >> 8) & 255) + 29u * (color & 255) + 128u) >> 8);
169 }
170 if (!frame->dithered && (mode == ASCII_COLOR_16 || mode == ASCII_COLOR_256))
171 ops->quantize(frame->packed, frame->index, frame->width, mode == ASCII_COLOR_16 ? 16 : 256);
172 }
173}
unsigned long long uint64_t
#define ASCII_TEMPORAL_COLOR_TIME_NS
#define ASCII_TEMPORAL_MAX_INTERVAL_NS
#define ASCII_TEMPORAL_MOTION_LIMIT
static bool size_t index
Definition queries.h:8
uint32_t ascii_stabilizer_blend_color(uint32_t previous, uint32_t current, unsigned weight)
Definition stabilize.c:44
ascii_temporal_cell_t * cells
Definition stabilize.h:25
uint64_t elapsed_ns
Definition stabilize.h:28
uint8_t samples[16]
Definition stabilize.h:14
void(* quantize)(const uint32_t *rgb, uint32_t *out, size_t count, unsigned colors)
Definition cells.h:18

References ASCII_COLOR_16, ASCII_COLOR_256, ASCII_COLOR_NONE, ascii_stabilizer_blend_color(), ASCII_TEMPORAL_COLOR_TIME_NS, ASCII_TEMPORAL_MAX_INTERVAL_NS, ASCII_TEMPORAL_MOTION_LIMIT, ascii_stabilizer_t::cells, ascii_temporal_cell_t::color, ascii_frame_t::dithered, ascii_stabilizer_t::elapsed_ns, ascii_frame_t::glyph, ascii_temporal_cell_t::glyph, ascii_frame_t::index, index, ascii_frame_t::luma, ascii_frame_t::packed, simd_cells_t::quantize, ascii_frame_t::row, ascii_temporal_cell_t::samples, ascii_temporal_cell_t::source_color, ascii_frame_t::stabilizer, ascii_frame_t::table, ascii_frame_t::temporal_preselected, ascii_temporal_cell_t::valid, and ascii_frame_t::width.

Referenced by ascii_frame_emit_row().

◆ ascii_stabilizer_halfrow()

void ascii_stabilizer_halfrow ( ascii_frame_t * frame,
ascii_color_t mode,
const simd_cells_t * ops )

Definition at line 175 of file stabilize.c.

175 {
176 if (frame->stabilizer) {
177 size_t top_row = frame->row * 2;
178 bool has_bottom = top_row + 1 < frame->source_height;
179 for (size_t x = 0; x < frame->width; ++x) {
180 uint32_t *pixels[] = {&frame->packed[x], &frame->index[x]};
181 for (size_t half = 0; half < (has_bottom ? 2u : 1u); ++half) {
182 uint32_t color = *pixels[half];
183 uint8_t luma = (uint8_t)((76u * (color >> 16) + 150u * ((color >> 8) & 255) + 29u * (color & 255)) >> 8);
184 uint8_t samples[16];
185 memset(samples, luma, sizeof(samples));
186 ascii_temporal_cell_t *cell = &frame->stabilizer->cells[(top_row + half) * frame->width + x];
187 uint64_t elapsed = frame->stabilizer->elapsed_ns;
188 if (cell->valid && mode != ASCII_COLOR_NONE && source_color_motion(cell->source_color, color) > ASCII_TEMPORAL_MOTION_LIMIT)
189 elapsed = UINT64_MAX;
190 cell->source_color = color;
191 ascii_stabilizer_choose(cell, samples, 0, 0, UINT64_MAX, color, elapsed, pixels[half]);
192 }
193 if (!has_bottom)
194 frame->index[x] = frame->packed[x];
195 }
196 if (mode == ASCII_COLOR_TRUE) {
197 memcpy(frame->fg, frame->packed, frame->width * sizeof(uint32_t));
198 memcpy(frame->bg, frame->index, frame->width * sizeof(uint32_t));
199 } else if (mode != ASCII_COLOR_NONE) {
200 ops->quantize(frame->packed, frame->fg, frame->width, mode == ASCII_COLOR_16 ? 16 : 256);
201 ops->quantize(frame->index, frame->bg, frame->width, mode == ASCII_COLOR_16 ? 16 : 256);
202 }
203 ops->halfblock(frame->packed, frame->index, frame->glyph, frame->fg, frame->bg, frame->width, (unsigned)mode, frame->table);
204 }
205}
#define ascii_stabilizer_choose
void(* halfblock)(const uint32_t *top, const uint32_t *bottom, uint32_t *glyph, uint32_t *fg, uint32_t *bg, size_t count, unsigned mode, const uint32_t keys[5])
Definition cells.h:19

References ASCII_COLOR_16, ASCII_COLOR_NONE, ASCII_COLOR_TRUE, ascii_stabilizer_choose, ASCII_TEMPORAL_MOTION_LIMIT, ascii_frame_t::bg, ascii_stabilizer_t::cells, ascii_stabilizer_t::elapsed_ns, ascii_frame_t::fg, ascii_frame_t::glyph, simd_cells_t::halfblock, ascii_frame_t::index, ascii_frame_t::packed, simd_cells_t::quantize, ascii_frame_t::row, ascii_temporal_cell_t::source_color, ascii_frame_t::source_height, ascii_frame_t::stabilizer, ascii_frame_t::table, ascii_temporal_cell_t::valid, and ascii_frame_t::width.

Referenced by ascii_frame_emit_halfrow().

◆ render_ascii_cells_avx2()

char * render_ascii_cells_avx2 ( const image_t * ,
const char * ,
ascii_color_t ,
bool  )

◆ render_ascii_cells_neon()

char * render_ascii_cells_neon ( const image_t * ,
const char * ,
ascii_color_t ,
bool  )

◆ render_ascii_cells_sse2()

char * render_ascii_cells_sse2 ( const image_t * ,
const char * ,
ascii_color_t ,
bool  )

◆ render_ascii_cells_ssse3()

char * render_ascii_cells_ssse3 ( const image_t * ,
const char * ,
ascii_color_t ,
bool  )

◆ render_ascii_cells_sve()

char * render_ascii_cells_sve ( const image_t * ,
const char * ,
ascii_color_t ,
bool  )

References height, and width.

◆ render_halfblocks_avx2()

char * render_halfblocks_avx2 ( const uint8_t * ,
int ,
int ,
int ,
ascii_color_t  )

◆ render_halfblocks_neon()

char * render_halfblocks_neon ( const uint8_t * ,
int ,
int ,
int ,
ascii_color_t  )

◆ render_halfblocks_sse2()

char * render_halfblocks_sse2 ( const uint8_t * ,
int ,
int ,
int ,
ascii_color_t  )

◆ render_halfblocks_ssse3()

char * render_halfblocks_ssse3 ( const uint8_t * ,
int ,
int ,
int ,
ascii_color_t  )

◆ render_halfblocks_sve()

char * render_halfblocks_sve ( const uint8_t * ,
int ,
int ,
int ,
ascii_color_t  )

References out, and width.