Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
patch to add VRTAddComplexSourceComponent function Gdal c api, to mirror functionality of c++ api.
diff -u gdal-1.9.2/frmts/vrt/gdal_vrt.h gdal-modified/frmts/vrt/gdal_vrt.h
--- gdal-1.9.2/frmts/vrt/gdal_vrt.h 2012-10-08 17:58:25.000000000 -0700
+++ gdal-modified/frmts/vrt/gdal_vrt.h 2013-04-08 21:02:07.000000000 -0700
@@ -95,6 +95,12 @@
int, int, int, int,
int, int, int, int,
double, double, double );
+CPLErr CPL_DLL CPL_STDCALL VRTAddComplexSourceComponent( VRTSourcedRasterBandH,
+ GDALRasterBandH,
+ int, int, int, int,
+ int, int, int, int,
+ double, double, double,
+ int );
CPLErr CPL_DLL CPL_STDCALL VRTAddFuncSource( VRTSourcedRasterBandH,
VRTImageReadFunc,
void *, double );
diff -u gdal-1.9.2/frmts/vrt/vrtsourcedrasterband.cpp gdal-modified/frmts/vrt/vrtsourcedrasterband.cpp
--- gdal-1.9.2/frmts/vrt/vrtsourcedrasterband.cpp 2012-10-08 17:58:25.000000000 -0700
+++ gdal-modified/frmts/vrt/vrtsourcedrasterband.cpp 2013-04-08 21:05:53.000000000 -0700
@@ -736,6 +736,38 @@
dfNoDataValue );
}
+
+/************************************************************************/
+/* VRTAddComplexSourceCompont() */
+/************************************************************************/
+
+/**
+ * @see VRTSourcedRasterBand::AddComplexSource().
+ */
+
+CPLErr CPL_STDCALL VRTAddComplexSourceComponent( VRTSourcedRasterBandH hVRTBand,
+ GDALRasterBandH hSrcBand,
+ int nSrcXOff, int nSrcYOff,
+ int nSrcXSize, int nSrcYSize,
+ int nDstXOff, int nDstYOff,
+ int nDstXSize, int nDstYSize,
+ double dfScaleOff,
+ double dfScaleRatio,
+ double dfNoDataValue,
+ int nColorTableComponent )
+{
+ VALIDATE_POINTER1( hVRTBand, "VRTAddComplexSource", CE_Failure );
+
+ return ((VRTSourcedRasterBand *) hVRTBand)->AddComplexSource(
+ (GDALRasterBand *)hSrcBand,
+ nSrcXOff, nSrcYOff,
+ nSrcXSize, nSrcYSize,
+ nDstXOff, nDstYOff,
+ nDstXSize, nDstYSize,
+ dfScaleOff, dfScaleRatio,
+ dfNoDataValue, nColorTableComponent );
+}
+
/************************************************************************/
/* AddFuncSource() */
/************************************************************************/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.