com.google.zxing.common
Class DefaultGridSampler
java.lang.Object
com.google.zxing.common.GridSampler
com.google.zxing.common.DefaultGridSampler
public final class DefaultGridSampler
- extends GridSampler
- Since:
- BlackBerry API 6.0.0
|
Method Summary |
BitMatrix |
sampleGrid(BitMatrix image,
int dimension,
float p1ToX,
float p1ToY,
float p2ToX,
float p2ToY,
float p3ToX,
float p3ToY,
float p4ToX,
float p4ToY,
float p1FromX,
float p1FromY,
float p2FromX,
float p2FromY,
float p3FromX,
float p3FromY,
float p4FromX,
float p4FromY)
Samples an image for a square matrix of bits of the given dimension. |
DefaultGridSampler
public DefaultGridSampler()
- Since:
- BlackBerry API 6.0.0
sampleGrid
public BitMatrix sampleGrid(BitMatrix image,
int dimension,
float p1ToX,
float p1ToY,
float p2ToX,
float p2ToY,
float p3ToX,
float p3ToY,
float p4ToX,
float p4ToY,
float p1FromX,
float p1FromY,
float p2FromX,
float p2FromY,
float p3FromX,
float p3FromY,
float p4FromX,
float p4FromY)
throws ReaderException
- Description copied from class:
GridSampler
Samples an image for a square matrix of bits of the given dimension. This is used to extract
the black/white modules of a 2D barcode like a QR Code found in an image. Because this barcode
may be rotated or perspective-distorted, the caller supplies four points in the source image
that define known points in the barcode, so that the image may be sampled appropriately.
The last eight "from" parameters are four X/Y coordinate pairs of locations of points in
the image that define some significant points in the image to be sample. For example,
these may be the location of finder pattern in a QR Code.
The first eight "to" parameters are four X/Y coordinate pairs measured in the destination
BitMatrix, from the top left, where the known points in the image given by the "from"
parameters map to.
These 16 parameters define the transformation needed to sample the image.
- Specified by:
sampleGrid in class GridSampler
- Parameters:
image - image to sampledimension - width/height of BitMatrix to sample from image
- Returns:
BitMatrix representing a grid of points sampled from the image within a region
defined by the "from" parameters
- Throws:
ReaderException - if image can't be sampled, for example, if the transformation defined
by the given points is invalid or results in sampling outside the image boundaries- Since:
- BlackBerry API 6.0.0
Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.