本文整理汇总了Java中com.google.zxing.common.GridSampler类的典型用法代码示例。如果您正苦于以下问题:Java GridSampler类的具体用法?Java GridSampler怎么用?Java GridSampler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GridSampler类属于com.google.zxing.common包,在下文中一共展示了GridSampler类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sampleGrid
import com.google.zxing.common.GridSampler; //导入依赖的package包/类
/**
* Creates a BitMatrix by sampling the provided image.
* topLeft, topRight, bottomRight, and bottomLeft are the centers of the squares on the
* diagonal just outside the bull's eye.
*/
private BitMatrix sampleGrid(BitMatrix image,
ResultPoint topLeft,
ResultPoint topRight,
ResultPoint bottomRight,
ResultPoint bottomLeft) throws NotFoundException {
GridSampler sampler = GridSampler.getInstance();
int dimension = getDimension();
float low = dimension / 2.0f - nbCenterLayers;
float high = dimension / 2.0f + nbCenterLayers;
return sampler.sampleGrid(image,
dimension,
dimension,
low, low, // topleft
high, low, // topright
high, high, // bottomright
low, high, // bottomleft
topLeft.getX(), topLeft.getY(),
topRight.getX(), topRight.getY(),
bottomRight.getX(), bottomRight.getY(),
bottomLeft.getX(), bottomLeft.getY());
}
示例2: sampleGrid
import com.google.zxing.common.GridSampler; //导入依赖的package包/类
/**
* Creates a BitMatrix by sampling the provided image.
* topLeft, topRight, bottomRight, and bottomLeft are the centers of the squares on the
* diagonal just outside the bull's eye.
*/
private BitMatrix sampleGrid(BitMatrix image,
ResultPoint topLeft,
ResultPoint topRight,
ResultPoint bottomRight,
ResultPoint bottomLeft) throws NotFoundException {
GridSampler sampler = GridSampler.getInstance();
int dimension = getDimension();
float low = dimension / 2.0f - nbCenterLayers;
float high = dimension / 2.0f + nbCenterLayers;
return sampler.sampleGrid(image,
dimension,
dimension,
low, low, // topleft
high, low, // topright
high, high, // bottomright
low, high, // bottomleft
topLeft.getX(), topLeft.getY(),
topRight.getX(), topRight.getY(),
bottomRight.getX(), bottomRight.getY(),
bottomLeft.getX(), bottomLeft.getY());
}
示例3: sampleGrid
import com.google.zxing.common.GridSampler; //导入依赖的package包/类
private static BitMatrix sampleGrid(BitMatrix image,
PerspectiveTransform transform,
int dimension) throws NotFoundException {
GridSampler sampler = GridSampler.getInstance();
return sampler.sampleGrid(image, dimension, dimension, transform);
}
示例4: sampleGrid
import com.google.zxing.common.GridSampler; //导入依赖的package包/类
private static BitMatrix sampleGrid(BitMatrix image,
ResultPoint topLeft,
ResultPoint bottomLeft,
ResultPoint bottomRight,
ResultPoint topRight,
int dimensionX,
int dimensionY) throws NotFoundException {
GridSampler sampler = GridSampler.getInstance();
return sampler.sampleGrid(image,
dimensionX,
dimensionY,
0.5f,
0.5f,
dimensionX - 0.5f,
0.5f,
dimensionX - 0.5f,
dimensionY - 0.5f,
0.5f,
dimensionY - 0.5f,
topLeft.getX(),
topLeft.getY(),
topRight.getX(),
topRight.getY(),
bottomRight.getX(),
bottomRight.getY(),
bottomLeft.getX(),
bottomLeft.getY());
}
示例5: sampleGrid
import com.google.zxing.common.GridSampler; //导入依赖的package包/类
private BitMatrix sampleGrid(BitMatrix image, ResultPoint topLeft, ResultPoint topRight,
ResultPoint bottomRight, ResultPoint bottomLeft) throws
NotFoundException {
GridSampler sampler = GridSampler.getInstance();
int dimension = getDimension();
float low = (((float) dimension) / 2.0f) - ((float) this.nbCenterLayers);
float high = (((float) dimension) / 2.0f) + ((float) this.nbCenterLayers);
return sampler.sampleGrid(image, dimension, dimension, low, low, high, low, high, high,
low, high, topLeft.getX(), topLeft.getY(), topRight.getX(), topRight.getY(),
bottomRight.getX(), bottomRight.getY(), bottomLeft.getX(), bottomLeft.getY());
}
示例6: sampleGrid
import com.google.zxing.common.GridSampler; //导入依赖的package包/类
private static BitMatrix sampleGrid(BitMatrix image, ResultPoint topLeft, ResultPoint
bottomLeft, ResultPoint bottomRight, ResultPoint topRight, int dimensionX, int
dimensionY) throws NotFoundException {
return GridSampler.getInstance().sampleGrid(image, dimensionX, dimensionY, 0.5f, 0.5f, (
(float) dimensionX) - 0.5f, 0.5f, ((float) dimensionX) - 0.5f, ((float)
dimensionY) - 0.5f, 0.5f, ((float) dimensionY) - 0.5f, topLeft.getX(), topLeft
.getY(), topRight.getX(), topRight.getY(), bottomRight.getX(), bottomRight.getY()
, bottomLeft.getX(), bottomLeft.getY());
}
示例7: sampleGrid
import com.google.zxing.common.GridSampler; //导入依赖的package包/类
private static BitMatrix sampleGrid(BitMatrix matrix,
ResultPoint topLeft,
ResultPoint bottomLeft,
ResultPoint topRight,
ResultPoint bottomRight,
int xdimension,
int ydimension) throws NotFoundException {
// Note that unlike the QR Code sampler, we didn't find the center of modules, but the
// very corners. So there is no 0.5f here; 0.0f is right.
GridSampler sampler = GridSampler.getInstance();
return sampler.sampleGrid(
matrix,
xdimension, ydimension,
0.0f, // p1ToX
0.0f, // p1ToY
xdimension, // p2ToX
0.0f, // p2ToY
xdimension, // p3ToX
ydimension, // p3ToY
0.0f, // p4ToX
ydimension, // p4ToY
topLeft.getX(), // p1FromX
topLeft.getY(), // p1FromY
topRight.getX(), // p2FromX
topRight.getY(), // p2FromY
bottomRight.getX(), // p3FromX
bottomRight.getY(), // p3FromY
bottomLeft.getX(), // p4FromX
bottomLeft.getY()); // p4FromY
}