gooderp18绿色标准版
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

654 lines
26KB

  1. /******************************************************************************
  2. * $Id: gdal_alg.h 8e5eeb35bf76390e3134a4ea7076dab7d478ea0e 2018-11-14 22:55:13 +0100 Even Rouault $
  3. *
  4. * Project: GDAL Image Processing Algorithms
  5. * Purpose: Prototypes, and definitions for various GDAL based algorithms.
  6. * Author: Frank Warmerdam, warmerdam@pobox.com
  7. *
  8. ******************************************************************************
  9. * Copyright (c) 2001, Frank Warmerdam
  10. * Copyright (c) 2008-2012, Even Rouault <even dot rouault at mines-paris dot org>
  11. *
  12. * Permission is hereby granted, free of charge, to any person obtaining a
  13. * copy of this software and associated documentation files (the "Software"),
  14. * to deal in the Software without restriction, including without limitation
  15. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  16. * and/or sell copies of the Software, and to permit persons to whom the
  17. * Software is furnished to do so, subject to the following conditions:
  18. *
  19. * The above copyright notice and this permission notice shall be included
  20. * in all copies or substantial portions of the Software.
  21. *
  22. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  23. * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  24. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  25. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  26. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  27. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  28. * DEALINGS IN THE SOFTWARE.
  29. ****************************************************************************/
  30. #ifndef GDAL_ALG_H_INCLUDED
  31. #define GDAL_ALG_H_INCLUDED
  32. /**
  33. * \file gdal_alg.h
  34. *
  35. * Public (C callable) GDAL algorithm entry points, and definitions.
  36. */
  37. #ifndef DOXYGEN_SKIP
  38. #include "gdal.h"
  39. #include "cpl_minixml.h"
  40. #include "ogr_api.h"
  41. #endif
  42. CPL_C_START
  43. int CPL_DLL CPL_STDCALL GDALComputeMedianCutPCT( GDALRasterBandH hRed,
  44. GDALRasterBandH hGreen,
  45. GDALRasterBandH hBlue,
  46. int (*pfnIncludePixel)(int,int,void*),
  47. int nColors,
  48. GDALColorTableH hColorTable,
  49. GDALProgressFunc pfnProgress,
  50. void * pProgressArg );
  51. int CPL_DLL CPL_STDCALL GDALDitherRGB2PCT( GDALRasterBandH hRed,
  52. GDALRasterBandH hGreen,
  53. GDALRasterBandH hBlue,
  54. GDALRasterBandH hTarget,
  55. GDALColorTableH hColorTable,
  56. GDALProgressFunc pfnProgress,
  57. void * pProgressArg );
  58. int CPL_DLL CPL_STDCALL GDALChecksumImage( GDALRasterBandH hBand,
  59. int nXOff, int nYOff, int nXSize, int nYSize );
  60. CPLErr CPL_DLL CPL_STDCALL
  61. GDALComputeProximity( GDALRasterBandH hSrcBand,
  62. GDALRasterBandH hProximityBand,
  63. char **papszOptions,
  64. GDALProgressFunc pfnProgress,
  65. void * pProgressArg );
  66. CPLErr CPL_DLL CPL_STDCALL
  67. GDALFillNodata( GDALRasterBandH hTargetBand,
  68. GDALRasterBandH hMaskBand,
  69. double dfMaxSearchDist,
  70. int bDeprecatedOption,
  71. int nSmoothingIterations,
  72. char **papszOptions,
  73. GDALProgressFunc pfnProgress,
  74. void * pProgressArg );
  75. CPLErr CPL_DLL CPL_STDCALL
  76. GDALPolygonize( GDALRasterBandH hSrcBand,
  77. GDALRasterBandH hMaskBand,
  78. OGRLayerH hOutLayer, int iPixValField,
  79. char **papszOptions,
  80. GDALProgressFunc pfnProgress,
  81. void * pProgressArg );
  82. CPLErr CPL_DLL CPL_STDCALL
  83. GDALFPolygonize( GDALRasterBandH hSrcBand,
  84. GDALRasterBandH hMaskBand,
  85. OGRLayerH hOutLayer, int iPixValField,
  86. char **papszOptions,
  87. GDALProgressFunc pfnProgress,
  88. void * pProgressArg );
  89. CPLErr CPL_DLL CPL_STDCALL
  90. GDALSieveFilter( GDALRasterBandH hSrcBand, GDALRasterBandH hMaskBand,
  91. GDALRasterBandH hDstBand,
  92. int nSizeThreshold, int nConnectedness,
  93. char **papszOptions,
  94. GDALProgressFunc pfnProgress,
  95. void * pProgressArg );
  96. /*
  97. * Warp Related.
  98. */
  99. typedef int
  100. (*GDALTransformerFunc)( void *pTransformerArg,
  101. int bDstToSrc, int nPointCount,
  102. double *x, double *y, double *z, int *panSuccess );
  103. /*! @cond Doxygen_Suppress */
  104. #define GDAL_GTI2_SIGNATURE "GTI2"
  105. typedef struct {
  106. GByte abySignature[4];
  107. const char *pszClassName;
  108. GDALTransformerFunc pfnTransform;
  109. void (*pfnCleanup)( void * pTransformerArg );
  110. CPLXMLNode *(*pfnSerialize)( void * pTransformerArg );
  111. void* (*pfnCreateSimilar)( void* pTransformerArg, double dfSrcRatioX, double dfSrcRatioY );
  112. } GDALTransformerInfo;
  113. /*! @endcond */
  114. /*! @cond Doxygen_Suppress */
  115. void CPL_DLL GDALDestroyTransformer( void *pTransformerArg );
  116. int CPL_DLL GDALUseTransformer( void *pTransformerArg,
  117. int bDstToSrc, int nPointCount,
  118. double *x, double *y, double *z,
  119. int *panSuccess );
  120. void* GDALCreateSimilarTransformer( void* psTransformerArg, double dfSrcRatioX, double dfSrcRatioY );
  121. /*! @endcond */
  122. /* High level transformer for going from image coordinates on one file
  123. to image coordinates on another, potentially doing reprojection,
  124. utilizing GCPs or using the geotransform. */
  125. void CPL_DLL *
  126. GDALCreateGenImgProjTransformer( GDALDatasetH hSrcDS, const char *pszSrcWKT,
  127. GDALDatasetH hDstDS, const char *pszDstWKT,
  128. int bGCPUseOK, double dfGCPErrorThreshold,
  129. int nOrder );
  130. void CPL_DLL *
  131. GDALCreateGenImgProjTransformer2( GDALDatasetH hSrcDS, GDALDatasetH hDstDS,
  132. char **papszOptions );
  133. void CPL_DLL *
  134. GDALCreateGenImgProjTransformer3( const char *pszSrcWKT,
  135. const double *padfSrcGeoTransform,
  136. const char *pszDstWKT,
  137. const double *padfDstGeoTransform );
  138. void CPL_DLL *
  139. GDALCreateGenImgProjTransformer4( OGRSpatialReferenceH hSrcSRS,
  140. const double *padfSrcGeoTransform,
  141. OGRSpatialReferenceH hDstSRS,
  142. const double *padfDstGeoTransform,
  143. const char* const *papszOptions );
  144. void CPL_DLL GDALSetGenImgProjTransformerDstGeoTransform( void *,
  145. const double * );
  146. void CPL_DLL GDALDestroyGenImgProjTransformer( void * );
  147. int CPL_DLL GDALGenImgProjTransform(
  148. void *pTransformArg, int bDstToSrc, int nPointCount,
  149. double *x, double *y, double *z, int *panSuccess );
  150. void GDALSetTransformerDstGeoTransform( void *, const double * );
  151. void GDALGetTransformerDstGeoTransform( void*, double* );
  152. /* Geo to geo reprojection transformer. */
  153. void CPL_DLL *
  154. GDALCreateReprojectionTransformer( const char *pszSrcWKT,
  155. const char *pszDstWKT );
  156. void CPL_DLL *
  157. GDALCreateReprojectionTransformerEx(
  158. OGRSpatialReferenceH hSrcSRS,
  159. OGRSpatialReferenceH hDstSRS,
  160. const char* const *papszOptions);
  161. void CPL_DLL GDALDestroyReprojectionTransformer( void * );
  162. int CPL_DLL GDALReprojectionTransform(
  163. void *pTransformArg, int bDstToSrc, int nPointCount,
  164. double *x, double *y, double *z, int *panSuccess );
  165. /* GCP based transformer ... forward is to georef coordinates */
  166. void CPL_DLL *
  167. GDALCreateGCPTransformer( int nGCPCount, const GDAL_GCP *pasGCPList,
  168. int nReqOrder, int bReversed );
  169. /* GCP based transformer with refinement of the GCPs ... forward is to georef coordinates */
  170. void CPL_DLL *
  171. GDALCreateGCPRefineTransformer( int nGCPCount, const GDAL_GCP *pasGCPList,
  172. int nReqOrder, int bReversed, double tolerance, int minimumGcps);
  173. void CPL_DLL GDALDestroyGCPTransformer( void *pTransformArg );
  174. int CPL_DLL GDALGCPTransform(
  175. void *pTransformArg, int bDstToSrc, int nPointCount,
  176. double *x, double *y, double *z, int *panSuccess );
  177. /* Thin Plate Spine transformer ... forward is to georef coordinates */
  178. void CPL_DLL *
  179. GDALCreateTPSTransformer( int nGCPCount, const GDAL_GCP *pasGCPList,
  180. int bReversed );
  181. void CPL_DLL GDALDestroyTPSTransformer( void *pTransformArg );
  182. int CPL_DLL GDALTPSTransform(
  183. void *pTransformArg, int bDstToSrc, int nPointCount,
  184. double *x, double *y, double *z, int *panSuccess );
  185. /*! @cond Doxygen_Suppress */
  186. char CPL_DLL ** RPCInfoToMD( GDALRPCInfo *psRPCInfo );
  187. /*! @endcond */
  188. /* RPC based transformer ... src is pixel/line/elev, dst is long/lat/elev */
  189. void CPL_DLL *
  190. GDALCreateRPCTransformer( GDALRPCInfo *psRPC, int bReversed,
  191. double dfPixErrThreshold,
  192. char **papszOptions );
  193. void CPL_DLL GDALDestroyRPCTransformer( void *pTransformArg );
  194. int CPL_DLL GDALRPCTransform(
  195. void *pTransformArg, int bDstToSrc, int nPointCount,
  196. double *x, double *y, double *z, int *panSuccess );
  197. /* Geolocation transformer */
  198. void CPL_DLL *
  199. GDALCreateGeoLocTransformer( GDALDatasetH hBaseDS,
  200. char **papszGeolocationInfo,
  201. int bReversed );
  202. void CPL_DLL GDALDestroyGeoLocTransformer( void *pTransformArg );
  203. int CPL_DLL GDALGeoLocTransform(
  204. void *pTransformArg, int bDstToSrc, int nPointCount,
  205. double *x, double *y, double *z, int *panSuccess );
  206. /* Approximate transformer */
  207. void CPL_DLL *
  208. GDALCreateApproxTransformer( GDALTransformerFunc pfnRawTransformer,
  209. void *pRawTransformerArg, double dfMaxError );
  210. void CPL_DLL GDALApproxTransformerOwnsSubtransformer( void *pCBData,
  211. int bOwnFlag );
  212. void CPL_DLL GDALDestroyApproxTransformer( void *pApproxArg );
  213. int CPL_DLL GDALApproxTransform(
  214. void *pTransformArg, int bDstToSrc, int nPointCount,
  215. double *x, double *y, double *z, int *panSuccess );
  216. int CPL_DLL CPL_STDCALL
  217. GDALSimpleImageWarp( GDALDatasetH hSrcDS,
  218. GDALDatasetH hDstDS,
  219. int nBandCount, int *panBandList,
  220. GDALTransformerFunc pfnTransform,
  221. void *pTransformArg,
  222. GDALProgressFunc pfnProgress,
  223. void *pProgressArg,
  224. char **papszWarpOptions );
  225. CPLErr CPL_DLL CPL_STDCALL
  226. GDALSuggestedWarpOutput( GDALDatasetH hSrcDS,
  227. GDALTransformerFunc pfnTransformer,
  228. void *pTransformArg,
  229. double *padfGeoTransformOut,
  230. int *pnPixels, int *pnLines );
  231. CPLErr CPL_DLL CPL_STDCALL
  232. GDALSuggestedWarpOutput2( GDALDatasetH hSrcDS,
  233. GDALTransformerFunc pfnTransformer,
  234. void *pTransformArg,
  235. double *padfGeoTransformOut,
  236. int *pnPixels, int *pnLines,
  237. double *padfExtents,
  238. int nOptions );
  239. /*! @cond Doxygen_Suppress */
  240. CPLXMLNode CPL_DLL *
  241. GDALSerializeTransformer( GDALTransformerFunc pfnFunc, void *pTransformArg );
  242. CPLErr CPL_DLL GDALDeserializeTransformer( CPLXMLNode *psTree,
  243. GDALTransformerFunc *ppfnFunc,
  244. void **ppTransformArg );
  245. /*! @endcond */
  246. CPLErr CPL_DLL
  247. GDALTransformGeolocations( GDALRasterBandH hXBand,
  248. GDALRasterBandH hYBand,
  249. GDALRasterBandH hZBand,
  250. GDALTransformerFunc pfnTransformer,
  251. void *pTransformArg,
  252. GDALProgressFunc pfnProgress,
  253. void *pProgressArg,
  254. char **papszOptions );
  255. /* -------------------------------------------------------------------- */
  256. /* Contour Line Generation */
  257. /* -------------------------------------------------------------------- */
  258. /** Contour writer callback type */
  259. typedef CPLErr (*GDALContourWriter)( double dfLevel, int nPoints,
  260. double *padfX, double *padfY, void * );
  261. /** Contour generator opaque type */
  262. typedef void *GDALContourGeneratorH;
  263. GDALContourGeneratorH CPL_DLL
  264. GDAL_CG_Create( int nWidth, int nHeight,
  265. int bNoDataSet, double dfNoDataValue,
  266. double dfContourInterval, double dfContourBase,
  267. GDALContourWriter pfnWriter, void *pCBData );
  268. CPLErr CPL_DLL GDAL_CG_FeedLine( GDALContourGeneratorH hCG,
  269. double *padfScanline );
  270. void CPL_DLL GDAL_CG_Destroy( GDALContourGeneratorH hCG );
  271. /*! @cond Doxygen_Suppress */
  272. typedef struct
  273. {
  274. void *hLayer;
  275. double adfGeoTransform[6];
  276. int nElevField;
  277. int nElevFieldMin;
  278. int nElevFieldMax;
  279. int nIDField;
  280. int nNextID;
  281. } OGRContourWriterInfo;
  282. CPLErr CPL_DLL
  283. OGRContourWriter( double, int, double *, double *, void *pInfo );
  284. /*! @endcond */
  285. CPLErr CPL_DLL
  286. GDALContourGenerate( GDALRasterBandH hBand,
  287. double dfContourInterval, double dfContourBase,
  288. int nFixedLevelCount, double *padfFixedLevels,
  289. int bUseNoData, double dfNoDataValue,
  290. void *hLayer, int iIDField, int iElevField,
  291. GDALProgressFunc pfnProgress, void *pProgressArg );
  292. CPLErr CPL_DLL
  293. GDALContourGenerateEx( GDALRasterBandH hBand, void *hLayer,
  294. CSLConstList options,
  295. GDALProgressFunc pfnProgress, void *pProgressArg );
  296. /************************************************************************/
  297. /* Rasterizer API - geometries burned into GDAL raster. */
  298. /************************************************************************/
  299. CPLErr CPL_DLL
  300. GDALRasterizeGeometries( GDALDatasetH hDS,
  301. int nBandCount, int *panBandList,
  302. int nGeomCount, OGRGeometryH *pahGeometries,
  303. GDALTransformerFunc pfnTransformer,
  304. void *pTransformArg,
  305. double *padfGeomBurnValue,
  306. char **papszOptions,
  307. GDALProgressFunc pfnProgress,
  308. void * pProgressArg );
  309. CPLErr CPL_DLL
  310. GDALRasterizeLayers( GDALDatasetH hDS,
  311. int nBandCount, int *panBandList,
  312. int nLayerCount, OGRLayerH *pahLayers,
  313. GDALTransformerFunc pfnTransformer,
  314. void *pTransformArg,
  315. double *padfLayerBurnValues,
  316. char **papszOptions,
  317. GDALProgressFunc pfnProgress,
  318. void *pProgressArg );
  319. CPLErr CPL_DLL
  320. GDALRasterizeLayersBuf( void *pData, int nBufXSize, int nBufYSize,
  321. GDALDataType eBufType, int nPixelSpace, int nLineSpace,
  322. int nLayerCount, OGRLayerH *pahLayers,
  323. const char *pszDstProjection,
  324. double *padfDstGeoTransform,
  325. GDALTransformerFunc pfnTransformer,
  326. void *pTransformArg, double dfBurnValue,
  327. char **papszOptions, GDALProgressFunc pfnProgress,
  328. void *pProgressArg );
  329. /************************************************************************/
  330. /* Gridding interface. */
  331. /************************************************************************/
  332. /** Gridding Algorithms */
  333. typedef enum {
  334. /*! Inverse distance to a power */ GGA_InverseDistanceToAPower = 1,
  335. /*! Moving Average */ GGA_MovingAverage = 2,
  336. /*! Nearest Neighbor */ GGA_NearestNeighbor = 3,
  337. /*! Minimum Value (Data Metric) */ GGA_MetricMinimum = 4,
  338. /*! Maximum Value (Data Metric) */ GGA_MetricMaximum = 5,
  339. /*! Data Range (Data Metric) */ GGA_MetricRange = 6,
  340. /*! Number of Points (Data Metric) */ GGA_MetricCount = 7,
  341. /*! Average Distance (Data Metric) */ GGA_MetricAverageDistance = 8,
  342. /*! Average Distance Between Data Points (Data Metric) */
  343. GGA_MetricAverageDistancePts = 9,
  344. /*! Linear interpolation (from Delaunay triangulation. Since GDAL 2.1 */
  345. GGA_Linear = 10,
  346. /*! Inverse distance to a power with nearest neighbor search for max points */
  347. GGA_InverseDistanceToAPowerNearestNeighbor = 11
  348. } GDALGridAlgorithm;
  349. /** Inverse distance to a power method control options */
  350. typedef struct
  351. {
  352. /*! Weighting power. */
  353. double dfPower;
  354. /*! Smoothing parameter. */
  355. double dfSmoothing;
  356. /*! Reserved for future use. */
  357. double dfAnisotropyRatio;
  358. /*! Reserved for future use. */
  359. double dfAnisotropyAngle;
  360. /*! The first radius (X axis if rotation angle is 0) of search ellipse. */
  361. double dfRadius1;
  362. /*! The second radius (Y axis if rotation angle is 0) of search ellipse. */
  363. double dfRadius2;
  364. /*! Angle of ellipse rotation in degrees.
  365. *
  366. * Ellipse rotated counter clockwise.
  367. */
  368. double dfAngle;
  369. /*! Maximum number of data points to use.
  370. *
  371. * Do not search for more points than this number.
  372. * If less amount of points found the grid node considered empty and will
  373. * be filled with NODATA marker.
  374. */
  375. GUInt32 nMaxPoints;
  376. /*! Minimum number of data points to use.
  377. *
  378. * If less amount of points found the grid node considered empty and will
  379. * be filled with NODATA marker.
  380. */
  381. GUInt32 nMinPoints;
  382. /*! No data marker to fill empty points. */
  383. double dfNoDataValue;
  384. } GDALGridInverseDistanceToAPowerOptions;
  385. /** Inverse distance to a power, with nearest neighbour search, control options */
  386. typedef struct
  387. {
  388. /*! Weighting power. */
  389. double dfPower;
  390. /*! The radius of search circle. */
  391. double dfRadius;
  392. /*! Smoothing parameter. */
  393. double dfSmoothing;
  394. /*! Maximum number of data points to use.
  395. *
  396. * Do not search for more points than this number.
  397. * If less amount of points found the grid node considered empty and will
  398. * be filled with NODATA marker.
  399. */
  400. GUInt32 nMaxPoints;
  401. /*! Minimum number of data points to use.
  402. *
  403. * If less amount of points found the grid node considered empty and will
  404. * be filled with NODATA marker.
  405. */
  406. GUInt32 nMinPoints;
  407. /*! No data marker to fill empty points. */
  408. double dfNoDataValue;
  409. } GDALGridInverseDistanceToAPowerNearestNeighborOptions;
  410. /** Moving average method control options */
  411. typedef struct
  412. {
  413. /*! The first radius (X axis if rotation angle is 0) of search ellipse. */
  414. double dfRadius1;
  415. /*! The second radius (Y axis if rotation angle is 0) of search ellipse. */
  416. double dfRadius2;
  417. /*! Angle of ellipse rotation in degrees.
  418. *
  419. * Ellipse rotated counter clockwise.
  420. */
  421. double dfAngle;
  422. /*! Minimum number of data points to average.
  423. *
  424. * If less amount of points found the grid node considered empty and will
  425. * be filled with NODATA marker.
  426. */
  427. GUInt32 nMinPoints;
  428. /*! No data marker to fill empty points. */
  429. double dfNoDataValue;
  430. } GDALGridMovingAverageOptions;
  431. /** Nearest neighbor method control options */
  432. typedef struct
  433. {
  434. /*! The first radius (X axis if rotation angle is 0) of search ellipse. */
  435. double dfRadius1;
  436. /*! The second radius (Y axis if rotation angle is 0) of search ellipse. */
  437. double dfRadius2;
  438. /*! Angle of ellipse rotation in degrees.
  439. *
  440. * Ellipse rotated counter clockwise.
  441. */
  442. double dfAngle;
  443. /*! No data marker to fill empty points. */
  444. double dfNoDataValue;
  445. } GDALGridNearestNeighborOptions;
  446. /** Data metrics method control options */
  447. typedef struct
  448. {
  449. /*! The first radius (X axis if rotation angle is 0) of search ellipse. */
  450. double dfRadius1;
  451. /*! The second radius (Y axis if rotation angle is 0) of search ellipse. */
  452. double dfRadius2;
  453. /*! Angle of ellipse rotation in degrees.
  454. *
  455. * Ellipse rotated counter clockwise.
  456. */
  457. double dfAngle;
  458. /*! Minimum number of data points to average.
  459. *
  460. * If less amount of points found the grid node considered empty and will
  461. * be filled with NODATA marker.
  462. */
  463. GUInt32 nMinPoints;
  464. /*! No data marker to fill empty points. */
  465. double dfNoDataValue;
  466. } GDALGridDataMetricsOptions;
  467. /** Linear method control options */
  468. typedef struct
  469. {
  470. /*! In case the point to be interpolated does not fit into a triangle of
  471. * the Delaunay triangulation, use that maximum distance to search a nearest
  472. * neighbour, or use nodata otherwise. If set to -1, the search distance is infinite.
  473. * If set to 0, nodata value will be always used.
  474. */
  475. double dfRadius;
  476. /*! No data marker to fill empty points. */
  477. double dfNoDataValue;
  478. } GDALGridLinearOptions;
  479. CPLErr CPL_DLL
  480. GDALGridCreate( GDALGridAlgorithm, const void *, GUInt32,
  481. const double *, const double *, const double *,
  482. double, double, double, double,
  483. GUInt32, GUInt32, GDALDataType, void *,
  484. GDALProgressFunc, void *);
  485. /** Grid context opaque type */
  486. typedef struct GDALGridContext GDALGridContext;
  487. GDALGridContext CPL_DLL*
  488. GDALGridContextCreate( GDALGridAlgorithm eAlgorithm, const void *poOptions,
  489. GUInt32 nPoints,
  490. const double *padfX, const double *padfY, const double *padfZ,
  491. int bCallerWillKeepPointArraysAlive );
  492. void CPL_DLL GDALGridContextFree(GDALGridContext* psContext);
  493. CPLErr CPL_DLL GDALGridContextProcess(GDALGridContext* psContext,
  494. double dfXMin, double dfXMax, double dfYMin, double dfYMax,
  495. GUInt32 nXSize, GUInt32 nYSize, GDALDataType eType, void *pData,
  496. GDALProgressFunc pfnProgress, void *pProgressArg );
  497. GDAL_GCP CPL_DLL *
  498. GDALComputeMatchingPoints( GDALDatasetH hFirstImage,
  499. GDALDatasetH hSecondImage,
  500. char **papszOptions,
  501. int *pnGCPCount );
  502. /************************************************************************/
  503. /* Delaunay triangulation interface. */
  504. /************************************************************************/
  505. /** Triangle fact */
  506. typedef struct
  507. {
  508. int anVertexIdx[3]; /**< index to the padfX/padfY arrays */
  509. int anNeighborIdx[3]; /**< index to GDALDelaunayTriangulation.pasFacets, or -1 */
  510. /* anNeighborIdx[k] is the triangle to the opposite side */
  511. /* of the opposite segment of anVertexIdx[k] */
  512. } GDALTriFacet;
  513. /** Triangle barycentric coefficients.
  514. *
  515. * Conversion from cartesian (x,y) to barycentric (l1,l2,l3) with :
  516. * l1 = dfMul1X * (x - dfCxtX) + dfMul1Y * (y - dfCstY)
  517. * l2 = dfMul2X * (x - dfCxtX) + dfMul2Y * (y - dfCstY)
  518. * l3 = 1 - l1 - l2
  519. */
  520. typedef struct
  521. {
  522. double dfMul1X; /**< dfMul1X */
  523. double dfMul1Y; /**< dfMul1Y */
  524. double dfMul2X; /**< dfMul2X */
  525. double dfMul2Y; /**< dfMul2Y */
  526. double dfCstX; /**< dfCstX */
  527. double dfCstY; /**< dfCstY */
  528. } GDALTriBarycentricCoefficients;
  529. /** Triangulation structure */
  530. typedef struct
  531. {
  532. int nFacets; /**< number of facets */
  533. GDALTriFacet *pasFacets; /**< array of nFacets facets */
  534. GDALTriBarycentricCoefficients *pasFacetCoefficients; /**< arra of nFacets barycentric coefficients */
  535. } GDALTriangulation;
  536. int CPL_DLL GDALHasTriangulation(void);
  537. GDALTriangulation CPL_DLL *GDALTriangulationCreateDelaunay(int nPoints,
  538. const double* padfX,
  539. const double* padfY);
  540. int CPL_DLL GDALTriangulationComputeBarycentricCoefficients(
  541. GDALTriangulation* psDT,
  542. const double* padfX,
  543. const double* padfY);
  544. int CPL_DLL GDALTriangulationComputeBarycentricCoordinates(
  545. const GDALTriangulation* psDT,
  546. int nFacetIdx,
  547. double dfX,
  548. double dfY,
  549. double* pdfL1,
  550. double* pdfL2,
  551. double* pdfL3);
  552. int CPL_DLL GDALTriangulationFindFacetBruteForce( const GDALTriangulation* psDT,
  553. double dfX,
  554. double dfY,
  555. int* panOutputFacetIdx );
  556. int CPL_DLL GDALTriangulationFindFacetDirected( const GDALTriangulation* psDT,
  557. int nFacetIdx,
  558. double dfX,
  559. double dfY,
  560. int* panOutputFacetIdx );
  561. void CPL_DLL GDALTriangulationFree(GDALTriangulation* psDT);
  562. /*! @cond Doxygen_Suppress */
  563. // GDAL internal use only
  564. void GDALTriangulationTerminate(void);
  565. /*! @endcond */
  566. GDALDatasetH CPL_DLL GDALOpenVerticalShiftGrid(
  567. const char* pszProj4Geoidgrids,
  568. int* pbError );
  569. GDALDatasetH CPL_DLL GDALApplyVerticalShiftGrid( GDALDatasetH hSrcDataset,
  570. GDALDatasetH hGridDataset,
  571. int bInverse,
  572. double dfSrcUnitToMeter,
  573. double dfDstUnitToMeter,
  574. const char* const* papszOptions );
  575. CPL_C_END
  576. #endif /* ndef GDAL_ALG_H_INCLUDED */
上海开阖软件有限公司 沪ICP备12045867号-1