c++ wrapper for direct-mode streaming #1515

This commit is contained in:
nick black 2021-04-14 18:48:53 -04:00
parent 529972d16b
commit d2394f9c63
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
2 changed files with 7 additions and 2 deletions

View File

@ -164,6 +164,11 @@ namespace ncpp
return ncdirect_raster_frame (direct, faken, static_cast<ncalign_e>(align));
}
int streamfile (const char* filename, ncstreamcb streamer, struct ncvisual_options* vopts, void* curry) const NOEXCEPT_MAYBE
{
return error_guard (ncdirect_stream(direct, filename, streamer, vopts, curry), -1);
}
bool putstr (uint64_t channels, const char* utf8) const NOEXCEPT_MAYBE
{
return error_guard (ncdirect_putstr (direct, channels, utf8), -1);

View File

@ -408,7 +408,7 @@ ncdirect_dump_plane(ncdirect* n, const ncplane* np, int xoff){
}
return 0;
}
fprintf(stderr, "rasterizing %dx%d+%d\n", dimy, dimx, xoff);
//fprintf(stderr, "rasterizing %dx%d+%d\n", dimy, dimx, xoff);
// save the existing style and colors
const bool fgdefault = ncdirect_fg_default_p(n);
const bool bgdefault = ncdirect_bg_default_p(n);
@ -1143,7 +1143,7 @@ int ncdirect_stream(ncdirect* n, const char* filename, ncstreamcb streamer,
}
ncdirect_raster_frame(n, v, (vopts->flags & NCVISUAL_OPTION_HORALIGNED) ? vopts->x : 0);
streamer(ncv, vopts, NULL, curry);
}while(ncvisual_decode(ncv));
}while(ncvisual_decode(ncv) == 0);
ncvisual_destroy(ncv);
return 0;
}