public void doFilter(INyARRgbRaster i_input, NyARGrayscaleRaster i_output)
        {
            Debug.Assert(i_input.getSize().isEqualSize(i_output.getSize()) == true);
            NyARIntSize s = i_input.getSize();

            this._do_filter_impl.doFilter(i_input, (int[])i_output.getBuffer(), 0, 0, s.w, s.h);
            return;
        }
            public void doCutFilter(INyARRaster i_input, int l, int t, int i_st, NyARGrayscaleRaster o_output)
            {
                Debug.Assert(i_input.isEqualBufferType(NyARBufferType.BYTE1D_B8G8R8_24) || i_input.isEqualBufferType(NyARBufferType.BYTE1D_R8G8B8_24));
                Debug.Assert(i_input.getSize().isInnerSize(l + o_output.getWidth() * i_st, t + o_output.getHeight() * i_st));

                byte[]      input = (byte[])i_input.getBuffer();
                int[]       output = (int[])o_output.getBuffer();
                int         pt_src, pt_dst;
                NyARIntSize dest_size    = o_output.getSize();
                NyARIntSize src_size     = i_input.getSize();
                int         skip_src_y   = (src_size.w - dest_size.w * i_st) * 3 + src_size.w * (i_st - 1) * 3;
                int         skip_src_x   = 3 * i_st;
                int         pix_count    = dest_size.w;
                int         pix_mod_part = pix_count - (pix_count % 8);

                //左上から1行づつ走査していく
                pt_dst = 0;
                pt_src = (t * src_size.w + l) * 3;
                for (int y = dest_size.h - 1; y >= 0; y -= 1)
                {
                    int x;
                    for (x = pix_count - 1; x >= pix_mod_part; x--)
                    {
                        output[pt_dst++] = ((input[pt_src + 0] & 0xff) + (input[pt_src + 1] & 0xff) + (input[pt_src + 2] & 0xff)) >> 2;
                        pt_src          += skip_src_x;
                    }
                    for (; x >= 0; x -= 8)
                    {
                        output[pt_dst++] = ((input[pt_src + 0] & 0xff) + (input[pt_src + 1] & 0xff) + (input[pt_src + 2] & 0xff)) >> 2;
                        pt_src          += skip_src_x;
                        output[pt_dst++] = ((input[pt_src + 0] & 0xff) + (input[pt_src + 1] & 0xff) + (input[pt_src + 2] & 0xff)) >> 2;
                        pt_src          += skip_src_x;
                        output[pt_dst++] = ((input[pt_src + 0] & 0xff) + (input[pt_src + 1] & 0xff) + (input[pt_src + 2] & 0xff)) >> 2;
                        pt_src          += skip_src_x;
                        output[pt_dst++] = ((input[pt_src + 0] & 0xff) + (input[pt_src + 1] & 0xff) + (input[pt_src + 2] & 0xff)) >> 2;
                        pt_src          += skip_src_x;
                        output[pt_dst++] = ((input[pt_src + 0] & 0xff) + (input[pt_src + 1] & 0xff) + (input[pt_src + 2] & 0xff)) >> 2;
                        pt_src          += skip_src_x;
                        output[pt_dst++] = ((input[pt_src + 0] & 0xff) + (input[pt_src + 1] & 0xff) + (input[pt_src + 2] & 0xff)) >> 2;
                        pt_src          += skip_src_x;
                        output[pt_dst++] = ((input[pt_src + 0] & 0xff) + (input[pt_src + 1] & 0xff) + (input[pt_src + 2] & 0xff)) >> 2;
                        pt_src          += skip_src_x;
                        output[pt_dst++] = ((input[pt_src + 0] & 0xff) + (input[pt_src + 1] & 0xff) + (input[pt_src + 2] & 0xff)) >> 2;
                        pt_src          += skip_src_x;
                    }
                    //スキップ
                    pt_src += skip_src_y;
                }
                return;
            }
            public void copyTo(NyARGrayscaleRaster i_input, int i_left, int i_top, int i_skip, NyARGrayscaleRaster o_output)
            {
                Debug.Assert(i_input.getSize().isInnerSize(i_left + o_output.getWidth() * i_skip, i_top + o_output.getHeight() * i_skip));
                int[]       input = (int[])i_input.getBuffer();
                int[]       output = (int[])o_output.getBuffer();
                int         pt_src, pt_dst;
                NyARIntSize dest_size    = o_output.getSize();
                NyARIntSize src_size     = i_input.getSize();
                int         skip_src_y   = (src_size.w - dest_size.w * i_skip) + src_size.w * (i_skip - 1);
                int         pix_count    = dest_size.w;
                int         pix_mod_part = pix_count - (pix_count % 8);

                // 左上から1行づつ走査していく
                pt_dst = 0;
                pt_src = (i_top * src_size.w + i_left);
                for (int y = dest_size.h - 1; y >= 0; y -= 1)
                {
                    int x;
                    for (x = pix_count - 1; x >= pix_mod_part; x--)
                    {
                        output[pt_dst++] = input[pt_src];
                        pt_src          += i_skip;
                    }
                    for (; x >= 0; x -= 8)
                    {
                        output[pt_dst++] = input[pt_src];
                        pt_src          += i_skip;
                        output[pt_dst++] = input[pt_src];
                        pt_src          += i_skip;
                        output[pt_dst++] = input[pt_src];
                        pt_src          += i_skip;
                        output[pt_dst++] = input[pt_src];
                        pt_src          += i_skip;
                        output[pt_dst++] = input[pt_src];
                        pt_src          += i_skip;
                        output[pt_dst++] = input[pt_src];
                        pt_src          += i_skip;
                        output[pt_dst++] = input[pt_src];
                        pt_src          += i_skip;
                        output[pt_dst++] = input[pt_src];
                        pt_src          += i_skip;
                    }
                    // スキップ
                    pt_src += skip_src_y;
                }
                return;
            }
        public void doFilter(NyARGrayscaleRaster i_input, NyARBinRaster i_output)
        {
            Debug.Assert(i_input.getBufferType() == NyARBufferType.INT1D_GRAY_8);
            Debug.Assert(i_output.getBufferType() == NyARBufferType.INT1D_BIN_8);
            int[]       out_buf = (int[])i_output.getBuffer();
            int[]       in_buf  = (int[])i_input.getBuffer();
            NyARIntSize s       = i_input.getSize();

            int th           = this._threshold;
            int bp           = s.w * s.h - 1;
            int pix_count    = s.h * s.w;
            int pix_mod_part = pix_count - (pix_count % 8);

            for (bp = pix_count - 1; bp >= pix_mod_part; bp--)
            {
                out_buf[bp] = (in_buf[bp] & 0xff) <= th?0:1;
            }
            //タイリング
            for (; bp >= 0;)
            {
                out_buf[bp] = (in_buf[bp] & 0xff) <= th?0:1;
                bp--;
                out_buf[bp] = (in_buf[bp] & 0xff) <= th?0:1;
                bp--;
                out_buf[bp] = (in_buf[bp] & 0xff) <= th?0:1;
                bp--;
                out_buf[bp] = (in_buf[bp] & 0xff) <= th?0:1;
                bp--;
                out_buf[bp] = (in_buf[bp] & 0xff) <= th?0:1;
                bp--;
                out_buf[bp] = (in_buf[bp] & 0xff) <= th?0:1;
                bp--;
                out_buf[bp] = (in_buf[bp] & 0xff) <= th?0:1;
                bp--;
                out_buf[bp] = (in_buf[bp] & 0xff) <= th?0:1;
                bp--;
            }
            return;
        }
	    public void doFilter(NyARGrayscaleRaster i_input, NyARBinRaster i_output)
	    {
		    Debug.Assert(i_input.getBufferType()==NyARBufferType.INT1D_GRAY_8);
		    Debug.Assert(i_output.getBufferType()==NyARBufferType.INT1D_BIN_8);
		    int[] out_buf = (int[]) i_output.getBuffer();
		    int[] in_buf = (int[]) i_input.getBuffer();
		    NyARIntSize s=i_input.getSize();
    		
		    int th=this._threshold;
		    int bp =s.w*s.h-1;
		    int pix_count   =s.h*s.w;
		    int pix_mod_part=pix_count-(pix_count%8);
		    for(bp=pix_count-1;bp>=pix_mod_part;bp--){
			    out_buf[bp]=(in_buf[bp] & 0xff)<=th?0:1;
		    }
		    //タイリング
		    for (;bp>=0;) {
			    out_buf[bp]=(in_buf[bp] & 0xff)<=th?0:1;
			    bp--;
			    out_buf[bp]=(in_buf[bp] & 0xff)<=th?0:1;
			    bp--;
			    out_buf[bp]=(in_buf[bp] & 0xff)<=th?0:1;
			    bp--;
			    out_buf[bp]=(in_buf[bp] & 0xff)<=th?0:1;
			    bp--;
			    out_buf[bp]=(in_buf[bp] & 0xff)<=th?0:1;
			    bp--;
			    out_buf[bp]=(in_buf[bp] & 0xff)<=th?0:1;
			    bp--;
			    out_buf[bp]=(in_buf[bp] & 0xff)<=th?0:1;
			    bp--;
			    out_buf[bp]=(in_buf[bp] & 0xff)<=th?0:1;
			    bp--;
		    }
		    return;			
	    }
	    /**
	     * GS画像をセットします。
	     * この関数を使ってセットした画像は、インスタンスから参照されます。
	     * @param i_ref_source
	     * @throws NyARException 
	     */
	    public void wrapBuffer(NyARGrayscaleRaster i_ref_source)
	    {
		    //バッファのスイッチ
		    this._base_raster.wrapBuffer(i_ref_source.getBuffer());
	    }
 /**
  * 同一サイズのラスタi_inputとi_outputの間で、一部の領域だけにラスタ処理を実行します。
  * @param i_input
  * @param i_rect
  * @param i_output
  * @throws NyARException
  */
 public void doFilter(INyARRgbRaster i_input, NyARIntRect i_rect, NyARGrayscaleRaster i_output)
 {
     Debug.Assert(i_input.getSize().isEqualSize(i_output.getSize()) == true);
     this._do_filter_impl.doFilter(i_input, (int[])i_output.getBuffer(), i_rect.x, i_rect.y, i_rect.w, i_rect.h);
 }