示例#1
0
 public static HandleRef getCPtrAndSetReference(RasterIOExtraArg obj, object parent)
 {
     if (obj != null)
     {
         obj.swigParentRef = parent;
         return(obj.swigCPtr);
     }
     else
     {
         return(new HandleRef(null, IntPtr.Zero));
     }
 }
示例#2
0
        public CPLErr WriteRaster(int xOff, int yOff, int xSize, int ySize, IntPtr buffer, int buf_xSize, int buf_ySize, DataType buf_type, int pixelSpace, int lineSpace, RasterIOExtraArg extraArg)
        {
            CPLErr ret = (CPLErr)GdalPINVOKE.Band_WriteRaster__SWIG_1(swigCPtr, xOff, yOff, xSize, ySize, buffer, buf_xSize, buf_ySize, (int)buf_type, pixelSpace, lineSpace, RasterIOExtraArg.getCPtr(extraArg));

            if (GdalPINVOKE.SWIGPendingException.Pending)
            {
                throw GdalPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
示例#3
0
        public CPLErr WriteRaster(int xOff, int yOff, int xSize, int ySize, double[] buffer, int buf_xSize, int buf_ySize, int pixelSpace, int lineSpace, RasterIOExtraArg extraArg)
        {
            CPLErr   retval;
            GCHandle handle = GCHandle.Alloc(buffer, GCHandleType.Pinned);

            try {
                retval = WriteRaster(xOff, yOff, xSize, ySize, handle.AddrOfPinnedObject(), buf_xSize, buf_ySize, DataType.GDT_Float64, pixelSpace, lineSpace, extraArg);
            } finally {
                handle.Free();
            }
            GC.KeepAlive(this);
            return(retval);
        }
示例#4
0
 public static HandleRef getCPtr(RasterIOExtraArg obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }
示例#5
0
        public CPLErr ReadRaster(int xOff, int yOff, int xSize, int ySize, int[] buffer, int buf_xSize, int buf_ySize,
                                 int bandCount, int[] bandMap, int pixelSpace, int lineSpace, int bandSpace, RasterIOExtraArg extraArg)
        {
            CPLErr   retval;
            GCHandle handle = GCHandle.Alloc(buffer, GCHandleType.Pinned);

            try {
                retval = ReadRaster(xOff, yOff, xSize, ySize, handle.AddrOfPinnedObject(), buf_xSize, buf_ySize, DataType.GDT_Int32,
                                    bandCount, bandMap, pixelSpace, lineSpace, bandSpace, extraArg);
            } finally {
                handle.Free();
            }
            GC.KeepAlive(this);
            return(retval);
        }