Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.netbeans.jemmy.image
Class ColorImageComparator

    java.lang.Object
      |
      +--org.netbeans.jemmy.image.StrictImageComparator
            |
            +--org.netbeans.jemmy.image.ColorImageComparator

All Implemented Interfaces:
  ImageComparator

public class ColorImageComparator
extends StrictImageComparator

Compares two images with color mapping defined by `ColorModel` implementation.

Author:
  Alexandre Iline (alexandre.iline@sun.com)

Inner Class Summary
`static class` | `ColorImageComparator.BackgroundColorMap` Turns `background` color to black, left others unchanged.
`static interface` | `ColorImageComparator.ColorMap` Interface to map colors during the comparision.
`static class` | `ColorImageComparator.ForegroundColorMap` Turns `foreground` color to white, other - to black.

Constructor Summary
`ColorImageComparator(ColorImageComparator.ColorMap map)` Creates a comparator with a color maps.
`ColorImageComparator(ColorImageComparator.ColorMap leftMap, ColorImageComparator.ColorMap rightMap)` Creates a comparator with two color maps.
`ColorImageComparator(ColorImageComparator.ColorMap leftMap, ColorImageComparator.ColorMap rightMap, ImageComparator subComparator)` Creates a comparator with two color maps.
`ColorImageComparator(ColorImageComparator.ColorMap map, ImageComparator subComparator)` Creates a comparator with `map` color mapping.

Method Summary
`boolean` | `compare(java.awt.image.BufferedImage image1, java.awt.image.BufferedImage image2)` Compares images by `ImageComparator` passed into constructor, or itself if no `ImageComparator` was passed, processing both images by `ColorMap` instance before comparision.
`protected boolean` | `compareColors(int rgb1, int rgb2)` Could be used to override the way of comparing colors.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ColorImageComparator

    public ColorImageComparator(ColorImageComparator.ColorMap map)

  Creates a comparator with a color maps. Object created by this constructor behaves like `StrictImageComparator`. Object created works faster because it does not create intermediate images for another comparator.
  Parameters:
    `map` - Map applied to both left and right images during comparision.

### ColorImageComparator

    public ColorImageComparator(ColorImageComparator.ColorMap map,
                                ImageComparator subComparator)

  Creates a comparator with `map` color mapping. Actual comparision perfomed by `comparator` parameter.
  Parameters:
    `map` - Map applied to both left and right images during comparision.
    `subComparator` - comporator to perform a comparision of to images with mapped colors.

### ColorImageComparator

    public ColorImageComparator(ColorImageComparator.ColorMap leftMap,
                                ColorImageComparator.ColorMap rightMap)

  Creates a comparator with two color maps. Object created by this constructor behaves like `StrictImageComparator`. Object created works faster because it does not create intermediate images for another comparator.
  Parameters:
    `leftMap` - Map applied to the left image during comparision.
    `rightMap` - Map applied to the right image during comparision.

### ColorImageComparator

    public ColorImageComparator(ColorImageComparator.ColorMap leftMap,
                                ColorImageComparator.ColorMap rightMap,
                                ImageComparator subComparator)

  Creates a comparator with two color maps. Actual comparision perfomed by `comparator` parameter.
  Parameters:
    `leftMap` - Map applied to the left image during comparision.
    `rightMap` - Map applied to the right image during comparision.
    `subComparator` - comporator to perform a comparision of to images with mapped colors.

Method Detail

### compare

    public boolean compare(java.awt.image.BufferedImage image1,
                           java.awt.image.BufferedImage image2)

  Compares images by `ImageComparator` passed into constructor, or itself if no `ImageComparator` was passed, processing both images by `ColorMap` instance before comparision.
  Overrides:
    `compare` in class `StrictImageComparator`
  Following copied from class: `org.netbeans.jemmy.image.StrictImageComparator`
  Parameters:
    `image1` - an image to compare.
    `image2` - an image to compare.
  Returns:
    True if all the pixels match, false otherwise.

### compareColors

    protected final boolean compareColors(int rgb1,
                                          int rgb2)

  Description copied from class: `StrictImageComparator`
  Could be used to override the way of comparing colors.
  Overrides:
    `compareColors` in class `StrictImageComparator`
  Following copied from class: `org.netbeans.jemmy.image.StrictImageComparator`
  Parameters:
    `rgb1` - a color to compare.
    `rgb2` - a color to compare.
  Returns:
    true if colors are equal.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD