/** * @brief ProcessBBox * @param dst * @param src * @param box */ void ProcessBBox(Image *dst, ImageVec src, BBox *box) { float *vSrc1 = new float[dst->channels]; float height1f = float(box->height - 1); float width1f = float(box->width - 1); for(int j = box->y0; j < box->y1; j++) { float y = float(j) / height1f; for(int i = box->x0; i < box->x1; i++) { float x = float(i) / width1f; float *out = (*dst )(i, j); isb->SampleImage(src[0], x, y, out); isb->SampleImage(src[1], x, y, vSrc1); for(int k = 0; k < dst->channels; k++) { out[k] -= vSrc1[k]; } } } delete[] vSrc1; }
void FilterSampler3D::ProcessBBox(Image *dst, ImageVec src, BBox *box) { Image *source = src[0]; for(int p = box->z0; p < box->z1; p++) { float t = float(p) / float(box->frames - 1); for(int j = box->y0; j < box->y1; j++) { float y = float(j) / float(box->height - 1); for(int i = box->x0; i < box->x1; i++) { float x = float(i) / float(box->width - 1); int c = p * source->tstride + j * source->ystride + i * source->xstride; isb->SampleImage(source, x, y, t, &dst->data[c]); } } } }