void mixer::send_sample(uint32_t permchan, sample_number_t sample) { filter_number_t _sample = upconvert(sample) * get_input_volume(permchan); accumulator = accumulator + get_input_filter(permchan)(_sample); }
int image2xy_run(simplexy_t* s, int downsample, int downsample_as_required) { int newW, newH; anbool free_fimage = FALSE; // the factor by which to downsample. int S = downsample ? downsample : 1; int jj; anbool tryagain; int rtn = -1; if (downsample && downsample > 1) { logmsg("Downsampling by %i...\n", S); if (!s->image) { s->image = upconvert(s->image_u8, s->nx, s->ny); free_fimage = TRUE; } if (!s->image) goto bailout; rebin(&s->image, s->nx, s->ny, S, &newW, &newH); s->nx = newW; s->ny = newH; } do { simplexy_run(s); tryagain = FALSE; if (s->npeaks == 0 && downsample_as_required) { logmsg("Downsampling by 2...\n"); if (s->image_u8) { s->image = upconvert(s->image_u8, s->nx, s->ny); if (!s->image) goto bailout; free_fimage = TRUE; s->image_u8 = NULL; } rebin(&s->image, s->nx, s->ny, 2, &newW, &newH); s->nx = newW; s->ny = newH; S *= 2; tryagain = TRUE; downsample_as_required--; } } while (tryagain); for (jj=0; jj<s->npeaks; jj++) { assert(isfinite((s->x)[jj])); assert(isfinite((s->y)[jj])); // shift the origin to the FITS standard: // center of the lower-left pixel is (1,1). (s->x)[jj] = ((s->x)[jj] + 0.5) * (double)S + 0.5; (s->y)[jj] = ((s->y)[jj] + 0.5) * (double)S + 0.5; } dselip_cleanup(); rtn = 0; bailout: if (free_fimage) { free(s->image); s->image = NULL; } return rtn; }