修飾子とタイプ | フィールドと説明 |
---|---|
static java.lang.String |
VERSION |
コンストラクタと説明 |
---|
ITFP5Reader(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()
解析結果取得
バーコード解析結果を取得します。 |
int |
getRotateDegree()
回転角度取得
decodeで回転読み取りを指定された場合、何度回転するかを取得します。 |
static java.lang.String |
getVersion()
バージョン取得
本ライブラリのバーションを取得します。 |
void |
setRotateDegree(int degree)
回転角度指定
decodeで回転読み取りを指定された場合、何度回転するかを指定します。 |
public static final java.lang.String VERSION
public ITFP5Reader(processing.core.PApplet applet)
applet
- PROCESSINGアプレット
import ZxingP5.*;
ITFP5Reader itfReader; //ITF-Code Reader
void setup(){
size(400,400);
//インスタンス作成
itfReader = new ITFP5Reader(this);
}
void draw(){
background(255);
}
public void setRotateDegree(int degree)
degree
- 回転角度(1 から 180)public int getRotateDegree()
public java.lang.String decode(processing.core.PImage pImage, boolean globalHistogram, boolean... doRotate)
pImage
- ITFが描画された画像globalHistogram
- ヒストグラム指定 True:ローエンド用ヒストグラム False:汎用ヒストグラムdoRotate
- 回転指示 True 回転して読み取る
import ZxingP5.*;
ITFP5Reader itfReader; //ITF-Code Reader
PImage pImage; //画像
void setup(){
size(400,400);
pImage = loadImage("itf7Sample.png");
//インスタンス作成
itfReader = new ITFP5Reader();
//画像解析
String text = itfReader.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
- ITFが描画された画像
import ZxingP5.*;
ITFP5Reader itfReader; //ITF-Code Reader
PImage pImage; //画像
void setup(){
size(400,400);
pImage = loadImage("itf7Sample.png");
//インスタンス作成
itfReader = new ITFP5Reader();
//画像解析
String text = itfReader.decode( pImage );
if( text != null ){
println( text );
}
}
void draw(){
background(255);
image( pImage, 0, 0 );
}
public processing.core.PVector[] getPoints()
import ZxingP5.*;
ITFP5Reader itfReader; //ITF-Code Reader
PImage pImage; //画像
PVector[] points; //頂点座標
void setup(){
size(400,400);
pImage = loadImage("itfSample.png");
//インスタンス作成
itfReader = new ITFP5Reader();
//画像解析
itfReader.decode( pImage );
//頂点座標取得
points = itfReader.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.*;
ITFP5Reader itfReader; //ITF-Code Reader
PImage pImage; //画像
PVector[] points; //頂点座標
void setup(){
size(400,400);
pImage = loadImage("itfSample.png");
//インスタンス作成
itfReader = new ITFP5Reader();
//画像解析
itfReader.decode( pImage );
//解析結果取得
result = itfReader.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( ITFP5Reader.getVersion() );
}
void draw(){
background(255);
}