The Image API of QF-Test makes use of a technology independent
class for image representation ImageRep
and it
offers an interface to implement an own image compare algorithm.
The class
de.qfs.apps.qftest.shared.extensions.image.ImageRep
is
the wrapper class for technology independent images.
The class holds the image representation either as ARGB data,
which is an int array or as RGB data, which is a byte array.
Besides the image data, you can also specify a name, the width
and the height for the ImageRep
object.
The ImageRep
class also contains an equals
method for
comparisons. If you want to implement your own image comparison algorithm, you
have to implement your own ImageComparator
. This implementation
has to be registered at the ImageRep
object. See subsection 52.10.2 for further information.
|
| | ImageRep ImageRep() | |
|
| ImageRep ImageRep(String name, byte[] rgb, boolean png, int width, int height) | |
Parameters | name |
The name of the ImageRep object.
| rgb |
A byte array containing RGB data of the image.
| png |
Whether the image is already png encoded.
| width |
The width of the image.
| height |
The height of the image.
| |
| ImageRep ImageRep(String name, int[] argb, boolean png, int width, int height) | |
Parameters | name |
The name of the ImageRep object.
| argb |
An int array containing the ARGB data of the image.
| png |
Whether the image is already png encoded.
| width |
The width of the image.
| height |
The height of the image.
| |
| void crop(int x, int y, int width, int height) | |
Parameters | x |
The X coordinate of the left upper corner of the sub-region.
| y |
The Y coordinate of the left upper corner of the sub-region.
| width |
The width of the sub-region.
| height |
The height of the sub-region.
| |
| boolean equals(ImageRep compare) | |
Parameters | compare |
The ImageRep object to compare with.
| Returns | True, if images are equal, otherwise false. | | int[] getARGB() | |
Returns | The current ARGB data. | | ImageComparator getComparator() | |
Returns | The current ImageComparator implementation. | | int getHeight() | |
Returns | The current height. | | String getName() | |
Returns | The current name. | | int getPixel(int x, int y) | |
Parameters | x |
The X coordinate of the pixel.
| y |
The Y coordinate of the pixel.
| Returns | The pixel value. | | byte[] getPng() | |
Returns | The current RGB data. | | int getWidth() | |
Returns | The current width. | | void setARGB(int[] argb) | |
Parameters | argb |
The new ARGB data.
| |
| void setComparator(ImageComparator comparator) | |
Parameters | comparator |
The new ImageComparator implementation.
| |
| void setHeight(int height) | |
Parameters | height |
The new height.
| |
| void setName(String name) | |
Parameters | name |
The new name.
| |
| void setPng(byte[] png) | |
Parameters | png |
The new RGB data.
| |
| void setWidth(int width) | |
Parameters | width |
The new width.
| |
|
|
|
The interface
de.qfs.apps.qftest.shared.extensions.image.ImageComparator
has to be implemented, if you want to implement your own image comparison
algorithm.
The implementation has then to be registered at the used ImageRep
objects using the setComparator
method.
|
| | boolean equals(ImageRep actual, ImageRep expected) | |
Parameters | actual |
The actual ImageRep object.
| expected |
The expected ImageRep object.
| Returns | True, if images are equal, otherwise false. | |
|
|