Class ParserGraphicsState

    • Field Detail

      • clippingPath

        private Path clippingPath
    • Constructor Detail

      • ParserGraphicsState

        ParserGraphicsState()
        Internal empty and default constructor.
      • ParserGraphicsState

        ParserGraphicsState​(ParserGraphicsState source)
        Copy constructor.
        Parameters:
        source - the Graphics State to copy from
    • Method Detail

      • clip

        public void clip​(Path path,
                         int fillingRule)
        Intersects the current clipping path with the given path.

        Note: Coordinates of the given path should be in the transformed user space.

        Parameters:
        path - The path to be intersected with the current clipping path.
        fillingRule - The filling rule which should be applied to the given path. It should be either PdfCanvasConstants.FillingRule.EVEN_ODD or PdfCanvasConstants.FillingRule.NONZERO_WINDING
      • getClippingPath

        public Path getClippingPath()
        Getter for the current clipping path.

        Note: The returned clipping path is in the transformed user space, so if you want to get it in default user space, apply transformation matrix (CanvasGraphicsState.getCtm()).

        Returns:
        The current clipping path.
      • setClippingPath

        public void setClippingPath​(Path clippingPath)
        Sets the current clipping path to the specified path.

        Note:This method doesn't modify existing clipping path, it simply replaces it with the new one instead.

        Parameters:
        clippingPath - New clipping path.
      • transformClippingPath

        private void transformClippingPath​(Matrix newCtm)