Skip to content

Commit

Permalink
Use sample accumulator type for source/dest iterator USERT
Browse files Browse the repository at this point in the history
  • Loading branch information
nrusch committed Apr 15, 2022
1 parent 7ff7c8a commit bc12142
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/libOpenImageIO/imagebufalgo_xform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1185,16 +1185,16 @@ st_warp_(ImageBuf& dst, const ImageBuf& src, const ImageBuf& stbuf, int chan_s,
const int filterrad_x = (int)ceilf(filter->width() / 2.0f / xscale);
const int filterrad_y = (int)ceilf(filter->height() / 2.0f / yscale);

ImageBuf::ConstIterator<SRCTYPE> src_iter(src);
ImageBuf::ConstIterator<STTYPE> st_iter(stbuf, roi);
ImageBuf::Iterator<DSTTYPE> out_iter(dst, roi);

// Accumulation buffer for filter samples, typed to maintain the
// necessary precision.
typedef typename Accum_t<DSTTYPE>::type Acc_t;
const int nchannels = roi.chend - roi.chbegin;
Acc_t* sample_accum = OIIO_ALLOCA(Acc_t, nchannels);

ImageBuf::ConstIterator<SRCTYPE, Acc_t> src_iter(src);
ImageBuf::ConstIterator<STTYPE> st_iter(stbuf, roi);
ImageBuf::Iterator<DSTTYPE, Acc_t> out_iter(dst, roi);

// The ST buffer defines the output dimensions, and thus the bounds of
// the outer loop.
// XXX: Sampling of the source buffer can be entirely random, so there
Expand Down

0 comments on commit bc12142

Please sign in to comment.