Esempio n. 1
0
        /**
         * @param i_width
         * @param i_height
         */
        public NyARColorPatt_PseudoAffine(int i_width, int i_height)
        {
            this._size        = new NyARIntSize(i_width, i_height);
            this._patdata     = new int[i_height * i_width];
            this._pixelreader = new NyARRgbPixelReader_INT1D_X8R8G8B8_32(this._patdata, this._size);
            //疑似アフィン変換のパラメタマトリクスを計算します。
            //長方形から計算すると、有効要素がm00,m01,m02,m03,m10,m11,m20,m23,m30になります。
            NyARDoubleMatrix44 mat = this._invmat;

            mat.m00 = 0;
            mat.m01 = 0;
            mat.m02 = 0;
            mat.m03 = 1.0;
            mat.m10 = 0;
            mat.m11 = i_width - 1;
            mat.m12 = 0;
            mat.m13 = 1.0;
            mat.m20 = (i_width - 1) * (i_height - 1);
            mat.m21 = i_width - 1;
            mat.m22 = i_height - 1;
            mat.m23 = 1.0;
            mat.m30 = 0;
            mat.m31 = 0;
            mat.m32 = i_height - 1;
            mat.m33 = 1.0;
            mat.inverse(mat);
            return;
        }
 private void initializeInstance(int i_width, int i_height, int i_point_per_pix)
 {
     Debug.Assert(i_width > 2 && i_height > 2);
     this._size        = new NyARIntSize(i_width, i_height);
     this._patdata     = new int[i_height * i_width];
     this._pixelreader = new NyARRgbPixelReader_INT1D_X8R8G8B8_32(this._patdata, this._size);
     return;
 }
	    private void initializeInstance(int i_width, int i_height,int i_point_per_pix)
	    {
		    Debug.Assert(i_width>2 && i_height>2);
		    this._resolution=i_point_per_pix;	
		    this._size=new NyARIntSize(i_width,i_height);
		    this._patdata = new int[i_height*i_width];
		    this._pixelreader=new NyARRgbPixelReader_INT1D_X8R8G8B8_32(this._patdata,this._size);
		    return;		
	    }
 private void initializeInstance(int i_width, int i_height, int i_point_per_pix, int i_input_raster_type)
 {
     Debug.Assert(i_width > 2 && i_height > 2);
     this._resolution         = i_point_per_pix;
     this._size               = new NyARIntSize(i_width, i_height);
     this._patdata            = new int[i_height * i_width];
     this._pixelreader        = new NyARRgbPixelReader_INT1D_X8R8G8B8_32(this._patdata, this._size);
     this._perspective_reader = new NyARPerspectiveRasterReader(i_input_raster_type);
     return;
 }
	    /**
	     * @param i_width
	     * @param i_height
	     */
	    public NyARColorPatt_PseudoAffine(int i_width, int i_height)
	    {		
		    this._size=new NyARIntSize(i_width,i_height);
		    this._patdata = new int[i_height*i_width];
		    this._pixelreader=new NyARRgbPixelReader_INT1D_X8R8G8B8_32(this._patdata,this._size);
		    //疑似アフィン変換のパラメタマトリクスを計算します。
		    //長方形から計算すると、有効要素がm00,m01,m02,m03,m10,m11,m20,m23,m30になります。
		    NyARDoubleMatrix44 mat=this._invmat;
		    mat.m00=0;
		    mat.m01=0;
		    mat.m02=0;
		    mat.m03=1.0;
		    mat.m10=0;
		    mat.m11=i_width-1;
		    mat.m12=0;
		    mat.m13=1.0;
		    mat.m20=(i_width-1)*(i_height-1);
		    mat.m21=i_width-1;
		    mat.m22=i_height-1;
		    mat.m23=1.0;
		    mat.m30=0;
		    mat.m31=0;
		    mat.m32=i_height-1;
		    mat.m33=1.0;
		    mat.inverse(mat);
		    return;
	    }