com.levigo.jadice.document.model
Class DocumentModelInfo

java.lang.Object
  extended by com.levigo.jadice.document.model.DocumentModelInfo

public class DocumentModelInfo
extends Object

An utility class used to extract statistics from a page or a page segment.


Method Summary
static DocumentModelInfo get(Page page)
          Return the model information for the given page.
static DocumentModelInfo get(PageSegment ps)
          Return the model information for the given page segment.
 Resolution getMaximumImageResolution()
          Returns the highest resolution of all images contained in the referenced page or page segment.
 Resolution getMinimumImageResolution()
          Returns the lowest resolution of all images contained in the referenced page or page segment.
 int getNumberOfImages()
          Returns the number of images contained in the referenced page or page segment.
 List<Rectangle2D> getTranslucentRegions()
          Returns an unmodifiable list of translucent regions within the referenced page or page segment.
 List<Rectangle2D> getTransparentRegions()
          Returns an unmodifiable list of transparent regions within the referenced page or page segment.
 boolean isColored()
          Returns whether the referenced page or page segment contains any colored elements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

public static DocumentModelInfo get(PageSegment ps)
Return the model information for the given page segment.

Parameters:
ps - the page segment
Returns:
the page segment's DocumentModelInfo

get

public static DocumentModelInfo get(Page page)
Return the model information for the given page.

Parameters:
page - the page
Returns:
the page's DocumentModelInfo

getNumberOfImages

public int getNumberOfImages()
Returns the number of images contained in the referenced page or page segment.

Returns:
the number of images

getMaximumImageResolution

public Resolution getMaximumImageResolution()
Returns the highest resolution of all images contained in the referenced page or page segment.

Returns:
the highest resolution or null if no images are contained in the referenced page or page segment.

getMinimumImageResolution

public Resolution getMinimumImageResolution()
Returns the lowest resolution of all images contained in the referenced page or page segment.

Returns:
the lowest resolution or null if no images are contained in the referenced page or page segment.

getTransparentRegions

public List<Rectangle2D> getTransparentRegions()
Returns an unmodifiable list of transparent regions within the referenced page or page segment.

Returns:
a list of transparent regions.

getTranslucentRegions

public List<Rectangle2D> getTranslucentRegions()
Returns an unmodifiable list of translucent regions within the referenced page or page segment.

Returns:
a list of translucent regions.

isColored

public boolean isColored()
Returns whether the referenced page or page segment contains any colored elements.

Returns:
false if the referenced page or page segment solely contains white or black colored elements, otherwise true will be returned.


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.