Notcurses
3.0.13
a blingful library for TUIs and character graphics
Loading...
Searching...
No Matches
blitset.h
Go to the documentation of this file.
1
#ifndef NOTCURSES_BLITSET
2
#define NOTCURSES_BLITSET
3
4
#ifdef __cplusplus
5
extern
"C"
{
6
#endif
7
8
#include "
blit.h
"
9
10
// number of pixels that map to a single cell, height-wise
11
static
inline
int
12
encoding_y_scale(
const
tinfo
* tcache,
const
struct
blitset
* bset) {
13
if
(bset->
geom
==
NCBLIT_PIXEL
){
14
return
tcache->
cellpxy
;
15
}
16
return
bset->
height
;
17
}
18
19
// number of pixels that map to a single cell, width-wise
20
static
inline
int
21
encoding_x_scale(
const
tinfo
* tcache,
const
struct
blitset
* bset) {
22
if
(bset->
geom
==
NCBLIT_PIXEL
){
23
return
tcache->
cellpxx
;
24
}
25
return
bset->
width
;
26
}
27
28
// Expand NCBLIT_DEFAULT for media blitting, based on environment. We never
29
// use NCBLIT_PIXEL for NCBLIT_DEFAULT, though maybe this ought change.
30
static
inline
ncblitter_e
31
rgba_blitter_default(
const
tinfo
* tcache,
ncscale_e
scale){
32
if
(!tcache->
caps
.
utf8
){
33
return
NCBLIT_1x1
;
// only one that works in ASCII
34
}
35
if
(scale ==
NCSCALE_NONE
|| scale ==
NCSCALE_SCALE
){
36
return
NCBLIT_2x1
;
37
}
38
if
(tcache->
caps
.
octants
){
39
return
NCBLIT_4x2
;
40
}
41
if
(tcache->
caps
.
sextants
){
42
return
NCBLIT_3x2
;
43
}
44
if
(tcache->
caps
.
quadrants
){
45
return
NCBLIT_2x2
;
46
}
47
return
NCBLIT_2x1
;
48
}
49
50
static
inline
ncblitter_e
51
ncplot_defblitter(
const
notcurses
* nc){
52
if
(notcurses_canutf8(nc)){
53
return
NCBLIT_8x1
;
54
}
55
return
NCBLIT_1x1
;
56
}
57
58
#ifdef __cplusplus
59
}
60
#endif
61
62
#endif
blit.h
ncscale_e
ncscale_e
Definition
notcurses.h:96
NCSCALE_SCALE
@ NCSCALE_SCALE
Definition
notcurses.h:98
NCSCALE_NONE
@ NCSCALE_NONE
Definition
notcurses.h:97
ncblitter_e
ncblitter_e
Definition
notcurses.h:65
NCBLIT_PIXEL
@ NCBLIT_PIXEL
Definition
notcurses.h:73
NCBLIT_4x2
@ NCBLIT_4x2
Definition
notcurses.h:71
NCBLIT_2x2
@ NCBLIT_2x2
Definition
notcurses.h:69
NCBLIT_3x2
@ NCBLIT_3x2
Definition
notcurses.h:70
NCBLIT_1x1
@ NCBLIT_1x1
Definition
notcurses.h:67
NCBLIT_2x1
@ NCBLIT_2x1
Definition
notcurses.h:68
NCBLIT_8x1
@ NCBLIT_8x1
Definition
notcurses.h:76
blitset
Definition
internal.h:398
blitset::geom
ncblitter_e geom
Definition
internal.h:399
blitset::width
unsigned width
Definition
internal.h:400
blitset::height
unsigned height
Definition
internal.h:401
nccapabilities::octants
bool octants
Definition
notcurses.h:1645
nccapabilities::quadrants
bool quadrants
Definition
notcurses.h:1643
nccapabilities::utf8
bool utf8
Definition
notcurses.h:1638
nccapabilities::sextants
bool sextants
Definition
notcurses.h:1644
notcurses
Definition
internal.h:332
tinfo
Definition
termdesc.h:107
tinfo::cellpxx
unsigned cellpxx
Definition
termdesc.h:117
tinfo::caps
nccapabilities caps
Definition
termdesc.h:111
tinfo::cellpxy
unsigned cellpxy
Definition
termdesc.h:116
src
lib
blitset.h
Generated by
1.9.8