import jp.nyatla.nyartoolkit.core.param.NyARParam;
import jp.nyatla.nyartoolkit.core.raster.NyARBinRaster;
import jp.nyatla.nyartoolkit.core.rasterfilter.rgb2bin.NyARRasterFilter_ARToolkitThreshold;
-import jp.nyatla.nyartoolkit.core.squaredetect.INyARSquareContourDetector;
+import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquareContourDetector;
import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquareContourDetector_Rle;
/**
/**
* detectMarkerのコールバック関数
*/
- private class DetectSquareCB implements INyARSquareContourDetector.DetectMarkerCallback
+ private class DetectSquareCB implements NyARSquareContourDetector.DetectMarkerCallback
{
public DetectSquareCB()
{
* 矩形が見付かるたびに呼び出されます。
* 発見した矩形のパターンを検査して、方位を考慮した頂点データを確保します。
*/
- public void onSquareDetect(INyARSquareContourDetector i_sender,int[] i_coordx,int[] i_coordy,int i_coor_num,int[] i_vertex_index) throws NyARException
+ public void onSquareDetect(NyARSquareContourDetector i_sender,int[] i_coordx,int[] i_coordy,int i_coor_num,int[] i_vertex_index) throws NyARException
{
}
}
} \r
public void analyzeRaster(INyARRaster i_input) throws NyARException\r
{\r
- assert (i_input.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_BIN_8));\r
+ assert (i_input.isEqualBufferType(NyARBufferType.INT1D_BIN_8));\r
\r
// 結果をクリア\r
this._result.clear();\r
\r
public int analyzeRaster(INyARRaster i_input) throws NyARException\r
{\r
- assert (i_input.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
+ assert (i_input.isEqualBufferType(NyARBufferType.INT1D_GRAY_8));\r
int[] histogram = new int[256];\r
return createHistogram((int[])i_input.getBuffer(),i_input.getSize(), histogram);\r
}\r
*/\r
public void debugDrawHistogramMap(INyARRaster i_input, INyARRaster i_output) throws NyARException\r
{\r
- assert (i_input.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
- assert (i_output.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
+ assert (i_input.isEqualBufferType(NyARBufferType.INT1D_GRAY_8));\r
+ assert (i_output.isEqualBufferType(NyARBufferType.INT1D_GRAY_8));\r
NyARIntSize size = i_output.getSize();\r
\r
int[] out_buf = (int[]) i_output.getBuffer();\r
{\r
public void doFilter(INyARRaster i_input, INyARRaster i_output) throws NyARException\r
{\r
- assert (i_input.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
- assert (i_output.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
+ assert (i_input.isEqualBufferType(NyARBufferType.INT1D_GRAY_8));\r
+ assert (i_output.isEqualBufferType(NyARBufferType.INT1D_GRAY_8));\r
assert (i_input.getSize().isEqualSize(i_output.getSize()) == true);\r
\r
int[] out_buf = (int[]) i_output.getBuffer();\r
package jp.nyatla.nyartoolkit.core.rasterfilter;\r
\r
import jp.nyatla.nyartoolkit.NyARException;\r
-import jp.nyatla.nyartoolkit.core.raster.INyARRaster;\r
+import jp.nyatla.nyartoolkit.core.raster.*;\r
import jp.nyatla.nyartoolkit.core.types.NyARIntSize;\r
\r
/**\r
public NyARRasterOperator_Mul(int i_raster_type) throws NyARException\r
{\r
switch (i_raster_type) {\r
- case INyARRaster.BUFFERFORMAT_INT1D_GRAY_8:\r
+ case NyARBufferType.INT1D_GRAY_8:\r
this._dofilterimpl=new IdoFilterImpl_INT1D_GRAY_8();\r
break;\r
default:\r
{\r
public void doFilter(INyARRaster i_input_a,INyARRaster i_input_b,INyARRaster i_output,NyARIntSize i_size) throws NyARException\r
{\r
- assert(i_input_a.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
- assert(i_input_b.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
- assert(i_output.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
+ assert(i_input_a.isEqualBufferType(NyARBufferType.INT1D_GRAY_8));\r
+ assert(i_input_b.isEqualBufferType(NyARBufferType.INT1D_GRAY_8));\r
+ assert(i_output.isEqualBufferType(NyARBufferType.INT1D_GRAY_8));\r
\r
int[] out_buf = (int[]) i_output.getBuffer();\r
int[] in_buf1 = (int[]) i_input_a.getBuffer();\r
public NyARRasterFilter_Rgb2Gs_CbCrCut(int i_raster_type,double i_sigma) throws NyARException\r
{\r
switch (i_raster_type) {\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8_24:\r
+ case NyARBufferType.BYTE1D_B8G8R8_24:\r
this._dofilterimpl=new IdoFilterImpl_BYTE1D_B8G8R8_24();\r
break;\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_R8G8B8_24:\r
+ case NyARBufferType.BYTE1D_R8G8B8_24:\r
default:\r
throw new NyARException();\r
}\r
{\r
public void doFilter(INyARRaster i_input, INyARRaster i_output,NyARIntSize i_size) throws NyARException\r
{\r
- assert( i_input.isEqualBufferType(INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8_24));\r
- assert( i_output.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
+ assert( i_input.isEqualBufferType(NyARBufferType.BYTE1D_B8G8R8_24));\r
+ assert( i_output.isEqualBufferType(NyARBufferType.INT1D_GRAY_8));\r
\r
int[] out_buf = (int[]) i_output.getBuffer();\r
byte[] in_buf = (byte[]) i_input.getBuffer();\r
public void doFilter(INyARRgbRaster i_input, NyARGrayscaleRaster i_output) throws NyARException\r
{\r
\r
- assert( i_output.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
+ assert( i_output.isEqualBufferType(NyARBufferType.INT1D_GRAY_8));\r
assert (i_input.getSize().isEqualSize(i_output.getSize()) == true);\r
\r
final int[] out_buf = (int[]) i_output.getBuffer();\r
\r
NyARIntSize size = i_output.getSize();\r
switch (i_input.getBufferType()) {\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8_24:\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_R8G8B8_24:\r
+ case NyARBufferType.BYTE1D_B8G8R8_24:\r
+ case NyARBufferType.BYTE1D_R8G8B8_24:\r
convert24BitRgb(in_buf, out_buf, size);\r
break;\r
default:\r
import jp.nyatla.nyartoolkit.core.param.NyARCameraDistortionFactor;\r
import jp.nyatla.nyartoolkit.core.raster.NyARBinRaster;\r
import jp.nyatla.nyartoolkit.core.squaredetect.ContourPickup;\r
-import jp.nyatla.nyartoolkit.core.squaredetect.INyARSquareContourDetector;\r
+import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquareContourDetector;\r
import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquare;\r
import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquareStack;\r
import jp.nyatla.nyartoolkit.core.squaredetect.Coord2Linear;\r
import jp.nyatla.nyartoolkit.core.types.*;\r
\r
-public class NyARQrCodeDetector implements INyARSquareContourDetector\r
+public class NyARQrCodeDetector extends NyARSquareContourDetector\r
{\r
private NyARQrCodeSymbolBinder _binder;\r
\r
import jp.nyatla.nyartoolkit.core.rasterfilter.rgb2gs.*;\r
import jp.nyatla.nyartoolkit.core.rasterfilter.gs2bin.*;\r
import jp.nyatla.nyartoolkit.core.raster.*;\r
-import jp.nyatla.nyartoolkit.core.squaredetect.INyARSquareContourDetector;\r
+import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquareContourDetector;\r
import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquare;\r
import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquareStack;\r
import jp.nyatla.nyartoolkit.core.transmat.*;\r
private static final int AR_SQUARE_MAX = 100;\r
\r
private boolean _is_continue = false;\r
- private INyARSquareContourDetector _square_detect;\r
+ private NyARSquareContourDetector _square_detect;\r
\r
private final NyARSquareStack _square_list = new NyARSquareStack(AR_SQUARE_MAX);\r
\r
int in_buf_type=i_input.getBufferType();\r
\r
NyARIntSize size = i_output.getSize();\r
- assert (i_output.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_BIN_8));\r
+ assert (i_output.isEqualBufferType(NyARBufferType.INT1D_BIN_8));\r
assert (checkInputType(in_buf_type)==true); \r
assert (i_input.getSize().isEqualSize(size.w*2,size.h*2) == true);\r
\r
byte[] in_buf = (byte[]) i_input.getBuffer();\r
\r
switch (i_input.getBufferType()) {\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8_24:\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_R8G8B8_24:\r
+ case NyARBufferType.BYTE1D_B8G8R8_24:\r
+ case NyARBufferType.BYTE1D_R8G8B8_24:\r
convert24BitRgb(in_buf, out_buf, size);\r
break;\r
// case INyARBufferReader.BUFFERFORMAT_BYTE1D_B8G8R8X8_32:\r
private boolean checkInputType(int i_input_type) throws NyARException\r
{\r
switch(i_input_type){\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8_24:\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_R8G8B8_24:\r
-// case INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8X8_32:\r
-// case INyARRaster.BUFFERFORMAT_BYTE1D_R5G6B5_16LE:\r
+ case NyARBufferType.BYTE1D_B8G8R8_24:\r
+ case NyARBufferType.BYTE1D_R8G8B8_24:\r
+// case NyARBufferType.BYTE1D_B8G8R8X8_32:\r
+// case NyARBufferType.BYTE1D_R5G6B5_16LE:\r
return true;\r
default:\r
return false;\r
import jp.nyatla.nyartoolkit.core.pickup.*;\r
import jp.nyatla.nyartoolkit.core.raster.rgb.*;\r
import jp.nyatla.nyartoolkit.core.raster.*;\r
-import jp.nyatla.nyartoolkit.core.squaredetect.INyARSquareContourDetector;\r
+import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquareContourDetector;\r
import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquare;\r
import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquareStack;\r
import jp.nyatla.nyartoolkit.core.transmat.*;\r
\r
private boolean _is_continue = false;\r
private NyARMatchPatt_Color_WITHOUT_PCA _match_patt;\r
- private INyARSquareContourDetector _square_detect;\r
+ private NyARSquareContourDetector _square_detect;\r
\r
private final NyARSquareStack _square_list = new NyARSquareStack(AR_SQUARE_MAX);\r
\r
import jp.nyatla.nyartoolkit.core.labeling.artoolkit.*;\r
import jp.nyatla.nyartoolkit.core.raster.*;\r
import jp.nyatla.nyartoolkit.core.squaredetect.ContourPickup;\r
-import jp.nyatla.nyartoolkit.core.squaredetect.INyARSquareContourDetector;\r
+import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquareContourDetector;\r
import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquare;\r
import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquareStack;\r
import jp.nyatla.nyartoolkit.core.squaredetect.Coord2Linear;\r
* 1/4に解像度を落して解析するNyARSquareDetector_X2\r
* 与えるBinRasterが既に1/4のサイズになっていないといけないことに注意\r
*/\r
-public class NyARSquareDetector_Quad implements INyARSquareContourDetector\r
+public class NyARSquareDetector_Quad extends NyARSquareContourDetector\r
{\r
private static int AR_AREA_MAX = 25000;// #define AR_AREA_MAX 100000\r
\r
* PCAではなく、頂点座標そのものからSquare位置を計算するクラス\r
*\r
*/\r
-public class NyARVertexDetector implements INyARSquareContourDetector\r
+public class NyARVertexDetector extends NyARSquareContourDetector\r
{\r
private static final int AR_AREA_MAX = 100000;// #define AR_AREA_MAX 100000\r
\r
import jp.nyatla.nyartoolkit.core.types.NyARIntSize;\r
import jp.nyatla.nyartoolkit.core.rasterfilter.gs2bin.*;\r
import jp.nyatla.nyartoolkit.core.rasterfilter.rgb2bin.NyARRasterFilter_ARToolkitThreshold;\r
-import jp.nyatla.nyartoolkit.core.squaredetect.INyARSquareContourDetector;\r
+import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquareContourDetector;\r
import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquare;\r
import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquareStack;\r
\r
\r
private boolean _is_continue = false;\r
private NyARMatchPatt_Color_WITHOUT_PCA _match_patt;\r
- private INyARSquareContourDetector _square_detect;\r
+ private NyARSquareContourDetector _square_detect;\r
\r
private final NyARSquareStack _square_list = new NyARSquareStack(AR_SQUARE_MAX);\r
\r
* このクラスは、arDetectMarker2.cとの置き換えになります。\r
* \r
*/\r
-public class NyARSquareDetector_X2 implements INyARSquareContourDetector\r
+public class NyARSquareDetector_X2 extends NyARSquareContourDetector\r
{\r
private final int _width;\r
private final int _height;\r
\r
private int _lost_delay = 5;\r
\r
- private INyARSquareContourDetector _square_detect;\r
+ private NyARSquareContourDetector _square_detect;\r
\r
//<X2 patch>\r
protected NyARTransMat_X2 _transmat;\r
protected boolean _is_attached_buffer;\r
public NyARRGBRaster_BufferedImage(int i_width, int i_height,boolean i_is_alloc) throws NyARException\r
{\r
- super( new NyARIntSize(i_width,i_height),INyARRaster.BUFFERFORMAT_OBJECT_Java_BufferedImage);\r
+ super( new NyARIntSize(i_width,i_height),NyARBufferType.OBJECT_Java_BufferedImage);\r
if(!initInstance(this._size,i_is_alloc)){\r
throw new NyARException();\r
}\r
}\r
public NyARRGBRaster_BufferedImage(int i_width, int i_height) throws NyARException\r
{\r
- super( new NyARIntSize(i_width,i_height),INyARRaster.BUFFERFORMAT_OBJECT_Java_BufferedImage);\r
+ super( new NyARIntSize(i_width,i_height),NyARBufferType.OBJECT_Java_BufferedImage);\r
if(!initInstance(this._size,true)){\r
throw new NyARException();\r
}\r
{\r
super(i_cparam.getScreenSize(),i_format);\r
//bufferdimageの種類を決める\r
- if(this.getBufferType()!=INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8_24){\r
+ if(this.getBufferType()!=NyARBufferType.BYTE1D_B8G8R8_24){\r
throw new NyARException();\r
}\r
//RGBのラスタを作る。\r
int r=fm.getRedMask();\r
int b=fm.getBlueMask();\r
if(r==1 && b==3){\r
- this.buffer_type=INyARRaster.BUFFERFORMAT_BYTE1D_R8G8B8_24;\r
+ this.buffer_type=NyARBufferType.BYTE1D_R8G8B8_24;\r
}else if(r==3 && b==1){\r
- this.buffer_type=INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8_24; \r
+ this.buffer_type=NyARBufferType.BYTE1D_B8G8R8_24; \r
}else{\r
throw new NyARException();\r
}\r
int bp = (i_x + i_y * this._ref_size.w) * 3;\r
byte[] ref = this.buffer;\r
switch(this.buffer_type){\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_R8G8B8_24:\r
+ case NyARBufferType.BYTE1D_R8G8B8_24:\r
o_rgb[0] = (ref[bp + 0] & 0xff);// R\r
o_rgb[1] = (ref[bp + 1] & 0xff);// G\r
o_rgb[2] = (ref[bp + 2] & 0xff);// B\r
break;\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8_24:\r
+ case NyARBufferType.BYTE1D_B8G8R8_24:\r
o_rgb[0] = (ref[bp + 2] & 0xff);// B\r
o_rgb[1] = (ref[bp + 1] & 0xff);// G\r
o_rgb[2] = (ref[bp + 0] & 0xff);// R\r
byte[] ref = this.buffer;\r
int bp;\r
switch(this.buffer_type){\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_R8G8B8_24:\r
+ case NyARBufferType.BYTE1D_R8G8B8_24:\r
for (int i = i_num - 1; i >= 0; i--) {\r
bp = (i_x[i] + i_y[i] * width) * 3;\r
o_rgb[i * 3 + 0] = (ref[bp + 0] & 0xff);// R\r
o_rgb[i * 3 + 2] = (ref[bp + 2] & 0xff);// B\r
}\r
break;\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8_24:\r
+ case NyARBufferType.BYTE1D_B8G8R8_24:\r
for (int i = i_num - 1; i >= 0; i--) {\r
bp = (i_x[i] + i_y[i] * width) * 3;\r
o_rgb[i * 3 + 0] = (ref[bp + 2] & 0xff);// B\r
public NyARGLPixelReader_YUV(NyARIntSize i_ref_size,YUVFormat i_input_format) throws NyARException\r
{\r
this._ref_size=i_ref_size;\r
- this.buffer_type=INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8_24;\r
+ this.buffer_type=NyARBufferType.BYTE1D_B8G8R8_24;\r
this.buffer=null;\r
this._yuv2rgb=new YUVToRGB();\r
this._rgb_buf=new javax.media.Buffer();\r
private void initMember(int i_buffer_type) throws NyARException\r
{\r
switch(i_buffer_type){\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8_24:\r
+ case NyARBufferType.BYTE1D_B8G8R8_24:\r
this._gl_flag = GL.GL_BGR;\r
break;\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_R8G8B8_24:\r
+ case NyARBufferType.BYTE1D_R8G8B8_24:\r
this._gl_flag = GL.GL_RGB;\r
break;\r
default:\r
{\r
this._size=new NyARIntSize(i_width,i_height);\r
this._buffer= null;\r
- this._buffer_type=INyARRaster.BUFFERFORMAT_BYTE1D_R8G8B8_24;\r
+ this._buffer_type=NyARBufferType.BYTE1D_R8G8B8_24;\r
this._reader = new NyARRgbPixelReader_BYTE1D_R8G8B8_24(null,this._size);\r
}\r
\r
StreamTokenizer st = new StreamTokenizer(new InputStreamReader(i_stream));\r
//GBRAで一度読みだす。\r
for (int h = 0; h < 4; h++) {\r
- assert o_raster[h].isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_X8R8G8B8_32);\r
+ assert o_raster[h].isEqualBufferType(NyARBufferType.INT1D_X8R8G8B8_32);\r
final NyARRaster ra=o_raster[h];\r
readBlock(st,ra.getWidth(),ra.getHeight(),(int[])ra.getBuffer());\r
}\r
{\r
int width=o_code.getWidth();\r
int height=o_code.getHeight();\r
- NyARRaster tmp_raster=new NyARRaster(width,height,INyARRaster.BUFFERFORMAT_INT1D_X8R8G8B8_32);\r
+ NyARRaster tmp_raster=new NyARRaster(width,height, NyARBufferType.INT1D_X8R8G8B8_32);\r
//4個の要素をラスタにセットする。\r
try {\r
StreamTokenizer st = new StreamTokenizer(new InputStreamReader(i_stream));\r
protected boolean initInstance(int i_raster_format,int i_vertical_interval)\r
{\r
switch (i_raster_format) {\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8_24:\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_R8G8B8_24:\r
+ case NyARBufferType.BYTE1D_B8G8R8_24:\r
+ case NyARBufferType.BYTE1D_R8G8B8_24:\r
this._histImpl = new NyARRasterThresholdAnalyzer_Histogram_BYTE1D_RGB_24();\r
break;\r
- case INyARRaster.BUFFERFORMAT_INT1D_GRAY_8:\r
+ case NyARBufferType.INT1D_GRAY_8:\r
this._histImpl = new NyARRasterThresholdAnalyzer_Histogram_INT1D_GRAY_8();\r
break;\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8X8_32:\r
+ case NyARBufferType.BYTE1D_B8G8R8X8_32:\r
this._histImpl = new NyARRasterThresholdAnalyzer_Histogram_BYTE1D_B8G8R8X8_32();\r
break;\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_X8R8G8B8_32:\r
+ case NyARBufferType.BYTE1D_X8R8G8B8_32:\r
this._histImpl = new NyARRasterThresholdAnalyzer_Histogram_BYTE1D_X8R8G8B8_32();\r
break;\r
- case INyARRaster.BUFFERFORMAT_WORD1D_R5G6B5_16LE:\r
+ case NyARBufferType.WORD1D_R5G6B5_16LE:\r
this._histImpl = new NyARRasterThresholdAnalyzer_Histogram_WORD1D_R5G6B5_16LE();\r
break;\r
- case INyARRaster.BUFFERFORMAT_INT1D_X8R8G8B8_32:\r
+ case NyARBufferType.INT1D_X8R8G8B8_32:\r
this._histImpl = new NyARRasterThresholdAnalyzer_Histogram_INT1D_X8R8G8B8_32();\r
break;\r
default:\r
\r
final NyARIntSize size=i_input.getSize();\r
//最大画像サイズの制限\r
- assert size.w*size.h<0x40000000;\r
- assert o_histogram.length==256;//現在は固定\r
+ assert(size.w*size.h<0x40000000);\r
+ assert(o_histogram.length==256);//現在は固定\r
\r
int[] h=o_histogram.data;\r
//ヒストグラム初期化\r
{\r
public int createHistogram(INyARRaster i_reader,NyARIntSize i_size, int[] o_histogram,int i_skip)\r
{\r
- assert (i_reader.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
+ assert (i_reader.isEqualBufferType( NyARBufferType.INT1D_GRAY_8));\r
final int[] input=(int[]) i_reader.getBuffer();\r
for (int y = i_size.h-1; y >=0 ; y-=i_skip){\r
int pt=y*i_size.w;\r
{\r
public int createHistogram(INyARRaster i_reader,NyARIntSize i_size, int[] o_histogram,int i_skip)\r
{\r
- assert (i_reader.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_X8R8G8B8_32));\r
+ assert (i_reader.isEqualBufferType( NyARBufferType.INT1D_X8R8G8B8_32));\r
final int[] input=(int[]) i_reader.getBuffer();\r
for (int y = i_size.h-1; y >=0 ; y-=i_skip){\r
int pt=y*i_size.w;\r
public int createHistogram(INyARRaster i_reader,NyARIntSize i_size, int[] o_histogram,int i_skip)\r
{\r
assert (\r
- i_reader.isEqualBufferType(INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8_24)||\r
- i_reader.isEqualBufferType(INyARRaster.BUFFERFORMAT_BYTE1D_R8G8B8_24));\r
+ i_reader.isEqualBufferType(NyARBufferType.BYTE1D_B8G8R8_24)||\r
+ i_reader.isEqualBufferType(NyARBufferType.BYTE1D_R8G8B8_24));\r
final byte[] input=(byte[]) i_reader.getBuffer();\r
final int pix_count=i_size.w;\r
final int pix_mod_part=pix_count-(pix_count%8);\r
{\r
public int createHistogram(INyARRaster i_reader,NyARIntSize i_size, int[] o_histogram,int i_skip)\r
{\r
- assert(i_reader.isEqualBufferType(INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8X8_32));\r
+ assert(i_reader.isEqualBufferType(NyARBufferType.BYTE1D_B8G8R8X8_32));\r
byte[] input = (byte[])i_reader.getBuffer();\r
int pix_count = i_size.w;\r
int pix_mod_part = pix_count - (pix_count % 8);\r
{\r
public int createHistogram(INyARRaster i_reader,NyARIntSize i_size, int[] o_histogram,int i_skip)\r
{\r
- assert(i_reader.isEqualBufferType(INyARRaster.BUFFERFORMAT_BYTE1D_X8R8G8B8_32));\r
+ assert(i_reader.isEqualBufferType(NyARBufferType.BYTE1D_X8R8G8B8_32));\r
byte[] input = (byte[])i_reader.getBuffer();\r
int pix_count = i_size.w;\r
int pix_mod_part = pix_count - (pix_count % 8);\r
{\r
public int createHistogram(INyARRaster i_reader,NyARIntSize i_size, int[] o_histogram,int i_skip)\r
{\r
- assert(i_reader.isEqualBufferType(INyARRaster.BUFFERFORMAT_WORD1D_R5G6B5_16LE));\r
+ assert(i_reader.isEqualBufferType(NyARBufferType.WORD1D_R5G6B5_16LE));\r
short[] input = (short[])i_reader.getBuffer();\r
int pix_count = i_size.w;\r
int pix_mod_part = pix_count - (pix_count % 8);\r
protected boolean _is_index_table_enable;\r
public NyARLabelingImage(int i_width, int i_height) throws NyARException\r
{\r
- super(new NyARIntSize(i_width,i_height),INyARRaster.BUFFERFORMAT_INT1D);\r
+ super(new NyARIntSize(i_width,i_height),NyARBufferType.INT1D);\r
this._ref_buf =new int[i_height*i_width];\r
this._label_list = new NyARLabelingLabelStack(MAX_LABELS);\r
this._index_table=new int[MAX_LABELS];\r
*/\r
public int labeling(NyARBinRaster i_raster,NyARLabelingImage o_destination) throws NyARException\r
{\r
- assert(i_raster.getBufferType()==INyARRaster.BUFFERFORMAT_INT1D_BIN_8);\r
+ assert(i_raster.getBufferType()==NyARBufferType.INT1D_BIN_8);\r
int label_img_ptr1, label_pixel;\r
int i, j;\r
int n, k; /* work */\r
*/\r
public int labeling(NyARBinRaster i_bin_raster, int i_top, int i_bottom,RleLabelFragmentInfoStack o_stack) throws NyARException\r
{\r
- assert(i_bin_raster.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_BIN_8));\r
+ assert(i_bin_raster.isEqualBufferType(NyARBufferType.INT1D_BIN_8));\r
return this.imple_labeling(i_bin_raster,0,i_top,i_bottom,o_stack);\r
}\r
/**\r
*/\r
public int labeling(NyARGrayscaleRaster i_gs_raster,int i_th, int i_top, int i_bottom,RleLabelFragmentInfoStack o_stack) throws NyARException\r
{\r
- assert(i_gs_raster.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
+ assert(i_gs_raster.isEqualBufferType(NyARBufferType.INT1D_GRAY_8));\r
return this.imple_labeling(i_gs_raster,i_th,i_top,i_bottom,o_stack);\r
}\r
private int imple_labeling(INyARRaster i_raster,int i_th,int i_top, int i_bottom,RleLabelFragmentInfoStack o_stack) throws NyARException\r
public void setRaster(INyARRaster i_raster)\r
{\r
//画素フォーマット、サイズ制限\r
- assert i_raster.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_X8R8G8B8_32);\r
+ assert i_raster.isEqualBufferType(NyARBufferType.INT1D_X8R8G8B8_32);\r
assert i_raster.getSize().isEqualSize(i_raster.getSize());\r
\r
final int[] buf=(int[])i_raster.getBuffer();\r
public class NyARColorPatt_O1 implements INyARColorPatt\r
{\r
private static final int AR_PATT_SAMPLE_NUM = 64;\r
- private static final int BUFFER_FORMAT=INyARRaster.BUFFERFORMAT_INT1D_X8R8G8B8_32;\r
+ private static final int BUFFER_FORMAT=NyARBufferType.INT1D_X8R8G8B8_32;\r
private int[] _patdata;\r
private NyARRgbPixelReader_INT1D_X8R8G8B8_32 _pixelreader;\r
\r
public class NyARColorPatt_O3 implements INyARColorPatt\r
{\r
private static final int AR_PATT_SAMPLE_NUM = 64;\r
- private static final int BUFFER_FORMAT=INyARRaster.BUFFERFORMAT_INT1D_X8R8G8B8_32;\r
+ private static final int BUFFER_FORMAT=NyARBufferType.INT1D_X8R8G8B8_32;\r
\r
private int[] _patdata;\r
private NyARIntSize _size;\r
protected NyARPerspectiveParamGenerator_O1 _perspective_gen;\r
private NyARRgbPixelReader_INT1D_X8R8G8B8_32 _pixelreader;\r
private static final int LOCAL_LT=1;\r
- private static final int BUFFER_FORMAT=INyARRaster.BUFFERFORMAT_INT1D_X8R8G8B8_32;\r
+ private static final int BUFFER_FORMAT=NyARBufferType.INT1D_X8R8G8B8_32;\r
\r
private void initializeInstance(int i_width, int i_height,int i_point_per_pix)\r
{\r
private int[] _patdata;\r
private NyARRgbPixelReader_INT1D_X8R8G8B8_32 _pixelreader;\r
private NyARIntSize _size;\r
- private static final int BUFFER_FORMAT=INyARRaster.BUFFERFORMAT_INT1D_X8R8G8B8_32;\r
+ private static final int BUFFER_FORMAT=NyARBufferType.INT1D_X8R8G8B8_32;\r
\r
public final int getWidth()\r
{\r
\r
public interface INyARRaster\r
{\r
- public static final int BYTE1D =0x00010000;\r
- public static final int INT2D =0x00020000;\r
- public static final int SHORT1D=0x00030000;\r
- public static final int INT1D =0x00040000;\r
- public static final int OBJECT =0x00100000;\r
- public static final int USER =0x00FF0000;\r
- // 24-31(8)予約\r
- // 16-27(8)型ID\r
- // 00:無効/01:byte[]/02:int[][]/03:short[]\r
- // 08-15(8)ビットフォーマットID\r
- // 00:24bit/01:32bit/02:16bit\r
- // 00-07(8)型番号\r
- //\r
- /**\r
- * RGB24フォーマットで、全ての画素が0\r
- */\r
- public static final int BUFFERFORMAT_NULL_ALLZERO = 0x00000001;\r
- /**\r
- * USER - USER+0xFFFFはユーザー定義型。実験用に。\r
- */\r
- public static final int BUFFERFORMAT_USER = USER;\r
-\r
- /**\r
- * byte[]で、R8G8B8の24ビットで画素が格納されている。\r
- */\r
- public static final int BUFFERFORMAT_BYTE1D_R8G8B8_24 = BYTE1D|0x0001;\r
- /**\r
- * byte[]で、B8G8R8の24ビットで画素が格納されている。\r
- */\r
- public static final int BUFFERFORMAT_BYTE1D_B8G8R8_24 = BYTE1D|0x0002;\r
- /**\r
- * byte[]で、R8G8B8X8の32ビットで画素が格納されている。\r
- */\r
- public static final int BUFFERFORMAT_BYTE1D_B8G8R8X8_32 = BYTE1D|0x0101;\r
- /**\r
- * byte[]で、X8R8G8B8の32ビットで画素が格納されている。\r
- */\r
- public static final int BUFFERFORMAT_BYTE1D_X8R8G8B8_32 = BYTE1D|0x0102;\r
-\r
- /**\r
- * byte[]で、RGB565の16ビット(little/big endian)で画素が格納されている。\r
- */\r
- public static final int BUFFERFORMAT_BYTE1D_R5G6B5_16LE = BYTE1D|0x0201;\r
- public static final int BUFFERFORMAT_BYTE1D_R5G6B5_16BE = BYTE1D|0x0202;\r
- /**\r
- * short[]で、RGB565の16ビット(little/big endian)で画素が格納されている。\r
- */ \r
- public static final int BUFFERFORMAT_WORD1D_R5G6B5_16LE = SHORT1D|0x0201;\r
- public static final int BUFFERFORMAT_WORD1D_R5G6B5_16BE = SHORT1D|0x0202;\r
-\r
- \r
- /**\r
- * int[][]で特に値範囲を定めない\r
- */\r
- public static final int BUFFERFORMAT_INT2D = INT2D|0x0000;\r
- /**\r
- * int[][]で0-255のグレイスケール画像\r
- */\r
- public static final int BUFFERFORMAT_INT2D_GRAY_8 = INT2D|0x0001;\r
- /**\r
- * int[][]で0/1の2値画像\r
- * これは、階調値1bitのBUFFERFORMAT_INT2D_GRAY_1と同じです。\r
- */\r
- public static final int BUFFERFORMAT_INT2D_BIN_8 = INT2D|0x0002;\r
-\r
- /**\r
- * int[]で特に値範囲を定めない\r
- */\r
- public static final int BUFFERFORMAT_INT1D = INT1D|0x0000;\r
- /**\r
- * int[]で0-255のグレイスケール画像\r
- */\r
- public static final int BUFFERFORMAT_INT1D_GRAY_8 = INT1D|0x0001;\r
- /**\r
- * int[]で0/1の2値画像\r
- * これは、階調1bitのBUFFERFORMAT_INT1D_GRAY_1と同じです。\r
- */\r
- public static final int BUFFERFORMAT_INT1D_BIN_8 = INT1D|0x0002;\r
- \r
- \r
- /**\r
- * int[]で、XRGB32の32ビットで画素が格納されている。\r
- */ \r
- public static final int BUFFERFORMAT_INT1D_X8R8G8B8_32=INT1D|0x0102;\r
-\r
- /**\r
- * H:9bit(0-359),S:8bit(0-255),V(0-255)\r
- */\r
- public static final int BUFFERFORMAT_INT1D_X7H9S8V8_32=INT1D|0x0103;\r
- \r
-\r
- \r
- /**\r
- * JavaのBufferedImageを格納するラスタ\r
- */\r
- public static final int BUFFERFORMAT_OBJECT_Java= OBJECT|0x0100;\r
- public static final int BUFFERFORMAT_OBJECT_Java_BufferedImage= BUFFERFORMAT_OBJECT_Java|0x01;\r
- \r
- /**\r
- * C#のBufferedImageを格納するラスタ\r
- */\r
- public static final int BUFFERFORMAT_OBJECT_CS= OBJECT|0x0200;\r
- \r
- /**\r
- * ActionScript3のBitmapDataを格納するラスタ\r
- */\r
- public static final int BUFFERFORMAT_OBJECT_AS3= OBJECT|0x0300;\r
- public static final int BUFFERFORMAT_OBJECT_AS3_BitmapData= BUFFERFORMAT_OBJECT_AS3|0x01;\r
-\r
- \r
- \r
- \r
- \r
- \r
public int getWidth();\r
public int getHeight();\r
public NyARIntSize getSize();\r
public int getBufferType();\r
/**\r
* バッファのタイプがi_type_valueであるか、チェックします。\r
+ * この値は、NyARBufferTypeに定義された定数値です。\r
* @param i_type_value\r
* @return\r
*/\r
* バッファオブジェクトがアタッチされていればtrue\r
*/\r
protected boolean _is_attached_buffer;\r
+ /**\r
+ * \r
+ * @param i_width\r
+ * @param i_height\r
+ * @param i_raster_type\r
+ * NyARBufferTypeに定義された定数値を指定してください。\r
+ * @param i_is_alloc\r
+ * @throws NyARException\r
+ */\r
public NyARBinRaster(int i_width, int i_height,int i_raster_type,boolean i_is_alloc) throws NyARException\r
{\r
super(new NyARIntSize(i_width,i_height),i_raster_type);\r
}\r
public NyARBinRaster(int i_width, int i_height,boolean i_is_alloc) throws NyARException\r
{\r
- super(new NyARIntSize(i_width,i_height),INyARRaster.BUFFERFORMAT_INT1D_BIN_8);\r
- if(!initInstance(this._size,INyARRaster.BUFFERFORMAT_INT1D_BIN_8,i_is_alloc)){\r
+ super(new NyARIntSize(i_width,i_height),NyARBufferType.INT1D_BIN_8);\r
+ if(!initInstance(this._size,NyARBufferType.INT1D_BIN_8,i_is_alloc)){\r
throw new NyARException();\r
}\r
}\r
public NyARBinRaster(int i_width, int i_height) throws NyARException\r
{\r
- super(new NyARIntSize(i_width,i_height),INyARRaster.BUFFERFORMAT_INT1D_BIN_8);\r
- if(!initInstance(this._size,INyARRaster.BUFFERFORMAT_INT1D_BIN_8,true)){\r
+ super(new NyARIntSize(i_width,i_height),NyARBufferType.INT1D_BIN_8);\r
+ if(!initInstance(this._size,NyARBufferType.INT1D_BIN_8,true)){\r
throw new NyARException();\r
}\r
} \r
{\r
switch(i_buf_type)\r
{\r
- case INyARRaster.BUFFERFORMAT_INT1D_BIN_8:\r
+ case NyARBufferType.INT1D_BIN_8:\r
this._buf = i_is_alloc?new int[i_size.w*i_size.h]:null;\r
break;\r
default:\r
--- /dev/null
+package jp.nyatla.nyartoolkit.core.raster;\r
+\r
+public class NyARBufferType\r
+{\r
+ private static final int T_BYTE1D =0x00010000;\r
+ private static final int T_INT2D =0x00020000;\r
+ private static final int T_SHORT1D=0x00030000;\r
+ private static final int T_INT1D =0x00040000;\r
+ private static final int T_OBJECT =0x00100000;\r
+ private static final int T_USER =0x00FF0000;\r
+ // 24-31(8)予約\r
+ // 16-27(8)型ID\r
+ // 00:無効/01:byte[]/02:int[][]/03:short[]\r
+ // 08-15(8)ビットフォーマットID\r
+ // 00:24bit/01:32bit/02:16bit\r
+ // 00-07(8)型番号\r
+ //\r
+ /**\r
+ * RGB24フォーマットで、全ての画素が0\r
+ */\r
+ public static final int NULL_ALLZERO = 0x00000001;\r
+ /**\r
+ * USER - USER+0xFFFFはユーザー定義型。実験用に。\r
+ */\r
+ public static final int USER_DEFINE = T_USER;\r
+\r
+ /**\r
+ * byte[]で、R8G8B8の24ビットで画素が格納されている。\r
+ */\r
+ public static final int BYTE1D_R8G8B8_24 = T_BYTE1D|0x0001;\r
+ /**\r
+ * byte[]で、B8G8R8の24ビットで画素が格納されている。\r
+ */\r
+ public static final int BYTE1D_B8G8R8_24 = T_BYTE1D|0x0002;\r
+ /**\r
+ * byte[]で、R8G8B8X8の32ビットで画素が格納されている。\r
+ */\r
+ public static final int BYTE1D_B8G8R8X8_32 = T_BYTE1D|0x0101;\r
+ /**\r
+ * byte[]で、X8R8G8B8の32ビットで画素が格納されている。\r
+ */\r
+ public static final int BYTE1D_X8R8G8B8_32 = T_BYTE1D|0x0102;\r
+\r
+ /**\r
+ * byte[]で、RGB565の16ビット(little/big endian)で画素が格納されている。\r
+ */\r
+ public static final int BYTE1D_R5G6B5_16LE = T_BYTE1D|0x0201;\r
+ public static final int BYTE1D_R5G6B5_16BE = T_BYTE1D|0x0202;\r
+ /**\r
+ * short[]で、RGB565の16ビット(little/big endian)で画素が格納されている。\r
+ */ \r
+ public static final int WORD1D_R5G6B5_16LE = T_SHORT1D|0x0201;\r
+ public static final int WORD1D_R5G6B5_16BE = T_SHORT1D|0x0202;\r
+\r
+ \r
+ /**\r
+ * int[][]で特に値範囲を定めない\r
+ */\r
+ public static final int INT2D = T_INT2D|0x0000;\r
+ /**\r
+ * int[][]で0-255のグレイスケール画像\r
+ */\r
+ public static final int INT2D_GRAY_8 = T_INT2D|0x0001;\r
+ /**\r
+ * int[][]で0/1の2値画像\r
+ * これは、階調値1bitのBUFFERFORMAT_INT2D_GRAY_1と同じです。\r
+ */\r
+ public static final int INT2D_BIN_8 = T_INT2D|0x0002;\r
+\r
+ /**\r
+ * int[]で特に値範囲を定めない\r
+ */\r
+ public static final int INT1D = T_INT1D|0x0000;\r
+ /**\r
+ * int[]で0-255のグレイスケール画像\r
+ */\r
+ public static final int INT1D_GRAY_8 = T_INT1D|0x0001;\r
+ /**\r
+ * int[]で0/1の2値画像\r
+ * これは、階調1bitのINT1D_GRAY_1と同じです。\r
+ */\r
+ public static final int INT1D_BIN_8 = T_INT1D|0x0002;\r
+ \r
+ \r
+ /**\r
+ * int[]で、XRGB32の32ビットで画素が格納されている。\r
+ */ \r
+ public static final int INT1D_X8R8G8B8_32=T_INT1D|0x0102;\r
+\r
+ /**\r
+ * H:9bit(0-359),S:8bit(0-255),V(0-255)\r
+ */\r
+ public static final int INT1D_X7H9S8V8_32=T_INT1D|0x0103;\r
+ \r
+\r
+ /**\r
+ * プラットフォーム固有オブジェクト\r
+ */\r
+ public static final int OBJECT_Java= T_OBJECT|0x0100;\r
+ public static final int OBJECT_CS = T_OBJECT|0x0200;\r
+ public static final int OBJECT_AS3 = T_OBJECT|0x0300;\r
+ \r
+ /**\r
+ * JavaのBufferedImageを格納するラスタ\r
+ */\r
+ public static final int OBJECT_Java_BufferedImage= OBJECT_Java|0x01;\r
+ \r
+ \r
+ /**\r
+ * ActionScript3のBitmapDataを格納するラスタ\r
+ */\r
+ public static final int OBJECT_AS3_BitmapData= OBJECT_AS3|0x01;\r
+\r
+}\r
import jp.nyatla.nyartoolkit.NyARException;\r
import jp.nyatla.nyartoolkit.core.types.*;\r
\r
-public final class NyARGrayscaleRaster extends NyARRaster_BasicClass\r
+public class NyARGrayscaleRaster extends NyARRaster_BasicClass\r
{\r
\r
protected Object _buf;\r
\r
public NyARGrayscaleRaster(int i_width, int i_height) throws NyARException\r
{\r
- super(new NyARIntSize(i_width,i_height),INyARRaster.BUFFERFORMAT_INT1D_GRAY_8);\r
- if(!initInstance(this._size,INyARRaster.BUFFERFORMAT_INT1D_GRAY_8,true)){\r
+ super(new NyARIntSize(i_width,i_height),NyARBufferType.INT1D_GRAY_8);\r
+ if(!initInstance(this._size,NyARBufferType.INT1D_GRAY_8,true)){\r
throw new NyARException();\r
}\r
} \r
public NyARGrayscaleRaster(int i_width, int i_height,boolean i_is_alloc) throws NyARException\r
{\r
- super(new NyARIntSize(i_width,i_height),INyARRaster.BUFFERFORMAT_INT1D_GRAY_8);\r
- if(!initInstance(this._size,INyARRaster.BUFFERFORMAT_INT1D_GRAY_8,i_is_alloc)){\r
+ super(new NyARIntSize(i_width,i_height),NyARBufferType.INT1D_GRAY_8);\r
+ if(!initInstance(this._size,NyARBufferType.INT1D_GRAY_8,i_is_alloc)){\r
throw new NyARException();\r
}\r
- } \r
+ }\r
+ /**\r
+ * @param i_width\r
+ * @param i_height\r
+ * @param i_raster_type\r
+ * NyARBufferTypeに定義された定数値を指定してください。\r
+ * @param i_is_alloc\r
+ * @throws NyARException\r
+ */\r
public NyARGrayscaleRaster(int i_width, int i_height,int i_raster_type,boolean i_is_alloc) throws NyARException\r
{\r
super(new NyARIntSize(i_width,i_height),i_raster_type);\r
{\r
switch(i_buf_type)\r
{\r
- case INyARRaster.BUFFERFORMAT_INT1D_GRAY_8:\r
+ case NyARBufferType.INT1D_GRAY_8:\r
this._buf =i_is_alloc?new int[i_size.w*i_size.h]:null;\r
break;\r
default:\r
public final class NyARHsvRaster extends NyARRaster_BasicClass\r
{\r
\r
- protected int[] _ref_buf;\r
+ private int[] _ref_buf;\r
\r
public NyARHsvRaster(int i_width, int i_height)\r
{\r
//このクラスは外部参照バッファ/形式多重化が使えない簡易実装です。\r
- super(new NyARIntSize(i_width,i_height),INyARRaster.BUFFERFORMAT_INT1D_X7H9S8V8_32);\r
+ super(new NyARIntSize(i_width,i_height),NyARBufferType.INT1D_X7H9S8V8_32);\r
this._ref_buf = new int[i_height*i_width];\r
}\r
public Object getBuffer()\r
package jp.nyatla.nyartoolkit.core.raster;\r
\r
import jp.nyatla.nyartoolkit.NyARException;\r
-import jp.nyatla.nyartoolkit.core.rasterreader.*;\r
import jp.nyatla.nyartoolkit.core.types.*;\r
\r
/**このクラスは、単機能のNyARRasterです。\r
*\r
*/\r
-public final class NyARRaster extends NyARRaster_BasicClass\r
+public class NyARRaster extends NyARRaster_BasicClass\r
{\r
protected Object _buf;\r
protected int _buf_type;\r
* @param i_width\r
* @param i_height\r
* @param i_buffer_type\r
+ * NyARBufferTypeに定義された定数値を指定してください。\r
* @param i_is_alloc\r
* @throws NyARException\r
*/\r
{\r
switch(i_buf_type)\r
{\r
- case INyARRaster.BUFFERFORMAT_INT1D_X8R8G8B8_32:\r
+ case NyARBufferType.INT1D_X8R8G8B8_32:\r
this._buf=i_is_alloc?new int[i_size.w*i_size.h]:null;\r
break;\r
default:\r
* バッファオブジェクトがアタッチされていればtrue\r
*/\r
protected boolean _is_attached_buffer;\r
+ /**\r
+ * \r
+ * @param i_width\r
+ * @param i_height\r
+ * @param i_raster_type\r
+ * NyARBufferTypeに定義された定数値を指定してください。\r
+ * @param i_is_alloc\r
+ * @throws NyARException\r
+ */\r
public NyARRgbRaster(int i_width, int i_height,int i_raster_type,boolean i_is_alloc) throws NyARException\r
{\r
super(new NyARIntSize(i_width,i_height),i_raster_type);\r
throw new NyARException();\r
}\r
}\r
+ /**\r
+ * \r
+ * @param i_width\r
+ * @param i_height\r
+ * @param i_raster_type\r
+ * NyARBufferTypeに定義された定数値を指定してください。\r
+ * @throws NyARException\r
+ */\r
public NyARRgbRaster(int i_width, int i_height,int i_raster_type) throws NyARException\r
{\r
super(new NyARIntSize(i_width,i_height),i_raster_type);\r
{\r
switch(i_raster_type)\r
{\r
- case INyARRaster.BUFFERFORMAT_INT1D_X8R8G8B8_32:\r
+ case NyARBufferType.INT1D_X8R8G8B8_32:\r
this._buf=i_is_alloc?new int[i_size.w*i_size.h]:null;\r
this._reader=new NyARRgbPixelReader_INT1D_X8R8G8B8_32((int[])this._buf,i_size);\r
break;\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8X8_32:\r
+ case NyARBufferType.BYTE1D_B8G8R8X8_32:\r
this._buf=i_is_alloc?new byte[i_size.w*i_size.h*4]:null;\r
this._reader=new NyARRgbPixelReader_BYTE1D_B8G8R8X8_32((byte[])this._buf,i_size);\r
break;\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_R8G8B8_24:\r
+ case NyARBufferType.BYTE1D_R8G8B8_24:\r
this._buf=i_is_alloc?new byte[i_size.w*i_size.h*3]:null;\r
this._reader=new NyARRgbPixelReader_BYTE1D_R8G8B8_24((byte[])this._buf,i_size);\r
break;\r
\r
public class NyARRgbRaster_BGRA extends NyARRgbRaster\r
{\r
- public NyARRgbRaster_BGRA(int i_width, int i_height,Boolean i_is_alloc) throws NyARException\r
+ public NyARRgbRaster_BGRA(int i_width, int i_height,boolean i_is_alloc) throws NyARException\r
{\r
- super(i_width,i_height,INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8X8_32,i_is_alloc);\r
+ super(i_width,i_height,NyARBufferType.BYTE1D_B8G8R8X8_32,i_is_alloc);\r
} \r
public NyARRgbRaster_BGRA(int i_width, int i_height) throws NyARException\r
{\r
- super(i_width,i_height,INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8X8_32);\r
+ super(i_width,i_height,NyARBufferType.BYTE1D_B8G8R8X8_32);\r
return;\r
}\r
}\r
\r
public NyARRgbRaster_Blank(int i_width, int i_height)\r
{\r
- super(new NyARIntSize(i_width,i_height),INyARRaster.BUFFERFORMAT_NULL_ALLZERO);\r
+ super(new NyARIntSize(i_width,i_height),NyARBufferType.NULL_ALLZERO);\r
this._reader = new PixelReader();\r
return;\r
}\r
package jp.nyatla.nyartoolkit.core.raster.rgb;\r
\r
import jp.nyatla.nyartoolkit.NyARException;\r
-import jp.nyatla.nyartoolkit.core.raster.INyARRaster;\r
+import jp.nyatla.nyartoolkit.core.raster.*;\r
\r
public class NyARRgbRaster_RGB extends NyARRgbRaster\r
{\r
- public NyARRgbRaster_RGB(int i_width, int i_height,Boolean i_is_alloc) throws NyARException\r
+ public NyARRgbRaster_RGB(int i_width, int i_height,boolean i_is_alloc) throws NyARException\r
{\r
- super(i_width,i_height,INyARRaster.BUFFERFORMAT_BYTE1D_R8G8B8_24,i_is_alloc);\r
+ super(i_width,i_height,NyARBufferType.BYTE1D_R8G8B8_24,i_is_alloc);\r
}\r
\r
public NyARRgbRaster_RGB(int i_width, int i_height) throws NyARException\r
{\r
- super(i_width,i_height,INyARRaster.BUFFERFORMAT_BYTE1D_R8G8B8_24);\r
+ super(i_width,i_height,NyARBufferType.BYTE1D_R8G8B8_24);\r
return;\r
}\r
}\r
package jp.nyatla.nyartoolkit.core.rasterfilter;\r
\r
import jp.nyatla.nyartoolkit.NyARException;\r
-import jp.nyatla.nyartoolkit.core.raster.INyARRaster;\r
+import jp.nyatla.nyartoolkit.core.raster.*;\r
import jp.nyatla.nyartoolkit.core.types.NyARIntSize;\r
\r
/**\r
protected NyARRasterFilter_CustomToneTable(int i_raster_type) throws NyARException\r
{\r
switch (i_raster_type) {\r
- case INyARRaster.BUFFERFORMAT_INT1D_GRAY_8:\r
+ case NyARBufferType.INT1D_GRAY_8:\r
this._dofilterimpl=new IdoFilterImpl_INT1D_GRAY_8();\r
break;\r
default:\r
{\r
public void doFilter(INyARRaster i_input, INyARRaster i_output,NyARIntSize i_size) throws NyARException\r
{\r
- assert( i_input.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
+ assert( i_input.isEqualBufferType(NyARBufferType.INT1D_GRAY_8));\r
\r
int[] out_buf = (int[]) i_output.getBuffer();\r
int[] in_buf = (int[]) i_input.getBuffer();\r
package jp.nyatla.nyartoolkit.core.rasterfilter;\r
\r
import jp.nyatla.nyartoolkit.NyARException;\r
-import jp.nyatla.nyartoolkit.core.raster.INyARRaster;\r
+import jp.nyatla.nyartoolkit.core.raster.*;\r
import jp.nyatla.nyartoolkit.core.types.NyARIntSize;\r
\r
\r
public NyARRasterFilter_GaussianSmooth(int i_raster_type) throws NyARException\r
{\r
switch (i_raster_type) {\r
- case INyARRaster.BUFFERFORMAT_INT1D_GRAY_8:\r
+ case NyARBufferType.INT1D_GRAY_8:\r
this._do_filter_impl=new IdoFilterImpl_GRAY_8();\r
break;\r
default:\r
{\r
public void doFilter(INyARRaster i_input, INyARRaster i_output,NyARIntSize i_size) throws NyARException\r
{\r
- assert (i_input.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
- assert (i_output.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
+ assert (i_input.isEqualBufferType(NyARBufferType.INT1D_GRAY_8));\r
+ assert (i_output.isEqualBufferType(NyARBufferType.INT1D_GRAY_8));\r
int[] in_ptr =(int[])i_input.getBuffer();\r
int[] out_ptr=(int[])i_output.getBuffer();\r
int width=i_size.w;\r
public NyARRasterFilter_Reverse(int i_raster_type) throws NyARException\r
{\r
switch (i_raster_type) {\r
- case INyARRaster.BUFFERFORMAT_INT1D_GRAY_8:\r
+ case NyARBufferType.INT1D_GRAY_8:\r
this._do_filter_impl=new IdoFilterImpl_GRAY_8();\r
break;\r
default:\r
{\r
public void doFilter(INyARRaster i_input, INyARRaster i_output,NyARIntSize i_size) throws NyARException\r
{\r
- assert (i_input.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
- assert (i_output.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
+ assert (i_input.isEqualBufferType(NyARBufferType.INT1D_GRAY_8));\r
+ assert (i_output.isEqualBufferType(NyARBufferType.INT1D_GRAY_8));\r
int[] in_ptr =(int[])i_input.getBuffer();\r
int[] out_ptr=(int[])i_output.getBuffer();\r
\r
package jp.nyatla.nyartoolkit.core.rasterfilter;\r
\r
import jp.nyatla.nyartoolkit.NyARException;\r
-import jp.nyatla.nyartoolkit.core.raster.INyARRaster;\r
+import jp.nyatla.nyartoolkit.core.raster.*;\r
import jp.nyatla.nyartoolkit.core.types.NyARIntSize;\r
\r
/**\r
public NyARRasterFilter_Rgb2Hsv(int i_raster_type) throws NyARException\r
{\r
switch (i_raster_type) {\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8_24:\r
+ case NyARBufferType.BYTE1D_B8G8R8_24:\r
this._dofilterimpl=new IdoFilterImpl_BYTE1D_B8G8R8_24();\r
break;\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_R8G8B8_24:\r
+ case NyARBufferType.BYTE1D_R8G8B8_24:\r
default:\r
throw new NyARException();\r
}\r
{\r
public void doFilter(INyARRaster i_input, INyARRaster i_output,NyARIntSize i_size) throws NyARException\r
{\r
- assert( i_input.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_X7H9S8V8_32));\r
+ assert( i_input.isEqualBufferType(NyARBufferType.INT1D_X7H9S8V8_32));\r
\r
int[] out_buf = (int[]) i_output.getBuffer();\r
byte[] in_buf = (byte[]) i_input.getBuffer();\r
package jp.nyatla.nyartoolkit.core.rasterfilter;\r
\r
import jp.nyatla.nyartoolkit.NyARException;\r
-import jp.nyatla.nyartoolkit.core.raster.INyARRaster;\r
+import jp.nyatla.nyartoolkit.core.raster.*;\r
import jp.nyatla.nyartoolkit.core.types.NyARIntSize;\r
\r
/**\r
public NyARRasterFilter_Roberts(int i_raster_type) throws NyARException\r
{\r
switch (i_raster_type) {\r
- case INyARRaster.BUFFERFORMAT_INT1D_GRAY_8:\r
+ case NyARBufferType.INT1D_GRAY_8:\r
this._do_filter_impl=new IdoFilterImpl_GRAY_8();\r
break;\r
default:\r
{\r
public void doFilter(INyARRaster i_input, INyARRaster i_output,NyARIntSize i_size) throws NyARException\r
{\r
- assert (i_input.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
- assert (i_output.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
+ assert (i_input.isEqualBufferType(NyARBufferType.INT1D_GRAY_8));\r
+ assert (i_output.isEqualBufferType(NyARBufferType.INT1D_GRAY_8));\r
int[] in_ptr =(int[])i_input.getBuffer();\r
int[] out_ptr=(int[])i_output.getBuffer();\r
int width=i_size.w;\r
package jp.nyatla.nyartoolkit.core.rasterfilter;\r
\r
import jp.nyatla.nyartoolkit.NyARException;\r
-import jp.nyatla.nyartoolkit.core.raster.INyARRaster;\r
+import jp.nyatla.nyartoolkit.core.raster.*;\r
import jp.nyatla.nyartoolkit.core.types.NyARIntSize;\r
\r
\r
public NyARRasterFilter_SimpleSmooth(int i_raster_type) throws NyARException\r
{\r
switch (i_raster_type) {\r
- case INyARRaster.BUFFERFORMAT_INT1D_GRAY_8:\r
+ case NyARBufferType.INT1D_GRAY_8:\r
this._do_filter_impl=new IdoFilterImpl_GRAY_8();\r
break;\r
default:\r
{\r
public void doFilter(INyARRaster i_input, INyARRaster i_output,NyARIntSize i_size) throws NyARException\r
{\r
- assert (i_input.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
- assert (i_output.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
+ assert (i_input.isEqualBufferType(NyARBufferType.INT1D_GRAY_8));\r
+ assert (i_output.isEqualBufferType(NyARBufferType.INT1D_GRAY_8));\r
int[] in_ptr =(int[])i_input.getBuffer();\r
int[] out_ptr=(int[])i_output.getBuffer();\r
/* 画像端は捨てる。\r
public int _threshold;\r
public NyARRasterFilter_ConstantThreshold(int i_initial_threshold,int i_in_raster_type,int i_out_raster_type) throws NyARException\r
{\r
- assert(i_in_raster_type==INyARRaster.BUFFERFORMAT_INT1D_GRAY_8);\r
- assert(i_out_raster_type==INyARRaster.BUFFERFORMAT_INT1D_BIN_8);\r
+ assert(i_in_raster_type==NyARBufferType.INT1D_GRAY_8);\r
+ assert(i_out_raster_type==NyARBufferType.INT1D_BIN_8);\r
//初期化\r
this._threshold=i_initial_threshold;\r
\r
}\r
public void doFilter(NyARGrayscaleRaster i_input, NyARBinRaster i_output) throws NyARException\r
{\r
- assert(i_input.getBufferType()==INyARRaster.BUFFERFORMAT_INT1D_GRAY_8);\r
- assert(i_output.getBufferType()==INyARRaster.BUFFERFORMAT_INT1D_BIN_8);\r
+ assert(i_input.getBufferType()==NyARBufferType.INT1D_GRAY_8);\r
+ assert(i_output.getBufferType()==NyARBufferType.INT1D_BIN_8);\r
int[] out_buf = (int[]) i_output.getBuffer();\r
int[] in_buf = (int[]) i_input.getBuffer();\r
NyARIntSize s=i_input.getSize();\r
\r
public NyARRasterFilter_ARToolkitThreshold(int i_threshold,int i_in_raster_type) throws NyARException\r
{\r
- if(!initInstance(i_threshold,i_in_raster_type,INyARRaster.BUFFERFORMAT_INT1D_BIN_8)){\r
+ if(!initInstance(i_threshold,i_in_raster_type,NyARBufferType.INT1D_BIN_8)){\r
throw new NyARException();\r
}\r
}\r
protected boolean initInstance(int i_threshold,int i_in_raster_type,int i_out_raster_type)\r
{\r
switch(i_out_raster_type){\r
- case INyARRaster.BUFFERFORMAT_INT1D_BIN_8:\r
+ case NyARBufferType.INT1D_BIN_8:\r
switch (i_in_raster_type){\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8_24:\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_R8G8B8_24:\r
+ case NyARBufferType.BYTE1D_B8G8R8_24:\r
+ case NyARBufferType.BYTE1D_R8G8B8_24:\r
this._do_threshold_impl=new doThFilterImpl_BUFFERFORMAT_BYTE1D_RGB_24();\r
break;\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8X8_32:\r
+ case NyARBufferType.BYTE1D_B8G8R8X8_32:\r
this._do_threshold_impl=new doThFilterImpl_BUFFERFORMAT_BYTE1D_B8G8R8X8_32();\r
break;\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_X8R8G8B8_32:\r
+ case NyARBufferType.BYTE1D_X8R8G8B8_32:\r
this._do_threshold_impl=new doThFilterImpl_BUFFERFORMAT_BYTE1D_X8R8G8B8_32();\r
break;\r
- case INyARRaster.BUFFERFORMAT_INT1D_X8R8G8B8_32:\r
+ case NyARBufferType.INT1D_X8R8G8B8_32:\r
this._do_threshold_impl=new doThFilterImpl_BUFFERFORMAT_INT1D_X8R8G8B8_32();\r
break;\r
- case INyARRaster.BUFFERFORMAT_WORD1D_R5G6B5_16LE:\r
+ case NyARBufferType.WORD1D_R5G6B5_16LE:\r
this._do_threshold_impl=new doThFilterImpl_BUFFERFORMAT_WORD1D_R5G6B5_16LE();\r
break;\r
default:\r
{\r
public void doThFilter(INyARRaster i_input, INyARRaster i_output,NyARIntSize i_size,int i_threshold)\r
{\r
- assert (i_output.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_BIN_8));\r
+ assert (i_output.isEqualBufferType(NyARBufferType.INT1D_BIN_8));\r
\r
int[] out_buf = (int[]) i_output.getBuffer();\r
byte[] in_buf = (byte[]) i_input.getBuffer();\r
{\r
public void doThFilter(INyARRaster i_input, INyARRaster i_output,NyARIntSize i_size,int i_threshold)\r
{\r
- assert (i_input.isEqualBufferType(INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8X8_32));\r
- assert (i_output.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_BIN_8));\r
+ assert (i_input.isEqualBufferType(NyARBufferType.BYTE1D_B8G8R8X8_32));\r
+ assert (i_output.isEqualBufferType(NyARBufferType.INT1D_BIN_8));\r
\r
int[] out_buf = (int[]) i_output.getBuffer();\r
byte[] in_buf = (byte[]) i_input.getBuffer();\r
{\r
public void doThFilter(INyARRaster i_input, INyARRaster i_output,NyARIntSize i_size,int i_threshold)\r
{\r
- assert (i_output.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_BIN_8));\r
+ assert (i_output.isEqualBufferType(NyARBufferType.INT1D_BIN_8));\r
\r
int[] out_buf = (int[]) i_output.getBuffer();\r
byte[] in_buf = (byte[]) i_input.getBuffer();\r
{\r
public void doThFilter(INyARRaster i_input, INyARRaster i_output,NyARIntSize i_size,int i_threshold)\r
{\r
- assert (i_output.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_BIN_8));\r
+ assert (i_output.isEqualBufferType(NyARBufferType.INT1D_BIN_8));\r
\r
int[] out_buf = (int[]) i_output.getBuffer();\r
int[] in_buf = (int[]) i_input.getBuffer();\r
{\r
public void doThFilter(INyARRaster i_input, INyARRaster i_output,NyARIntSize i_size,int i_threshold)\r
{\r
- assert (i_output.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_BIN_8));\r
+ assert (i_output.isEqualBufferType(NyARBufferType.INT1D_BIN_8));\r
\r
int[] out_buf = (int[]) i_output.getBuffer();\r
short[] in_buf = (short[]) i_input.getBuffer();\r
}\r
public NyARRasterFilter_Rgb2Gs_AveAdd(int i_in_raster_type) throws NyARException\r
{\r
- if(!initInstance(i_in_raster_type,INyARRaster.BUFFERFORMAT_INT1D_GRAY_8))\r
+ if(!initInstance(i_in_raster_type,NyARBufferType.INT1D_GRAY_8))\r
{\r
throw new NyARException();\r
}\r
protected boolean initInstance(int i_in_raster_type,int i_out_raster_type)\r
{\r
switch(i_out_raster_type){\r
- case INyARRaster.BUFFERFORMAT_INT1D_GRAY_8:\r
+ case NyARBufferType.INT1D_GRAY_8:\r
switch (i_in_raster_type){\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8_24:\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_R8G8B8_24:\r
+ case NyARBufferType.BYTE1D_B8G8R8_24:\r
+ case NyARBufferType.BYTE1D_R8G8B8_24:\r
this._do_filter_impl=new doThFilterImpl_BYTE1D_B8G8R8_24();\r
break;\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8X8_32:\r
+ case NyARBufferType.BYTE1D_B8G8R8X8_32:\r
this._do_filter_impl=new doThFilterImpl_BYTE1D_B8G8R8X8_32();\r
break;\r
default:\r
{\r
public void doFilter(INyARRaster i_input, INyARRaster i_output,NyARIntSize i_size)\r
{\r
- assert(i_output.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
+ assert(i_output.isEqualBufferType(NyARBufferType.INT1D_GRAY_8));\r
int[] out_buf = (int[]) i_output.getBuffer();\r
byte[] in_buf = (byte[]) i_input.getBuffer();\r
\r
{\r
public void doFilter(INyARRaster i_input, INyARRaster i_output,NyARIntSize i_size)\r
{\r
- assert(i_output.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
+ assert(i_output.isEqualBufferType(NyARBufferType.INT1D_GRAY_8));\r
int[] out_buf = (int[]) i_output.getBuffer();\r
byte[] in_buf = (byte[]) i_input.getBuffer();\r
\r
private IdoFilterImpl _dofilterimpl;\r
public NyARRasterFilter_Rgb2Gs_RgbCube(int i_in_raster_type) throws NyARException\r
{\r
- if(!initInstance(i_in_raster_type,INyARRaster.BUFFERFORMAT_INT1D_GRAY_8))\r
+ if(!initInstance(i_in_raster_type,NyARBufferType.INT1D_GRAY_8))\r
{\r
throw new NyARException();\r
}\r
protected boolean initInstance(int i_in_raster_type,int i_out_raster_type)\r
{\r
switch(i_out_raster_type){\r
- case INyARRaster.BUFFERFORMAT_INT1D_GRAY_8:\r
+ case NyARBufferType.INT1D_GRAY_8:\r
switch (i_in_raster_type) {\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8_24:\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_R8G8B8_24:\r
+ case NyARBufferType.BYTE1D_B8G8R8_24:\r
+ case NyARBufferType.BYTE1D_R8G8B8_24:\r
this._dofilterimpl=new IdoFilterImpl_BYTE1D_B8G8R8_24();\r
break;\r
default:\r
*/\r
public void doFilter(INyARRaster i_input, INyARRaster i_output,NyARIntSize i_size) throws NyARException\r
{\r
- assert( i_input.isEqualBufferType(INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8_24)\r
- || i_input.isEqualBufferType(INyARRaster.BUFFERFORMAT_BYTE1D_R8G8B8_24));\r
- assert(i_output.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
+ assert( i_input.isEqualBufferType(NyARBufferType.BYTE1D_B8G8R8_24)\r
+ || i_input.isEqualBufferType(NyARBufferType.BYTE1D_R8G8B8_24));\r
+ assert(i_output.isEqualBufferType(NyARBufferType.INT1D_GRAY_8));\r
\r
int[] out_buf = (int[]) i_output.getBuffer();\r
byte[] in_buf = (byte[]) i_input.getBuffer();\r
private IdoFilterImpl _dofilterimpl;\r
public NyARRasterFilter_Rgb2Gs_YCbCr(int i_in_raster_type) throws NyARException\r
{\r
- if(!initInstance(i_in_raster_type,INyARRaster.BUFFERFORMAT_INT1D_GRAY_8))\r
+ if(!initInstance(i_in_raster_type,NyARBufferType.INT1D_GRAY_8))\r
{\r
throw new NyARException();\r
}\r
protected boolean initInstance(int i_in_raster_type,int i_out_raster_type)\r
{\r
switch(i_out_raster_type){\r
- case INyARRaster.BUFFERFORMAT_INT1D_GRAY_8:\r
+ case NyARBufferType.INT1D_GRAY_8:\r
switch (i_in_raster_type) {\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8_24:\r
+ case NyARBufferType.BYTE1D_B8G8R8_24:\r
this._dofilterimpl=new IdoFilterImpl_BYTE1D_B8G8R8_24();\r
break;\r
- case INyARRaster.BUFFERFORMAT_BYTE1D_R8G8B8_24:\r
+ case NyARBufferType.BYTE1D_R8G8B8_24:\r
default:\r
return false;\r
}\r
*/\r
public void doFilter(INyARRaster i_input, INyARRaster i_output,NyARIntSize i_size) throws NyARException\r
{\r
- assert( i_input.isEqualBufferType(INyARRaster.BUFFERFORMAT_BYTE1D_B8G8R8_24));\r
- assert(i_output.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
+ assert( i_input.isEqualBufferType(NyARBufferType.BYTE1D_B8G8R8_24));\r
+ assert(i_output.isEqualBufferType(NyARBufferType.INT1D_GRAY_8));\r
\r
int[] out_buf = (int[]) i_output.getBuffer();\r
byte[] in_buf = (byte[]) i_input.getBuffer();\r
+/* \r
+ * PROJECT: NyARToolkit\r
+ * --------------------------------------------------------------------------------\r
+ * This work is based on the original ARToolKit developed by\r
+ * Hirokazu Kato\r
+ * Mark Billinghurst\r
+ * HITLab, University of Washington, Seattle\r
+ * http://www.hitl.washington.edu/artoolkit/\r
+ *\r
+ * The NyARToolkit is Java edition ARToolKit class library.\r
+ * Copyright (C)2008-2009 Ryo Iizuka\r
+ *\r
+ * This program is free software: you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation, either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ * \r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.\r
+ * \r
+ * For further information please contact.\r
+ * http://nyatla.jp/nyatoolkit/\r
+ * <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>\r
+ * \r
+ */\r
package jp.nyatla.nyartoolkit.core.rasterreader;\r
\r
import jp.nyatla.nyartoolkit.NyARException;\r
*/\r
package jp.nyatla.nyartoolkit.core.rasterreader;\r
\r
-import jp.nyatla.nyartoolkit.core.raster.INyARRaster;\r
+import jp.nyatla.nyartoolkit.core.raster.*;\r
import jp.nyatla.nyartoolkit.core.types.NyARIntPoint2d;\r
import jp.nyatla.nyartoolkit.core.types.NyARIntSize;\r
\r
private NyARIntSize _ref_size;\r
public NyARVectorReader_INT1D_GRAY_8(INyARRaster i_ref_raster)\r
{\r
- assert(i_ref_raster.getBufferType()==INyARRaster.BUFFERFORMAT_INT1D_GRAY_8);\r
+ assert(i_ref_raster.getBufferType()==NyARBufferType.INT1D_GRAY_8);\r
this._ref_buf=(int[])(i_ref_raster.getBuffer());\r
this._ref_size=i_ref_raster.getSize();\r
}\r
protected final static int[] _getContour_ydir = {-1,-1, 0, 1, 1, 1, 0,-1 ,-1,-1, 0, 1, 1, 1, 0};\r
public int getContour(NyARBinRaster i_raster,int i_entry_x,int i_entry_y,int i_array_size,int[] o_coord_x,int[] o_coord_y) throws NyARException\r
{\r
- assert(i_raster.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_BIN_8));\r
+ assert(i_raster.isEqualBufferType(NyARBufferType.INT1D_BIN_8));\r
return impl_getContour(i_raster,0,i_entry_x,i_entry_y,i_array_size,o_coord_x,o_coord_y);\r
}\r
/**\r
*/\r
public int getContour(NyARGrayscaleRaster i_raster,int i_th,int i_entry_x,int i_entry_y,int i_array_size,int[] o_coord_x,int[] o_coord_y) throws NyARException\r
{\r
- assert(i_raster.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8));\r
+ assert(i_raster.isEqualBufferType(NyARBufferType.INT1D_GRAY_8));\r
return impl_getContour(i_raster,i_th,i_entry_x,i_entry_y,i_array_size,o_coord_x,o_coord_y);\r
}\r
\r
import jp.nyatla.nyartoolkit.NyARException;\r
import jp.nyatla.nyartoolkit.core.raster.NyARBinRaster;\r
\r
-public interface INyARSquareContourDetector\r
+public abstract class NyARSquareContourDetector\r
{\r
public interface DetectMarkerCallback\r
{\r
- public void onSquareDetect(INyARSquareContourDetector i_sender,int[] i_coordx,int[] i_coordy,int i_coor_num,int[] i_vertex_index) throws NyARException;\r
+ public void onSquareDetect(NyARSquareContourDetector i_sender,int[] i_coordx,int[] i_coordy,int i_coor_num,int[] i_vertex_index) throws NyARException;\r
}\r
/**\r
*\r
* @param o_square_stack\r
* @throws NyARException\r
*/\r
- public void detectMarkerCB(NyARBinRaster i_raster, DetectMarkerCallback i_callback) throws NyARException;\r
+ public abstract void detectMarkerCB(NyARBinRaster i_raster, DetectMarkerCallback i_callback) throws NyARException;\r
}\r
\r
\r
\r
\r
-public class NyARSquareContourDetector_ARToolKit implements INyARSquareContourDetector\r
+public class NyARSquareContourDetector_ARToolKit extends NyARSquareContourDetector\r
{\r
private static final int AR_AREA_MAX = 100000;// #define AR_AREA_MAX 100000\r
private static final int AR_AREA_MIN = 70;// #define AR_AREA_MIN 70\r
import java.util.*;\r
\r
\r
-public class NyARSquareContourDetector_Rle implements INyARSquareContourDetector\r
+public class NyARSquareContourDetector_Rle extends NyARSquareContourDetector\r
{\r
private static final int AR_AREA_MAX = 100000;// #define AR_AREA_MAX 100000\r
private static final int AR_AREA_MIN = 70;// #define AR_AREA_MIN 70\r
{\r
return Math.sqrt(this.x*this.x+this.y+this.y);\r
}\r
- public final double sqNorm()\r
- {\r
- return this.x*this.x+this.y+this.y;\r
- }\r
}\r
/**\r
* detectMarkerのコールバック関数\r
*/\r
- private class DetectSquareCB implements INyARSquareContourDetector.DetectMarkerCallback\r
+ private class DetectSquareCB implements NyARSquareContourDetector.DetectMarkerCallback\r
{\r
//公開プロパティ\r
public double confidence;\r
* 矩形が見付かるたびに呼び出されます。\r
* 発見した矩形のパターンを検査して、方位を考慮した頂点データを確保します。\r
*/\r
- public void onSquareDetect(INyARSquareContourDetector i_sender,int[] i_coordx,int[] i_coordy,int i_coor_num,int[] i_vertex_index) throws NyARException\r
+ public void onSquareDetect(NyARSquareContourDetector i_sender,int[] i_coordx,int[] i_coordy,int i_coor_num,int[] i_vertex_index) throws NyARException\r
{\r
NyARMatchPattResult mr=this.__detectMarkerLite_mr;\r
//輪郭座標から頂点リストに変換\r
}\r
\r
private boolean _is_continue = false;\r
- private INyARSquareContourDetector _square_detect;\r
+ private NyARSquareContourDetector _square_detect;\r
protected INyARTransMat _transmat;\r
//画処理用\r
private NyARBinRaster _bin_raster;\r
}\r
protected void initInstance(\r
INyARColorPatt i_patt_inst,\r
- INyARSquareContourDetector i_sqdetect_inst,\r
+ NyARSquareContourDetector i_sqdetect_inst,\r
INyARTransMat i_transmat_inst,\r
INyARRasterFilter_Rgb2Bin i_filter,\r
NyARParam i_ref_param,\r
import jp.nyatla.nyartoolkit.core.transmat.*;\r
import jp.nyatla.nyartoolkit.core.rasterfilter.rgb2bin.*;\r
import jp.nyatla.nyartoolkit.core.squaredetect.Coord2Linear;\r
-import jp.nyatla.nyartoolkit.core.squaredetect.INyARSquareContourDetector;\r
+import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquareContourDetector;\r
import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquare;\r
import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquareContourDetector_Rle;\r
import jp.nyatla.nyartoolkit.core.types.*;\r
/**\r
* detectMarkerのコールバック関数\r
*/\r
- private class DetectSquareCB implements INyARSquareContourDetector.DetectMarkerCallback\r
+ private class DetectSquareCB implements NyARSquareContourDetector.DetectMarkerCallback\r
{\r
//公開プロパティ\r
public NyARDetectMarkerResultStack result_stack=new NyARDetectMarkerResultStack(NyARDetectMarker.AR_SQUARE_MAX);\r
* 矩形が見付かるたびに呼び出されます。\r
* 発見した矩形のパターンを検査して、方位を考慮した頂点データを確保します。\r
*/\r
- public void onSquareDetect(INyARSquareContourDetector i_sender,int[] i_coordx,int[] i_coordy,int i_coor_num,int[] i_vertex_index) throws NyARException\r
+ public void onSquareDetect(NyARSquareContourDetector i_sender,int[] i_coordx,int[] i_coordy,int i_coor_num,int[] i_vertex_index) throws NyARException\r
{\r
NyARMatchPattResult mr=this.__detectMarkerLite_mr;\r
//輪郭座標から頂点リストに変換\r
\r
private static final int AR_SQUARE_MAX = 300;\r
private boolean _is_continue = false;\r
- private INyARSquareContourDetector _square_detect;\r
+ private NyARSquareContourDetector _square_detect;\r
protected INyARTransMat _transmat;\r
private NyARRectOffset[] _offset; \r
\r
{\r
final NyARRasterFilter_ARToolkitThreshold th=new NyARRasterFilter_ARToolkitThreshold(100,i_input_raster_type);\r
INyARColorPatt patt_inst;\r
- INyARSquareContourDetector sqdetect_inst;\r
+ NyARSquareContourDetector sqdetect_inst;\r
INyARTransMat transmat_inst;\r
\r
switch(i_profile_id){\r
/**\r
* detectMarkerのコールバック関数\r
*/\r
- private class DetectSquareCB implements INyARSquareContourDetector.DetectMarkerCallback\r
+ private class DetectSquareCB implements NyARSquareContourDetector.DetectMarkerCallback\r
{\r
//公開プロパティ\r
public final NyARSquare square=new NyARSquare();\r
* 矩形が見付かるたびに呼び出されます。\r
* 発見した矩形のパターンを検査して、方位を考慮した頂点データを確保します。\r
*/\r
- public void onSquareDetect(INyARSquareContourDetector i_sender,int[] i_coordx,int[] i_coordy,int i_coor_num,int[] i_vertex_index) throws NyARException\r
+ public void onSquareDetect(NyARSquareContourDetector i_sender,int[] i_coordx,int[] i_coordy,int i_coor_num,int[] i_vertex_index) throws NyARException\r
{\r
if (this._match_patt==null) {\r
return;\r
\r
private int _lost_delay = 5;\r
\r
- private INyARSquareContourDetector _square_detect;\r
+ private NyARSquareContourDetector _square_detect;\r
\r
protected INyARTransMat _transmat;\r
\r
protected void initInstance(NyARParam i_param,int i_raster_type) throws NyARException\r
{\r
//初期化済?\r
- assert this._initialized==false;\r
+ assert(this._initialized==false);\r
\r
NyARIntSize scr_size = i_param.getScreenSize();\r
// 解析オブジェクトを作る\r
/**\r
* detectMarkerのコールバック関数\r
*/\r
- private class DetectSquareCB implements INyARSquareContourDetector.DetectMarkerCallback\r
+ private class DetectSquareCB implements NyARSquareContourDetector.DetectMarkerCallback\r
{\r
//公開プロパティ\r
public final NyARSquare square=new NyARSquare();\r
* 矩形が見付かるたびに呼び出されます。\r
* 発見した矩形のパターンを検査して、方位を考慮した頂点データを確保します。\r
*/\r
- public void onSquareDetect(INyARSquareContourDetector i_sender,int[] i_coordx,int[] i_coordy,int i_coor_num,int[] i_vertex_index) throws NyARException\r
+ public void onSquareDetect(NyARSquareContourDetector i_sender,int[] i_coordx,int[] i_coordy,int i_coor_num,int[] i_vertex_index) throws NyARException\r
{\r
//既に発見済なら終了\r
if(this.marker_data!=null){\r
protected void initInstance(NyARParam i_param,INyIdMarkerDataEncoder i_encoder,int i_marker_width,int i_raster_format) throws NyARException\r
{\r
//初期化済?\r
- assert this._initialized==false;\r
+ assert(this._initialized==false);\r
\r
NyARIntSize scr_size = i_param.getScreenSize();\r
// 解析オブジェクトを作る\r
\r
public void drawImage(NyARGrayscaleRaster i_raster) throws NyARException\r
{\r
- assert (i_raster.getBufferType() == INyARRaster.BUFFERFORMAT_INT1D_GRAY_8);\r
+ assert (i_raster.getBufferType() == NyARBufferType.INT1D_GRAY_8);\r
\r
int w = this.getWidth();\r
int h = this.getHeight();\r
*/\r
public void drawImage(NyARBinRaster i_raster) throws NyARException\r
{\r
- assert (i_raster.getBufferType() == INyARRaster.BUFFERFORMAT_INT1D_BIN_8);\r
+ assert (i_raster.getBufferType() == NyARBufferType.INT1D_BIN_8);\r
\r
int w = this.getWidth();\r
int h = this.getHeight();\r
public static void copy(NyARGrayscaleRaster i_in,BufferedImage o_out) throws NyARException\r
{\r
assert i_in.getSize().isEqualSize(o_out.getWidth(), o_out.getHeight());\r
- if(i_in.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_GRAY_8))\r
+ if(i_in.isEqualBufferType(NyARBufferType.INT1D_GRAY_8))\r
{\r
final int[] buf=(int[])i_in.getBuffer();\r
final int w=o_out.getWidth();\r
public static void copy(INyARRaster i_in,BufferedImage o_out) throws NyARException\r
{\r
assert i_in.getSize().isEqualSize(o_out.getWidth(), o_out.getHeight());\r
- if(i_in.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_BIN_8))\r
+ if(i_in.isEqualBufferType(NyARBufferType.INT1D_BIN_8))\r
{\r
final int[] buf=(int[])i_in.getBuffer();\r
final int w=o_out.getWidth();\r
public static void copy(BufferedImage i_in,INyARRaster o_out) throws NyARException\r
{\r
assert o_out.getSize().isEqualSize(i_in.getWidth(), i_in.getHeight());\r
- if(o_out.isEqualBufferType(INyARRaster.BUFFERFORMAT_INT1D_BIN_8))\r
+ if(o_out.isEqualBufferType(NyARBufferType.INT1D_BIN_8))\r
{\r
final int[] buf=(int[])o_out.getBuffer();\r
final int w=i_in.getWidth();\r
import jp.nyatla.nyartoolkit.core.raster.*;
import jp.nyatla.nyartoolkit.core.raster.rgb.INyARRgbRaster;
import jp.nyatla.nyartoolkit.core.rasterfilter.*;
-import jp.nyatla.nyartoolkit.core2.rasteranalyzer.*;
-import jp.nyatla.nyartoolkit.core2.rasteranalyzer.threshold.*;
-import jp.nyatla.nyartoolkit.core2.rasterfilter.gs2bin.*;
-import jp.nyatla.nyartoolkit.core2.rasterfilter.rgb2gs.NyARRasterFilter_RgbAve;
-import jp.nyatla.utils.j2se.LabelingBufferdImage;
-import jp.nyatla.nyartoolkit.core.rasterfilter.bin.INyARRasterFilter_RgbToGs;
import jp.nyatla.nyartoolkit.core.rasterfilter.rgb2bin.*;
-import jp.nyatla.nyartoolkit.core.squaredetect.INyARSquareDetector;
import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquare;
import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquareStack;
-import jp.nyatla.nyartoolkit.core.squaredetect.NyARVertexCounter;
import jp.nyatla.nyartoolkit.core.transmat.*;
import jp.nyatla.nyartoolkit.core.types.*;
import jp.nyatla.nyartoolkit.core.types.matrix.NyARDoubleMatrix22;
import jp.nyatla.nyartoolkit.core.raster.*;\r
import jp.nyatla.nyartoolkit.core.raster.rgb.NyARRgbRaster_BGRA;\r
import jp.nyatla.nyartoolkit.core.rasterfilter.gs2bin.*;\r
-import jp.nyatla.nyartoolkit.core.rasterfilter.rgb2bin.NyARRasterFilterBuilder_RgbToBin;\r
import jp.nyatla.nyartoolkit.utils.j2se.*;\r
\r
\r
import jp.nyatla.nyartoolkit.NyARException;\r
import jp.nyatla.nyartoolkit.core.NyARCode;\r
import jp.nyatla.nyartoolkit.core.squaredetect.Coord2Linear;\r
-import jp.nyatla.nyartoolkit.core.squaredetect.INyARSquareContourDetector;\r
+import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquareContourDetector;\r
import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquare;\r
import jp.nyatla.nyartoolkit.core.types.*;\r
import jp.nyatla.nyartoolkit.core.types.matrix.NyARDoubleMatrix33;\r
/**\r
* detectMarkerのコールバック関数\r
*/\r
- private class DetectSquareCB implements INyARSquareContourDetector.DetectMarkerCallback\r
+ private class DetectSquareCB implements NyARSquareContourDetector.DetectMarkerCallback\r
{\r
//公開プロパティ\r
public NyARSquare square=new NyARSquare();\r
* 矩形が見付かるたびに呼び出されます。\r
* 発見した矩形のパターンを検査して、方位を考慮した頂点データを確保します。\r
*/\r
- public void onSquareDetect(INyARSquareContourDetector i_sender,int[] i_coordx,int[] i_coordy,int i_coor_num,int[] i_vertex_index) throws NyARException\r
+ public void onSquareDetect(NyARSquareContourDetector i_sender,int[] i_coordx,int[] i_coordy,int i_coor_num,int[] i_vertex_index) throws NyARException\r
{\r
//輪郭座標から頂点リストに変換\r
NyARIntPoint2d[] vertex=this.__tmp_vertex;\r
return index==-1?null:items[index];\r
} \r
}\r
- private INyARSquareContourDetector _square_detect;\r
+ private NyARSquareContourDetector _square_detect;\r
protected INyARTransMat _transmat;\r
//画処理用\r
private NyARBinRaster _bin_raster;\r
}\r
protected void initInstance(\r
INyARColorPatt i_patt_inst,\r
- INyARSquareContourDetector i_sqdetect_inst,\r
+ NyARSquareContourDetector i_sqdetect_inst,\r
INyARTransMat i_transmat_inst,\r
INyARRasterFilter_Rgb2Bin i_filter,\r
NyARParam i_ref_param,\r
import jp.nyatla.nyartoolkit.core.pickup.NyARColorPatt_Perspective_O2;\r
import jp.nyatla.nyartoolkit.core.raster.NyARBinRaster;\r
import jp.nyatla.nyartoolkit.core.rasterfilter.rgb2bin.*;\r
-import jp.nyatla.nyartoolkit.core.squaredetect.INyARSquareContourDetector;\r
+import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquareContourDetector;\r
import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquareContourDetector_Rle;\r
import jp.nyatla.nyartoolkit.core.squaredetect.NyARSquareStack;\r
import jp.nyatla.nyartoolkit.core.transmat.INyARTransMat;\r