#include "internal.h"
#include "visual-details.h"
#include <stdatomic.h>
Go to the source code of this file.
|
void | sprixel_debug (const sprixel *s, FILE *out) |
|
void | sprixel_free (sprixel *s) |
|
sprixel * | sprixel_recycle (ncplane *n) |
|
void | sprixel_movefrom (sprixel *s, int y, int x) |
|
void | sprixel_hide (sprixel *s) |
|
void | sprixel_invalidate (sprixel *s, int y, int x) |
|
sprixel * | sprixel_alloc (ncplane *n, int dimy, int dimx) |
|
int | sprixel_load (sprixel *spx, fbuf *f, unsigned pixy, unsigned pixx, int parse_start, sprixel_e state) |
|
int | sprite_wipe (const notcurses *nc, sprixel *s, int ycell, int xcell) |
|
int | sprite_clear_all (const tinfo *t, fbuf *f) |
|
int | sprite_init (tinfo *t, int fd) |
|
int | sprixel_rescale (sprixel *spx, unsigned ncellpxy, unsigned ncellpxx) |
|
◆ sprite_clear_all()
int sprite_clear_all |
( |
const tinfo * |
t, |
|
|
fbuf * |
f |
|
) |
| |
Definition at line 204 of file sprite.c.
204 {
206 return 0;
207 }
209}
int(* pixel_clear_all)(fbuf *f)
◆ sprite_init()
int sprite_init |
( |
tinfo * |
t, |
|
|
int |
fd |
|
) |
| |
Definition at line 214 of file sprite.c.
214 {
215 struct timeval tv;
216 gettimeofday(&tv,
NULL);
217 int stir = (tv.tv_sec >> 3) ^ tv.tv_usec;
218 sprixelid_nonce = (rand() ^ stir) % 0xffffffu;
220 return 0;
221 }
223}
int(* pixel_init)(struct tinfo *ti, int fd)
◆ sprite_wipe()
Definition at line 170 of file sprite.c.
170 {
172 int idx = s->
dimx * ycell + xcell;
174
175
176
181 return -1;
182 }
183 }
184 }
185
187 return 1;
188 }
191
192 return 0;
193 }
196
197
198
202}
#define logdebug(fmt,...)
@ SPRIXCELL_ANNIHILATED_TRANS
int(* pixel_wipe)(struct sprixel *s, int y, int x)
uint8_t *(* pixel_trans_auxvec)(const struct ncpile *p)
◆ sprixel_alloc()
Definition at line 117 of file sprite.c.
117 {
121 }
122 memset(ret, 0, sizeof(*ret));
123 if(fbuf_init(&ret->
glyph)){
126 }
130 ret->
id = ++sprixelid_nonce;
132 if(ret->
id >= 0x1000000){
134 sprixelid_nonce = 1;
135 }
136
137 if(ncplane_pile(ret->
n)){
138 ncpile* np = ncplane_pile(ret->
n);
141 }
144
145 }else{
147 }
148 return ret;
149}
unsigned char * needs_refresh
◆ sprixel_debug()
void sprixel_debug |
( |
const sprixel * |
s, |
|
|
FILE * |
out |
|
) |
| |
Definition at line 7 of file sprite.c.
7 {
8 fprintf(out, "sprixel %d (%p) %" PRIu64 "B %dx%d (%dx%d) @%d/%d state: %d\n",
10 s->
n ? s->
n->
absy : 0, s->
n ? s->
n->absx : 0,
11 s->invalidated);
14 for(
unsigned y = 0 ;
y < s->
dimy ; ++
y){
15 for(
unsigned x = 0 ;
x < s->
dimx ; ++
x){
18 }
19 fprintf(out, "\n");
20 }
22 for(
unsigned y = 0 ;
y < s->
dimy ; ++
y){
23 for(
unsigned x = 0 ;
x < s->
dimx ; ++
x){
27 }else{
28 fprintf(out,
"%03d] missing!\n",
idx);
29 }
30 }
32 }
33 }
34 }
35}
◆ sprixel_free()
Definition at line 38 of file sprite.c.
38 {
39 if(s){
43 }
48 }
49}
void sixelmap_free(struct sixelmap *s)
◆ sprixel_hide()
Definition at line 83 of file sprite.c.
83 {
84 if(ncplane_pile(s->
n) ==
NULL){
86 return;
87 }
88
90 loginfo(
"marking sprixel %u hidden", s->
id);
94
98 }
99 }
100}
int ncplane_abs_x(const ncplane *n)
int ncplane_abs_y(const ncplane *n)
void sprixel_free(sprixel *s)
◆ sprixel_invalidate()
void sprixel_invalidate |
( |
sprixel * |
s, |
|
|
int |
y, |
|
|
int |
x |
|
) |
| |
Definition at line 103 of file sprite.c.
103 {
104
106 int localy =
y - s->
n->
absy;
107 int localx =
x - s->
n->
absx;
108
113 }
114 }
115}
◆ sprixel_load()
int sprixel_load |
( |
sprixel * |
spx, |
|
|
fbuf * |
f, |
|
|
unsigned |
pixy, |
|
|
unsigned |
pixx, |
|
|
int |
parse_start, |
|
|
sprixel_e |
state |
|
) |
| |
Definition at line 154 of file sprite.c.
155 {
157 if(&spx->
glyph != f){
158 fbuf_free(&spx->
glyph);
159 memcpy(&spx->
glyph, f,
sizeof(*f));
160 }
165 return 0;
166}
◆ sprixel_movefrom()
void sprixel_movefrom |
( |
sprixel * |
s, |
|
|
int |
y, |
|
|
int |
x |
|
) |
| |
Definition at line 68 of file sprite.c.
68 {
71
72
73
74
75
79 }
80 }
81}
◆ sprixel_recycle()
Definition at line 51 of file sprite.c.
51 {
56 int dimy = hides->
dimy;
57 int dimx = hides->
dimx;
60 }
62 n->sprite->smap =
NULL;
64}
const notcurses * ncplane_notcurses_const(const ncplane *n)
void sprixel_hide(sprixel *s)
sprixel * sprixel_alloc(ncplane *n, int dimy, int dimx)
ncpixelimpl_e pixel_implementation
◆ sprixel_rescale()
int sprixel_rescale |
( |
sprixel * |
spx, |
|
|
unsigned |
ncellpxy, |
|
|
unsigned |
ncellpxx |
|
) |
| |
Definition at line 225 of file sprite.c.
225 {
227 loginfo(
"rescaling -> %ux%u", ncellpxy, ncellpxx);
228
229 int nrows = (spx->
pixy + (ncellpxy - 1)) / ncellpxy;
230 int ncols = (spx->
pixx + (ncellpxx - 1)) / ncellpxx;
231 tament* ntam = create_tam(nrows, ncols);
233 return -1;
234 }
235 for(
unsigned y = 0 ;
y < spx->
dimy ; ++
y){
236 for(
unsigned x = 0 ;
x < spx->
dimx ; ++
x){
238 }
239 }
242
243 ncplane_resize_simple(spx->
n, nrows, ncols);
249 return 0;
250}
notcurses * ncplane_notcurses(const ncplane *n)