Class RasterizedGeometry2D

    • Constructor Detail

      • RasterizedGeometry2D

        public RasterizedGeometry2D()
    • Method Detail

      • queryPointInGeometry

        public abstract RasterizedGeometry2D.HitType queryPointInGeometry​(double x,
                                                                          double y)
        Test a point against the RasterizedGeometry
      • create

        public static RasterizedGeometry2D create​(Geometry geom,
                                                  double toleranceXY,
                                                  int rasterSizeBytes)
        Creates a rasterized geometry from a given Geometry.
        Parameters:
        geom - The input geometry to rasterize. It has to be a MultiVertexGeometry instance.
        toleranceXY - The tolerance of the rasterization. Raster pixels that are closer than given tolerance to the Geometry will be set.
        rasterSizeBytes - The max size of the raster in bytes. The raster has size of rasterSize x rasterSize. Polygons are rasterized into 2 bpp (bits per pixel) rasters while other geometries are rasterized into 1 bpp rasters. 32x32 pixel raster for a polygon would take 256 bytes of memory
      • canUseAccelerator

        static boolean canUseAccelerator​(Geometry geom)
        Checks whether the RasterizedGeometry2D accelerator can be used with the given geometry.
      • getToleranceXY

        public abstract double getToleranceXY()
        Returns the tolerance for which the rasterized Geometry has been built.
      • getRasterSize

        public abstract int getRasterSize()
        Returns raster size in bytes
      • dbgSaveToBitmap

        public abstract boolean dbgSaveToBitmap​(java.lang.String fileName)
        Dumps the raster to a bmp file for debug purposes.
        Parameters:
        fileName -
        Returns:
        true if success, false otherwise.
      • estimateMemorySize

        public abstract long estimateMemorySize()
        Returns an estimate of this object size in bytes.
        Returns:
        Returns an estimate of this object size in bytes.