mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 09:09:03 -04:00
remove unnecessary args from ncdirect_raster_frame() #1248
This commit is contained in:
parent
1d8fcbb5e4
commit
638dde7657
1
NEWS.md
1
NEWS.md
@ -4,6 +4,7 @@ rearrangements of Notcurses.
|
||||
* 2.1.3 (not yet released)
|
||||
* `ncdirect_styles_{set, on, off}()` have been deprecated in favor of
|
||||
`ncdirect_{set, on, off}_styles()`, to match `ncplane_` equivalents.
|
||||
* `ncdirect_raster_frame()` no longer requires `blitter` nor `scale`.
|
||||
|
||||
* 2.1.2 (2020-12-25)
|
||||
* Add `notcurses_linesigs_enable()` and `notcurses_linesigs_disable()`.
|
||||
|
@ -148,9 +148,9 @@ namespace ncpp
|
||||
return ncdirect_render_frame (direct, file, blitter, scale);
|
||||
}
|
||||
|
||||
int raster_image (ncdirectv* faken, ncalign_e align, ncblitter_e blitter, ncscale_e scale) const noexcept
|
||||
int raster_image (ncdirectv* faken, ncalign_e align) const noexcept
|
||||
{
|
||||
return ncdirect_raster_frame (direct, faken, align, blitter, scale);
|
||||
return ncdirect_raster_frame (direct, faken, align);
|
||||
}
|
||||
|
||||
bool putstr (uint64_t channels, const char* utf8) const NOEXCEPT_MAYBE
|
||||
|
@ -207,12 +207,8 @@ API int ncdirect_stop(struct ncdirect* nc);
|
||||
API ncdirectv* ncdirect_render_frame(struct ncdirect* n, const char* filename,
|
||||
ncblitter_e blitter, ncscale_e scale);
|
||||
|
||||
// Takes the result of ncdirect_render_frame() and writes it to the output. The
|
||||
// 'align', 'blitter', and 'scale' arguments must be the same as those passed
|
||||
// to ncdirect_render_frame().
|
||||
API int ncdirect_raster_frame(struct ncdirect* n, ncdirectv* faken,
|
||||
ncalign_e align, ncblitter_e blitter,
|
||||
ncscale_e scale);
|
||||
// Takes the result of ncdirect_render_frame() and writes it to the output.
|
||||
API int ncdirect_raster_frame(struct ncdirect* n, ncdirectv* ncdv, ncalign_e align);
|
||||
|
||||
#undef API
|
||||
|
||||
|
@ -433,21 +433,15 @@ ncdirect_dump_plane(ncdirect* n, const ncplane* np, int xoff){
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ncdirect_raster_frame(ncdirect* n, ncdirectv* faken, ncalign_e align,
|
||||
ncblitter_e blitter, ncscale_e scale){
|
||||
auto bset = rgba_blitter_low(n->utf8, n->tcache.sextants, scale, true, blitter);
|
||||
if(!bset){
|
||||
free_plane(faken);
|
||||
return -1;
|
||||
}
|
||||
int lenx = ncplane_dim_x(faken);
|
||||
int ncdirect_raster_frame(ncdirect* n, ncdirectv* ncdv, ncalign_e align){
|
||||
int lenx = ncplane_dim_x(ncdv);
|
||||
int xoff = ncdirect_align(n, align, lenx);
|
||||
if(ncdirect_dump_plane(n, faken, xoff)){
|
||||
free_plane(faken);
|
||||
if(ncdirect_dump_plane(n, ncdv, xoff)){
|
||||
free_plane(ncdv);
|
||||
return -1;
|
||||
}
|
||||
int r = ncdirect_flush(n);
|
||||
free_plane(faken);
|
||||
free_plane(ncdv);
|
||||
return r;
|
||||
}
|
||||
|
||||
@ -494,19 +488,19 @@ ncdirectv* ncdirect_render_frame(ncdirect* n, const char* file,
|
||||
.resizecb = nullptr,
|
||||
.flags = 0,
|
||||
};
|
||||
struct ncplane* faken = ncplane_new_internal(nullptr, nullptr, &nopts);
|
||||
if(faken == nullptr){
|
||||
auto ncdv = ncplane_new_internal(nullptr, nullptr, &nopts);
|
||||
if(!ncdv){
|
||||
ncvisual_destroy(ncv);
|
||||
return nullptr;
|
||||
}
|
||||
if(ncvisual_blit(ncv, disprows, dispcols, faken, bset,
|
||||
if(ncvisual_blit(ncv, disprows, dispcols, ncdv, bset,
|
||||
0, 0, 0, 0, leny, lenx, false)){
|
||||
ncvisual_destroy(ncv);
|
||||
free_plane(faken);
|
||||
free_plane(ncdv);
|
||||
return nullptr;
|
||||
}
|
||||
ncvisual_destroy(ncv);
|
||||
return faken;
|
||||
return ncdv;
|
||||
}
|
||||
|
||||
int ncdirect_render_image(ncdirect* n, const char* file, ncalign_e align,
|
||||
@ -515,7 +509,7 @@ int ncdirect_render_image(ncdirect* n, const char* file, ncalign_e align,
|
||||
if(!faken){
|
||||
return -1;
|
||||
}
|
||||
return ncdirect_raster_frame(n, faken, align, blitter, scale);
|
||||
return ncdirect_raster_frame(n, faken, align);
|
||||
}
|
||||
|
||||
int ncdirect_fg_palindex(ncdirect* nc, int pidx){
|
||||
|
@ -146,7 +146,7 @@ void ncls_thread(const lsContext* ctx) {
|
||||
pthread_mutex_lock(&outmtx);
|
||||
std::cout << j.p << '\n';
|
||||
if(faken){
|
||||
ctx->nc.raster_image(faken, ctx->alignment, NCBLIT_DEFAULT, NCSCALE_SCALE_HIRES);
|
||||
ctx->nc.raster_image(faken, ctx->alignment);
|
||||
}
|
||||
pthread_mutex_unlock(&outmtx);
|
||||
}else if(!keep_working){
|
||||
|
Loading…
x
Reference in New Issue
Block a user