com.pdfunit.validators

## Class ImageValidator

- java.lang.Object
- - com.pdfunit.validators.AbstractValidator
  - - com.pdfunit.validators.AbstractPageValidator
    - - com.pdfunit.validators.ImageValidator

-     @DoNotObfuscate
      public final class ImageValidator
      extends com.pdfunit.validators.AbstractPageValidator

  Validator for images in PDF documents.
  Since:
    2016.05
  Author:
    Carsten Siedentop, January 2016

- - ### Field Summary

    - ### Fields inherited from class com.pdfunit.validators.AbstractPageValidator

      `effectedPageNumbers, pageScanFlag, pagesToUse, region`

    - ### Fields inherited from class com.pdfunit.validators.AbstractValidator

      `testDocument`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `ImageValidator(DocumentValidator documentValidator)`
    `protected` | `ImageValidator(PageValidator pageValidator)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ImageValidator` | `flipped(FlipDirection flipDirection)`
    `ImageValidator` | `hasImage()` This method checks that images exist inside the given region on each of the specified pages.
    `ImageValidator` | `hasNoImage()`
    `ImageValidator` | `hasNumberOfDifferentImages(int expectedNumber)` This method verifies the different images in the specified region on the specified pages.
    `ImageValidator` | `hasNumberOfVisibleImages(int expectedNumber)` This method verifies that the specified region and pages have the expected number of images.
    `ImageValidator` | `matching(java.awt.image.BufferedImage expectedImage)` This method verifies that one of the extracted images is equal to the expected image which is given by the parameter.
    `ImageValidator` | `matching(java.io.File expectedImageFile)` This method verifies that one of the extracted images is equal to the expected image which is given by the parameter.
    `ImageValidator` | `matching(java.io.InputStream expectedImageStream)` This method verifies that one of the extracted images is equal to the expected image which is given by the parameter.
    `ImageValidator` | `matching(java.lang.String expectedImageFileName)` This method verifies that one of the extracted images is equal to the expected image which is given by the parameter.
    `ImageValidator` | `matching(java.net.URL expectedImageUrl)` This method verifies that one of the extracted images is equal to the expected image which is given by the parameter.
    `ImageValidator` | `matchingOneOf(java.awt.image.BufferedImage[] allExpectedImages)` This method verifies that one of the given images is present on the specified pages.
    `ImageValidator` | `rotatedBy(Rotation rotation)`
    `BarcodeValidator` | `withBarcode()` This method prepares the test system to extract text from bar code images as well as from QR code images.
    `BarcodeValidator` | `withBarcodeInRegion(ImageRegion imageRegion)` This method prepares the test system to extract text from bar code images as well as from QR code images.
    `ImageValidator` | `withHeightInPixel(int expectedHeightInPixel)` This method verifies that one of the given images has the expected height.
    `BarcodeValidator` | `withQRCode()` This method prepares the test system to extract text from QR code images as well as from bar code images.
    `BarcodeValidator` | `withQRCodeInRegion(ImageRegion imageRegion)` This method prepares the test system to extract text from QR code images as well as from bar code images.
    `OCRValidator` | `withText()` This method prepares the test system to extract text from images using OCR.
    `OCRValidator` | `withTextInRegion(ImageRegion inImageRegion)` This method prepares the test system to extract text from images using OCR.
    `ImageValidator` | `withWidthInPixel(int expectedWidthInPixel)` This method verifies that one of the given images has the expected width.

    - ### Methods inherited from class com.pdfunit.validators.AbstractPageValidator

      `createFullSizeRegionFromDocument, getEffectedPages, getPageScanFlag, setPagesToUse, setRegion`

    - ### Methods inherited from class com.pdfunit.validators.AbstractValidator

      `closeDocument, equals, getDocument, hashCode`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ImageValidator

          protected ImageValidator(DocumentValidator documentValidator)

    - #### ImageValidator

          protected ImageValidator(PageValidator pageValidator)

  - ### Method Detail

    - #### flipped

          public ImageValidator flipped(FlipDirection flipDirection)

    - #### hasImage

          @Guarded
          public ImageValidator hasImage()

      This method checks that images exist inside the given region on each of the specified pages.

    - #### hasNoImage

          public ImageValidator hasNoImage()

    - #### hasNumberOfDifferentImages

          @Guarded
          public ImageValidator hasNumberOfDifferentImages(int expectedNumber)

      This method verifies the different images in the specified region on the specified pages.

    - #### hasNumberOfVisibleImages

          @Guarded
          public ImageValidator hasNumberOfVisibleImages(int expectedNumber)

      This method verifies that the specified region and pages have the expected number of images.

    - #### matching

          @Guarded
          public ImageValidator matching(java.lang.String expectedImageFileName)

      This method verifies that one of the extracted images is equal to the expected image which is given by the parameter.

    - #### matching

          @Guarded
          public ImageValidator matching(java.io.File expectedImageFile)

      This method verifies that one of the extracted images is equal to the expected image which is given by the parameter.

    - #### matching

          @Guarded
          public ImageValidator matching(java.io.InputStream expectedImageStream)

      This method verifies that one of the extracted images is equal to the expected image which is given by the parameter.

    - #### matching

          @Guarded
          public ImageValidator matching(java.net.URL expectedImageUrl)

      This method verifies that one of the extracted images is equal to the expected image which is given by the parameter.

    - #### matching

          @Guarded
          public ImageValidator matching(java.awt.image.BufferedImage expectedImage)

      This method verifies that one of the extracted images is equal to the expected image which is given by the parameter.

    - #### matchingOneOf

          @Guarded
          public ImageValidator matchingOneOf(java.awt.image.BufferedImage[] allExpectedImages)

      This method verifies that one of the given images is present on the specified pages.

    - #### rotatedBy

          public ImageValidator rotatedBy(Rotation rotation)

    - #### withBarcode

          public BarcodeValidator withBarcode()

      This method prepares the test system to extract text from bar code images as well as from QR code images.

      This method does the same as `withQRCode()`.

    - #### withBarcodeInRegion

          public BarcodeValidator withBarcodeInRegion(ImageRegion imageRegion)

      This method prepares the test system to extract text from bar code images as well as from QR code images.

      This method does the same as `withQRCodeInRegion(ImageRegion)`.

    - #### withQRCode

          public BarcodeValidator withQRCode()

      This method prepares the test system to extract text from QR code images as well as from bar code images.

      This method does the same as `withBarcode()`.

    - #### withQRCodeInRegion

          public BarcodeValidator withQRCodeInRegion(ImageRegion imageRegion)

      This method prepares the test system to extract text from QR code images as well as from bar code images.

      This method does the same as `withBarcodeInRegion(ImageRegion)`.

    - #### withHeightInPixel

          @Guarded
          public ImageValidator withHeightInPixel(int expectedHeightInPixel)

      This method verifies that one of the given images has the expected height.

    - #### withText

          public OCRValidator withText()

      This method prepares the test system to extract text from images using OCR.

    - #### withTextInRegion

          public OCRValidator withTextInRegion(ImageRegion inImageRegion)

      This method prepares the test system to extract text from images using OCR.

    - #### withWidthInPixel

          @Guarded
          public ImageValidator withWidthInPixel(int expectedWidthInPixel)

      This method verifies that one of the given images has the expected width.

Copyright (C) PDFUnit.com. See here for license.