private void updateImage() { fill(_vnull, _v); for (int is = 0; is < _ns; ++is) { float[] x1 = _x1[is]; float[] x2 = _x2[is]; float[] vx = _vx[is]; int np = _x1[is].length; if (np == 1) { _is2.set(x1[0], x2[0], vx[0]); } else if (np > 1) { for (int ip = 1; ip < np; ++ip) { float x1a = x1[ip - 1]; float x2a = x2[ip - 1]; float vxa = vx[ip - 1]; float x1b = x1[ip]; float x2b = x2[ip]; float vxb = vx[ip]; ImageSampler2.Line line = _is2.sampleLine(x1a, x2a, x1b, x2b); int nr = line.nr(); float ra = line.ra(); float rb = line.rb(); float dvx = (nr > 1) ? (vxb - vxa) / (float) (nr - 1) : vxa; for (int ir = 0; ir < nr; ++ir) { float vxi = vxa + (float) ir * dvx; line.set(ir, vxi); } } } } }