javax.media.jai.InterpolationBilinear Java Examples

The following examples show how to use javax.media.jai.InterpolationBilinear. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RasterDataAdapter.java    From geowave with Apache License 2.0 6 votes vote down vote up
protected static byte interpolationToByte(final Interpolation interpolation) {
  // this is silly because it seems like a translation JAI should provide,
  // but it seems its not provided and its the most efficient approach
  // (rather than serializing class names)
  if (interpolation instanceof InterpolationNearest) {
    return Interpolation.INTERP_NEAREST;
  }
  if (interpolation instanceof InterpolationBilinear) {
    return Interpolation.INTERP_BILINEAR;
  }
  if (interpolation instanceof InterpolationBicubic2) {
    return Interpolation.INTERP_BICUBIC_2;
  }

  return Interpolation.INTERP_BICUBIC;
}
 
Example #2
Source File: InterpolationValues.java    From sldeditor with GNU General Public License v3.0 5 votes vote down vote up
/** Populate interpolation map. */
private static synchronized void populateInterpolation() {
    if (interpolationMap == null) {
        interpolationMap = new LinkedHashMap<>();
        interpolationMap.put(InterpolationNearest.class, "Nearest Neighbour");
        interpolationMap.put(InterpolationBicubic.class, "Bicubic");
        interpolationMap.put(InterpolationBicubic2.class, "Bicubic2");
        interpolationMap.put(InterpolationBilinear.class, "Bilinear");
    }
}
 
Example #3
Source File: JaiDewarper.java    From libreveris with GNU Lesser General Public License v3.0 5 votes vote down vote up
public RenderedImage dewarpImage ()
{
    ParameterBlock pb = new ParameterBlock();
    pb.addSource(Picture.invert(sheet.getPicture().getImage()));
    pb.add(dewarpGrid);
    pb.add(new InterpolationBilinear());

    RenderedImage dewarpedImage = Picture.invert(JAI.create("warp", pb));
    ((PlanarImage) dewarpedImage).getTiles();

    return dewarpedImage;
}
 
Example #4
Source File: TestWarp.java    From libreveris with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Creates a new TestWarp object.
 */
public TestWarp (String path)
{
    srcImage = JAI.create("fileload", new ParameterBlock().add(path), null);
    //        srcImage = PictureLoader.loadImages(new File(path), null)
    //                                .get(1);
    //        srcImage = buildPattern(20, 10, 50, 50);
    dimension = new Dimension(srcImage.getWidth(), srcImage.getHeight());
    setPreferredSize(dimension);

    //        float[]        xCoeffs = new float[] { 0f, 1.25f, 0.04f };
    //        float[]        yCoeffs = new float[] { 0f, -0.02f, 1.5f };
    //        Warp           warp = new WarpAffine(xCoeffs, yCoeffs);
    //
    int            xStep = 500;
    int            xNumCells = 2;
    int            yStep = 500;
    int            yNumCells = 1;
    float[]        warpPositions = new float[] {
                                       -100f, 0f, 500f, 100f, 1000f, 0f, // top line
    0f, 500f, 500f, 500f, 1000f, 500f
                                   }; // bot line
    Warp           warp = new WarpGrid(
        0,
        xStep,
        xNumCells,
        0,
        yStep,
        yNumCells,
        warpPositions);
    ParameterBlock pb = new ParameterBlock();
    pb.addSource(invert(srcImage));
    pb.add(warp);
    pb.add(new InterpolationBilinear());
    dstImage = invert(JAI.create("warp", pb));
    ((PlanarImage) dstImage).getTiles();
}