Class SVGLookupOp

All Implemented Interfaces:
XMLConstants, ErrorConstants, SVGFilterConverter, SVGSyntax, CSSConstants, SVGConstants

public class SVGLookupOp extends AbstractSVGFilterConverter
Utility class that converts a LookupOp object into an SVG filter descriptor. The SVG filter corresponding to a LookupOp is an feComponentTransfer, with a type set to 'table', the tableValues set to the content of the lookup table.
Version:
$Id: SVGLookupOp.java 1733416 2016-03-03 07:07:13Z gadams $
See Also:
  • Field Details

    • GAMMA

      private static final double GAMMA
      Gamma for linear to sRGB convertion
      See Also:
    • linearToSRGBLut

      private static final int[] linearToSRGBLut
      Lookup table for linear to sRGB value forward and backward mapping
    • sRGBToLinear

      private static final int[] sRGBToLinear
  • Constructor Details

    • SVGLookupOp

      public SVGLookupOp(SVGGeneratorContext generatorContext)
      Parameters:
      generatorContext - used to build Elements
  • Method Details

    • toSVG

      public SVGFilterDescriptor toSVG(BufferedImageOp filter, Rectangle filterRect)
      Converts a Java 2D API BufferedImageOp into a set of attribute/value pairs and related definitions
      Parameters:
      filter - BufferedImageOp filter to be converted
      filterRect - Rectangle, in device space, that defines the area to which filtering applies. May be null, meaning that the area is undefined.
      Returns:
      descriptor of the attributes required to represent the input filter
      See Also:
    • toSVG

      public SVGFilterDescriptor toSVG(LookupOp lookupOp)
      Parameters:
      lookupOp - the LookupOp to be converted
      Returns:
      a description of the SVG filter corresponding to lookupOp. The definition of the feComponentTransfer filter in put in feComponentTransferDefSet
    • convertLookupTables

      private String[] convertLookupTables(LookupOp lookupOp)
      Converts the filter's LookupTable into an array of corresponding SVG table strings