Class ContrastRatioConsumer

java.lang.Object
org.verapdf.wcag.algorithms.semanticalgorithms.consumers.WCAGConsumer
org.verapdf.wcag.algorithms.semanticalgorithms.consumers.ContrastRatioConsumer
All Implemented Interfaces:
Closeable, AutoCloseable, Consumer<INode>

public class ContrastRatioConsumer extends WCAGConsumer implements Consumer<INode>, Closeable
  • Field Details

  • Constructor Details

    • ContrastRatioConsumer

      public ContrastRatioConsumer() throws IOException
      Throws:
      IOException
    • ContrastRatioConsumer

      public ContrastRatioConsumer(String sourcePdfPath) throws IOException
      Throws:
      IOException
    • ContrastRatioConsumer

      public ContrastRatioConsumer(String sourcePdfPath, String password, boolean enableAntialias, Float imagePixelSize) throws IOException
      Throws:
      IOException
    • ContrastRatioConsumer

      public ContrastRatioConsumer(String password, boolean enableAntialias, Float imagePixelSize)
  • Method Details

    • run

      public boolean run()
      Overrides:
      run in class WCAGConsumer
    • calculateContrast

      public void calculateContrast(ITree tree)
    • accept

      public void accept(INode node)
      Specified by:
      accept in interface Consumer<INode>
    • getContrastRatio

      public double getContrastRatio(double first, double second)
    • getRenderPage

      public BufferedImage getRenderPage(int pageNumber)
    • calculateContrastRatio

      public void calculateContrastRatio(TextChunk textChunk)
    • getDpiScalingForPage

      public double getDpiScalingForPage(int pageNumber)
    • isUseConstantRenderDpi

      public boolean isUseConstantRenderDpi()
    • calculateContrastRation

      public void calculateContrastRation(TextChunk textChunk, BufferedImage renderedPage)
    • getPageSubImage

      public BufferedImage getPageSubImage(BoundingBox bBox)
    • getDPI

      public float getDPI(org.apache.pdfbox.pdmodel.PDDocument document, Integer pageNumber)
    • getPercent

      public Double getPercent()
      Overrides:
      getPercent in class WCAGConsumer
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • getImagePixelSize

      public Float getImagePixelSize()
    • getWCAGProgressStatus

      public WCAGProgressStatus getWCAGProgressStatus()
      Overrides:
      getWCAGProgressStatus in class WCAGConsumer