Class PageProcessor

  • All Implemented Interfaces:

    
    public class PageProcessor
    
                        

    Performs processing operation on Page

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Page applyFilter(Page page, ParametricFilter parametricFilter) Applies an image filter on given page based on the existing unfiltered document image.
      final Page applyFilter(Page page, List<ParametricFilter> parametricFilters) Applies an image filters in a given order in the list on given page based on the existing unfiltered document image.
      final Bitmap generateFilteredPreview(Page page, ParametricFilter parametricFilter) Generates filtered preview image based on the unfiltered document preview image and caches it in the file system.
      final Page detectDocument(Page page) Performs document detection on the original image of given page.
      final Page rotate(Page page, Integer times) Rotates all images (and previews) of the given page x times.
      final Page cropAndRotate(Page page, Integer times, List<PointF> polygon) Crops the polygon from the original image and rotates all images (and previews) of the given page x times.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • applyFilter

         final Page applyFilter(Page page, ParametricFilter parametricFilter)

        Applies an image filter on given page based on the existing unfiltered document image. The filtered image result will be stored as document image of the page. The current document image of the page will be overwritten. The original image of the page will not be modified.

        Parameters:
        page - Existing page with unfiltered document image.
        parametricFilter - Supported filter type.
      • applyFilter

         final Page applyFilter(Page page, List<ParametricFilter> parametricFilters)

        Applies an image filters in a given order in the list on given page based on the existing unfiltered document image. The filtered image result will be stored as document image of the page. The current document image of the page will be overwritten. The original image of the page will not be modified.

        Parameters:
        page - Existing page with unfiltered document image.
        parametricFilters - List of the supported filter types.
      • generateFilteredPreview

         final Bitmap generateFilteredPreview(Page page, ParametricFilter parametricFilter)

        Generates filtered preview image based on the unfiltered document preview image and caches it in the file system.

        Parameters:
        page - Existing page with unfiltered document image.
        parametricFilter - Supported filter type.
      • detectDocument

         final Page detectDocument(Page page)

        Performs document detection on the original image of given page. The page must have the original image. Creates and stored the document (cropped) image file based on document detection result (polygon) and optionally defined filter in the page object.

        Parameters:
        page - Existing page with original image.
      • rotate

         final Page rotate(Page page, Integer times)

        Rotates all images (and previews) of the given page x times. The original image is required, other images (document, unfiltered document) are optional. The direction of rotation is counterclockwise if the times value is positive and clockwise if times value is negative (e.g. -2 = rotates 2 times to the right).

        Parameters:
        page - Existing page with at least the original image.
        times - Rotate x times
      • cropAndRotate

         final Page cropAndRotate(Page page, Integer times, List<PointF> polygon)

        Crops the polygon from the original image and rotates all images (and previews) of the given page x times. The original image is required, other images (document, unfiltered document) are optional. The direction of rotation is counterclockwise if the times value is positive and clockwise if times value is negative (e.g. -2 = rotates 2 times to the right).

        Parameters:
        page - Existing page with at least the original image.
        times - Rotate x times
        polygon - Polygon to crop