public class NW7Reader
extends java.lang.Object
修飾子とタイプ | フィールドと説明 |
---|---|
static java.lang.String |
VERSION |
コンストラクタと説明 |
---|
NW7Reader(processing.core.PApplet applet)
コンストラクタ
クラスを初期化し、バーコードの読み取り準備を行います。 |
修飾子とタイプ | メソッドと説明 |
---|---|
java.lang.String |
decode(processing.core.PImage pImage)
バーコード読み取り
指定された画像からバーコードを読み取ります。 |
java.lang.String |
decode(processing.core.PImage pImage,
boolean globalHistogram,
boolean... doRotate)
バーコード読み取り
指定された画像からバーコードを読み取ります。 |
processing.core.PVector[] |
getPoints()
頂点座標取得
バーコード解析結果を使い、頂点座標を取得します。 |
com.google.zxing.Result |
getResult()
解析結果取得
バーコード解析結果を取得します。 |
static java.lang.String |
getVersion()
バージョン取得
本ライブラリのバーションを取得します。 |
public static final java.lang.String VERSION
public NW7Reader(processing.core.PApplet applet)
applet
- PROCESSINGアプレット
import ZxingP5.*;
NW7Reader nwReader; //NW7-Code Reader
void setup(){
size(400,400);
//インスタンス作成
nwReader = new NW7Reader(this);
}
void draw(){
background(255);
}
public java.lang.String decode(processing.core.PImage pImage, boolean globalHistogram, boolean... doRotate)
pImage
- NW7が描画された画像globalHistogram
- ヒストグラム指定 True:ローエンド用ヒストグラム False:汎用ヒストグラムdoRotate
- 回転指示 True 回転して読み取る
import ZxingP5.*;
NW7Reader nwReader; //NW7-Code Reader
PImage pImage; //画像
void setup(){
size(400,400);
pImage = loadImage("nw7Sample.png");
//インスタンス作成
nwReader = new NW7Reader();
//画像解析
String text = nwReader.decode( pImage, true );
if( text != null ){
println( text );
}
}
void draw(){
background(255);
image( pImage, 0, 0 );
}
public java.lang.String decode(processing.core.PImage pImage)
pImage
- NW7が描画された画像
import ZxingP5.*;
NW7Reader nwReader; //NW7-Code Reader
PImage pImage; //画像
void setup(){
size(400,400);
pImage = loadImage("nw7Sample.png");
//インスタンス作成
nwReader = new NW7Reader();
//画像解析
String text = nwReader.decode( pImage );
if( text != null ){
println( text );
}
}
void draw(){
background(255);
image( pImage, 0, 0 );
}
public processing.core.PVector[] getPoints()
import ZxingP5.*;
NW7Reader nwReader; //NW7-Code Reader
PImage pImage; //画像
PVector[] points; //頂点座標
void setup(){
size(400,400);
pImage = loadImage("nw7Sample.png");
//インスタンス作成
nwReader = new NW7Reader();
//画像解析
nwReader.decode( pImage );
//頂点座標取得
points = nwReader.getPoints();
}
void draw(){
background(255);
image( pImage, 0, 0 );
//シンボル座標に赤い○を描く
fill(color(255,0,0));
if( points != null ){
for( PVector p : points ){
ellipse( p.x, p.y, 10, 10 );
}
}
}
public com.google.zxing.Result getResult()
import ZxingP5.*;
NW7Reader nwReader; //NW7-Code Reader
PImage pImage; //画像
Result result; //解析結果
void setup(){
size(400,400);
nwReader = new NW7Reader();
pImage = loadImage("nw7Sample.png");
//画像解析
nwReader.decode( pImage );
//解析結果取得
result = nwReader.getResult();
if( result != null ){
//読み取り文字表示
println( result.getText() );
}
}
void draw(){
background(255);
image( pImage,0,0);
}
public static java.lang.String getVersion()
import ZxingP5.*;
void setup(){
size(400,400);
println( NW7Reader.getVersion() );
}
void draw(){
background(255);
}