Correct mistakes, update default blitter choice

This commit is contained in:
Erik Schnetter 2024-12-22 16:37:31 -05:00 committed by nick black
parent e17c412736
commit bf9c31db27
6 changed files with 17 additions and 15 deletions

View File

@ -310,7 +310,7 @@ If things break or seem otherwise lackluster, **please** consult the
indicates support for them, even if <code>NCBLIT_PIXEL</code> has been
requested. Likewise, sextants (<code>NCBLIT_3x2</code>) won't be used without
Unicode 13 support, octants (<code>NCBLIT_4x2</code>) won't be used without
Unicode 17 support, etc. <code>ncvisual_blit()</code> will use the best blitter
Unicode 16 support, etc. <code>ncvisual_blit()</code> will use the best blitter
available, unless <code>NCVISUAL_OPTION_NODEGRADE</code> is provided (in
which case it will fail).
</details>

View File

@ -95,9 +95,9 @@ multimedia support capable of decoding videos.
UTF-8 encoding, and the locale was successfully loaded.
**notcurses_canoctant** returns **true** if the heuristics suggest
that the terminal can properly render Unicode 17 octants. Likewise,
that the terminal can properly render Unicode 16 octants.
**notcurses_cansextant** returns **true** if the heuristics suggest
that the terminal can properly render Unicode 13 sextants. Likewise,
that the terminal can properly render Unicode 13 sextants, and
**notcurses_canquadrant** and **notcurses_canhalfblock** return **true**
if the heuristics suggest that the terminal can properly render Unicode
quadrants and halfblocks, respectively. **notcurses_canbraille** returns

View File

@ -345,11 +345,12 @@ or if both ***nc*** and ***n*** are **NULL**.
**ncvisual_media_defblitter** returns the blitter selected by **NCBLIT_DEFAULT**
in the specified configuration. If UTF8 is not enabled, this will always be
**NCBLIT_1x1**. If octants are available, (see **notcurses_canictant**), the
aspect-preserving **NCBLIT_4x2** will be returned. If ***scale*** is
**NCSCALE_NONE** or **NCSCALE_SCALE**, the aspect-preserving **NCBLIT_2x1**
will be returned. If sextants are available (see **notcurses_cansextant**),
this will be **NCBLIT_3x2**, or otherwise **NCBLIT_2x2**.
**NCBLIT_1x1**. If ***scale*** is **NCSCALE_NONE** or **NCSCALE_SCALE**, the
aspect-preserving **NCBLIT_2x1** will be returned. If octants are
available (see **notcurses_canoctant**), this will be **NCBLIT_4x2**,
or otherwise, if sextants are available (see
**notcurses_cansextant**), this will be **NCBLIT_3x2**, or otherwise
**NCBLIT_2x2**.
# NOTES
@ -362,7 +363,8 @@ a multimedia backend include **ncvisual_from_file** and
Sixel documentation can be found at [Dankwiki](https://nick-black.com/dankwiki/index.php?title=Sixel).
Kitty's graphics protocol is specified in [its documentation](https://sw.kovidgoyal.net/kitty/graphics-protocol.html).
Bad font support can ruin **NCBLIT_2x2**, **NCBLIT_3x2**, **NCBLIT_4x1**,
Bad font support can ruin **NCBLIT_2x2**, **NCBLIT_4x2**, **NCBLIT_3x2**,
**NCBLIT_4x1**,
**NCBLIT_BRAILLE**, and **NCBLIT_8x1**. Braille glyphs ought ideally draw only
the raised dots, rather than drawing all eight dots with two different styles.
It's often best for the emulator to draw these glyphs itself.

View File

@ -3518,12 +3518,12 @@ API ALLOC struct ncplane* ncvisual_subtitle_plane(struct ncplane* parent,
// Get the default *media* (not plot) blitter for this environment when using
// the specified scaling method. Currently, this means:
// - if lacking UTF-8, NCBLIT_1x1
// - otherwise, if octants are known to be good, NCBLIT_4x2
// - otherwise, if not NCSCALE_STRETCH, NCBLIT_2x1
// - otherwise, if octants are known to be good, NCBLIT_4x2
// - otherwise, if sextants are not known to be good, NCBLIT_2x2
// - otherwise NCBLIT_3x2
// NCBLIT_2x2 and NCBLIT_3x2 both distort the original aspect ratio, thus
// NCBLIT_4x2 or NCBLIT_2x1 is used outside of NCSCALE_STRETCH.
// NCBLIT_2x1 is used outside of NCSCALE_STRETCH.
API ncblitter_e ncvisual_media_defblitter(const struct notcurses* nc, ncscale_e scale)
__attribute__ ((nonnull (1)));

View File

@ -1220,7 +1220,7 @@ braille_blit(ncplane* nc, int linesize, const void* data, int leny, int lenx,
// 1 4
// 2 5
// 3 6
// 4 7
// 7 8
// FIXME fold this into the above?
if(!rgba_trans_p(*rgbbase_l0, bargs->transcolor)){
egcidx |= 1u;

View File

@ -32,12 +32,12 @@ rgba_blitter_default(const tinfo* tcache, ncscale_e scale){
if(!tcache->caps.utf8){
return NCBLIT_1x1; // only one that works in ASCII
}
if(tcache->caps.octants){
return NCBLIT_4x2;
}
if(scale == NCSCALE_NONE || scale == NCSCALE_SCALE){
return NCBLIT_2x1;
}
if(tcache->caps.octants){
return NCBLIT_4x2;
}
if(tcache->caps.sextants){
return NCBLIT_3x2;
}