ncvisual_rotate: check result of ncvisual_resize()

pull/665/head
nick black 4 years ago
parent 15bd5cfd56
commit e462ea2bef
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -272,8 +272,10 @@ rotate_bounding_box(double stheta, double ctheta, int* leny, int* lenx,
}
auto ncvisual_rotate(ncvisual* ncv, double rads) -> nc_err_e {
ncvisual_resize(ncv, ncv->rows, ncv->cols);
//fprintf(stderr, "stride: %d cols: %d\n", ncv->rowstride, ncv->cols);
nc_err_e err = ncvisual_resize(ncv, ncv->rows, ncv->cols);
if(err != NCERR_SUCCESS){
return err;
}
assert(ncv->rowstride / 4 >= ncv->cols);
rads = -rads; // we're a left-handed Cartesian
if(ncv->data == nullptr){
@ -582,9 +584,12 @@ auto ncvisual_details_seed(struct ncvisual* ncv) -> void {
}
auto ncvisual_resize(ncvisual* nc, int rows, int cols) -> nc_err_e {
(void)nc;
(void)rows;
(void)cols;
// we'd need to verify that it's RGBA as well, except that if we've got no
// multimedia engine, we've only got memory-assembled ncvisuals, which are
// RGBA-native. so we ought be good, but this is undeniably sloppy...
if(nc->rows == rows && nc->cols == cols){
return NCERR_SUCCESS;
}
return NCERR_UNIMPLEMENTED;
}

Loading…
Cancel
Save