final int yfrac = (int) ((y - y0) * (1 << interpolation.getSubsampleBitsV())); dest[band] = interpolation.interpolate(samples, xfrac, yfrac);
@Test public void testInterpolationBilinear() { // make sure the class is registered and assigned Interpolation result = Converters.convert("InterpolationBilinear(2)", INTERPOLATION_CLASS); assertNotNull(result); assertSame(result.getClass(), InterpolationBilinear.class); assertSame(result.getSubsampleBitsH(), 2); assertSame(result.getSubsampleBitsV(), 2); result = Converters.convert("InterpolationBilinear(4)", INTERPOLATION_CLASS); assertNotNull(result); assertSame(result.getClass(), InterpolationBilinear.class); assertSame(result.getSubsampleBitsH(), 4); assertSame(result.getSubsampleBitsV(), 4); result = Converters.convert("InterpolationBilinear", INTERPOLATION_CLASS); assertNotNull(result); assertSame(result.getClass(), InterpolationBilinear.class); assertSame(result.getSubsampleBitsH(), 8); assertSame(result.getSubsampleBitsV(), 8); // test case sensiteveness assertNull(Converters.convert("interpolationBilinear", INTERPOLATION_CLASS)); assertNull(Converters.convert("Interpolationbilinear", INTERPOLATION_CLASS)); assertNull(Converters.convert("interpolationbilinear", INTERPOLATION_CLASS)); }
@Test public void testInterpolationBicubic() { // make sure the class is registered and assigned Interpolation result = Converters.convert("InterpolationBicubic(2)", INTERPOLATION_CLASS); assertNotNull(result); assertSame(result.getClass(), InterpolationBicubic.class); assertSame(result.getSubsampleBitsH(), 2); assertSame(result.getSubsampleBitsV(), 2); result = Converters.convert("InterpolationBicubic(4)", INTERPOLATION_CLASS); assertNotNull(result); assertSame(result.getClass(), InterpolationBicubic.class); assertSame(result.getSubsampleBitsH(), 4); assertSame(result.getSubsampleBitsV(), 4); result = Converters.convert("InterpolationBicubic", INTERPOLATION_CLASS); assertNull(result); // test case sensiteveness assertNull(Converters.convert("interpolationBicubic(2)", INTERPOLATION_CLASS)); assertNull(Converters.convert("Interpolationbicubic(2)", INTERPOLATION_CLASS)); assertNull(Converters.convert("interpolationbicubic(2)", INTERPOLATION_CLASS)); }
@Test public void testInterpolationBicubic2() { // make sure the class is registered and assigned Interpolation result = Converters.convert("InterpolationBicubic2(2)", INTERPOLATION_CLASS); assertNotNull(result); assertSame(result.getClass(), InterpolationBicubic2.class); assertSame(result.getSubsampleBitsH(), 2); assertSame(result.getSubsampleBitsV(), 2); result = Converters.convert("InterpolationBicubic2(4)", INTERPOLATION_CLASS); assertNotNull(result); assertSame(result.getClass(), InterpolationBicubic2.class); assertSame(result.getSubsampleBitsH(), 2); assertSame(result.getSubsampleBitsV(), 2); // missing subsamplebits result = Converters.convert("InterpolationBicubic2", INTERPOLATION_CLASS); assertNull(result); // test case sensiteveness assertNull(Converters.convert("interpolationBicubic2(2)", INTERPOLATION_CLASS)); assertNull(Converters.convert("Interpolationbicubic2(2)", INTERPOLATION_CLASS)); assertNull(Converters.convert("interpolationbicubic2(2)", INTERPOLATION_CLASS)); } }
int precV = 1 << interp.getSubsampleBitsV();
int precV = 1 << interp.getSubsampleBitsV();
int precV = 1 << interp.getSubsampleBitsV();
int precV = 1 << interp.getSubsampleBitsV();
assert j == samples.length; final int xfrac = (int) ((x-x0) * (1 << interpolation.getSubsampleBitsH())); final int yfrac = (int) ((y-y0) * (1 << interpolation.getSubsampleBitsV())); dest[band] = interpolation.interpolate(samples, xfrac, yfrac);
assert j == samples.length; final int xfrac = (int) ((x-x0) * (1 << interpolation.getSubsampleBitsH())); final int yfrac = (int) ((y-y0) * (1 << interpolation.getSubsampleBitsV())); dest[band] = interpolation.interpolate(samples, xfrac, yfrac);
int precV = 1 << interp.getSubsampleBitsV();
int precV = 1 << interp.getSubsampleBitsV();
int precV = 1 << interp.getSubsampleBitsV();
int precV = 1 << interp.getSubsampleBitsV();
int precV = 1 << interp.getSubsampleBitsV();
int precV = 1 << interp.getSubsampleBitsV();
int precV = 1 << interp.getSubsampleBitsV();
int precV = 1 << interp.getSubsampleBitsV();
int precV = 1 << interp.getSubsampleBitsV();
int precV = 1 << interp.getSubsampleBitsV();