Interface ChipService


public interface ChipService
A ChipService provides a "chipped image" from a supplied image and polygons representing the coordinates of the original and the chip.
  • Method Summary

    Modifier and Type
    Method
    Description
    chip(BufferedImage inputImage, org.locationtech.jts.geom.Polygon inputImagePolygon, org.locationtech.jts.geom.Polygon chipPolygon)
     
    crop(BufferedImage inputImage, int x, int y, int w, int h)
     
  • Method Details

    • chip

      BufferedImage chip(BufferedImage inputImage, org.locationtech.jts.geom.Polygon inputImagePolygon, org.locationtech.jts.geom.Polygon chipPolygon) throws ChipOutOfBoundsException
      Parameters:
      inputImage - The original source image that the chip will be taken from.
      inputImagePolygon - A polygon representing the coordinates of the soure image.
      chipPolygon - A polygon representing the coordinates of the region to be chipped.
      Returns:
      A BufferedImage containing the chipped region's pixels.
      Throws:
      ChipOutOfBoundsException - when the chip's envelope crosses the boundary of the inputImagePolygon.
    • crop

      BufferedImage crop(BufferedImage inputImage, int x, int y, int w, int h) throws ChipOutOfBoundsException
      Parameters:
      inputImage - The image to be cropped.
      x - The x coordinate of the top left corner of the crop area. If 'x' is less than 0 then 0 will be used.
      y - The y coordinate of the top left corner of the crop area. If 'y' is less than 0 then 0 will be used.
      w - The width of the crop region. If x + w is greater than the width of the image then w will be adjusted down such that x + w will equal the image width.
      h - The height of hte crop region. If y + h is greater than the height of the image then h will be adjusted down such that y + w will equal the image height.
      Returns:
      The portion of the image inside the crop area.
      Throws:
      ChipOutOfBoundsException - when x > image width, y > image height, w < 0 or h < 0.