NyARUnityUtils.NyARUnityRaster.createInterface C# (CSharp) Method

createInterface() public method

public createInterface ( Type iIid ) : object
iIid System.Type
return object
        public override object createInterface(Type iIid)
        {
            if (iIid == typeof(INyARPerspectiveCopy))
            {
                return new PerspectiveCopy_Unity(this,this._is_inverse);
            }
            if (iIid == typeof(NyARMatchPattDeviationColorData.IRasterDriver))
            {
                //should be implement!
            }
            if (iIid == typeof(INyARRgb2GsFilter))
            {
                return new NyARRgb2GsFilterRgbAve_UnityRaster(this,this._is_inverse);
            }
            else if (iIid == typeof(INyARRgb2GsFilterRgbAve))
            {
                return new NyARRgb2GsFilterRgbAve_UnityRaster(this,this._is_inverse);
            }
            else if (iIid == typeof(INyARRgb2GsFilterArtkTh))
            {
                //may be implement?
            }
            return base.createInterface(iIid);
        }

Usage Example

 /** <summary>
 * {@link #addARMarker(INyARRgbRaster, int, int, double)}It is a wrapper. I make a marker pattern from Bitmap.
 * The arguments are{@link #addARMarker(INyARRgbRaster, int, int, double)}Please refer to the.
 *
 * </summary>
 * <param name="i_img"></param>
 * <param name="i_patt_resolution">I specify the resolution of the marker to be generated.</param>
 * <param name="i_patt_edge_percentage">Specifies the percentage of the edge region of the image.</param>
 * <param name="i_marker_size">I specify the physical size of the marker.</param>
 * <returns></returns>
 **/
 public int addARMarker(Texture2D i_img, int i_patt_resolution, int i_patt_edge_percentage, double i_marker_size)
 {
     int w = i_img.width;
     int h = i_img.height;
     NyARUnityRaster ur = new NyARUnityRaster(i_img);
     NyARCode c = new NyARCode(i_patt_resolution, i_patt_resolution);
     //Marker pattern cut out from a raster
     INyARPerspectiveCopy pc = (INyARPerspectiveCopy)ur.createInterface(typeof(INyARPerspectiveCopy));
     NyARRgbRaster tr = new NyARRgbRaster(i_patt_resolution, i_patt_resolution);
     pc.copyPatt(0, 0, w, 0, w, h, 0, h, i_patt_edge_percentage, i_patt_edge_percentage, 4, tr);
     //Set the pattern cut
     c.setRaster(tr);
     return base.addARMarker(c, i_patt_edge_percentage, i_marker_size);
 }
All Usage Examples Of NyARUnityUtils.NyARUnityRaster::createInterface