⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 classgdalwarpoperation.html

📁 gdal库的学习文档
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>GDAL: GDALWarpOperation Class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"><link href="tabs.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.5.1 --><div class="tabs">  <ul>    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>    <li id="current"><a href="annotated.html"><span>Classes</span></a></li>    <li><a href="files.html"><span>Files</span></a></li>    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>  </ul></div><div class="tabs">  <ul>    <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>    <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>    <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>  </ul></div><h1>GDALWarpOperation Class Reference</h1><!-- doxytag: class="GDALWarpOperation" --><code>#include &lt;<a class="el" href="gdalwarper_8h-source.html">gdalwarper.h</a>&gt;</code><p><a href="classGDALWarpOperation-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"><tr><td></td></tr><tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">CPLErr&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGDALWarpOperation.html#52447611e7e196187a4667842f628d3b">Initialize</a> (const <a class="el" href="structGDALWarpOptions.html">GDALWarpOptions</a> *psNewOptions)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="69eeb724a776f0dd69bd04ad0195de00"></a><!-- doxytag: member="GDALWarpOperation::GetOptions" ref="69eeb724a776f0dd69bd04ad0195de00" args="()" -->const <a class="el" href="structGDALWarpOptions.html">GDALWarpOptions</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><b>GetOptions</b> ()</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">CPLErr&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGDALWarpOperation.html#589a9b74fa370cc9eaf11bdfd9aab2ae">ChunkAndWarpImage</a> (int nDstXOff, int nDstYOff, int nDstXSize, int nDstYSize)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">CPLErr&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGDALWarpOperation.html#a4fcccc201832f6f692fd290848cf4f1">ChunkAndWarpMulti</a> (int nDstXOff, int nDstYOff, int nDstXSize, int nDstYSize)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">CPLErr&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGDALWarpOperation.html#f853337e2a939f913ae4de48dc2f577a">WarpRegion</a> (int nDstXOff, int nDstYOff, int nDstXSize, int nDstYSize, int nSrcXOff=0, int nSrcYOff=0, int nSrcXSize=0, int nSrcYSize=0)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">CPLErr&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGDALWarpOperation.html#8051cf86afc6a24e21663944424a0f45">WarpRegionToBuffer</a> (int nDstXOff, int nDstYOff, int nDstXSize, int nDstYSize, void *pDataBuf, <a class="el" href="gdal_8h.html#22e22ce0a55036a96f652765793fb7a4">GDALDataType</a> eBufDataType, int nSrcXOff=0, int nSrcYOff=0, int nSrcXSize=0, int nSrcYSize=0)</td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>High level image warping class.<p><h2>Warper Design</h2><p>The overall GDAL high performance image warper is split into a few components.<p><ul><li>The transformation between input and output file coordinates is handled via <a class="el" href="gdal__alg_8h.html#9ad4227ec5fd5b70637eeb6996172318">GDALTransformerFunc()</a> implementations such as the one returned by <a class="el" href="gdal__alg_8h.html#7671696d085085a0bfba3c3df9ffcc0a">GDALCreateGenImgProjTransformer()</a>. The transformers are ultimately responsible for translating pixel/line locations on the destination image to pixel/line locations on the source image.</li></ul><p><ul><li>In order to handle images too large to hold in RAM, the warper needs to segment large images. This is the responsibility of the <a class="el" href="classGDALWarpOperation.html">GDALWarpOperation</a> class. The <a class="el" href="classGDALWarpOperation.html#589a9b74fa370cc9eaf11bdfd9aab2ae">GDALWarpOperation::ChunkAndWarpImage()</a> invokes <a class="el" href="classGDALWarpOperation.html#f853337e2a939f913ae4de48dc2f577a">GDALWarpOperation::WarpRegion()</a> on chunks of output and input image that are small enough to hold in the amount of memory allowed by the application. This process is described in greater detail in the <b>Image Chunking</b> section.</li></ul><p><ul><li>The <a class="el" href="classGDALWarpOperation.html#f853337e2a939f913ae4de48dc2f577a">GDALWarpOperation::WarpRegion()</a> function creates and loads an output image buffer, and then calls <a class="el" href="classGDALWarpOperation.html#8051cf86afc6a24e21663944424a0f45">WarpRegionToBuffer()</a>.</li></ul><p><ul><li><a class="el" href="classGDALWarpOperation.html#8051cf86afc6a24e21663944424a0f45">GDALWarpOperation::WarpRegionToBuffer()</a> is responsible for loading the source imagery corresponding to a particular output region, and generating masks and density masks from the source and destination imagery using the generator functions found in the <a class="el" href="structGDALWarpOptions.html">GDALWarpOptions</a> structure. Binds this all into an instance of <a class="el" href="classGDALWarpKernel.html">GDALWarpKernel</a> on which the <a class="el" href="classGDALWarpKernel.html#43c70072beacf62993b38b0aa745e630">GDALWarpKernel::PerformWarp()</a> method is called.</li></ul><p><ul><li><a class="el" href="classGDALWarpKernel.html">GDALWarpKernel</a> does the actual image warping, but is given an input image and an output image to operate on. The <a class="el" href="classGDALWarpKernel.html">GDALWarpKernel</a> does no IO, and in fact knows nothing about GDAL. It invokes the transformation function to get sample locations, builds output values based on the resampling algorithm in use. It also takes any validity and density masks into account during this operation.</li></ul><p><h3>Chunk Size Selection</h3><p>The <a class="el" href="structGDALWarpOptions.html">GDALWarpOptions</a> <a class="el" href="classGDALWarpOperation.html#589a9b74fa370cc9eaf11bdfd9aab2ae">ChunkAndWarpImage()</a> method is responsible for invoking the <a class="el" href="classGDALWarpOperation.html#f853337e2a939f913ae4de48dc2f577a">WarpRegion()</a> method on appropriate sized output chunks such that the memory required for the output image buffer, input image buffer and any required density and validity buffers is less than or equal to the application defined maximum memory available for use.<p>It checks the memory requrired by walking the edges of the output region, transforming the locations back into source pixel/line coordinates and establishing a bounding rectangle of source imagery that would be required for the output area. This is actually accomplished by the private GDALWarpOperation::ComputeSourceWindow() method.<p>Then memory requirements are used by totaling the memory required for all output bands, input bands, validity masks and density masks. If this is greater than the <a class="el" href="structGDALWarpOptions.html#a72d8bd37f896272cd979ce9dc9d65e9">GDALWarpOptions::dfWarpMemoryLimit</a> then the destination region is divided in two (splitting the longest dimension), and <a class="el" href="classGDALWarpOperation.html#589a9b74fa370cc9eaf11bdfd9aab2ae">ChunkAndWarpImage()</a> recursively invoked on each destination subregion.<p><h3>Validity and Density Masks Generation</h3><p>Fill in ways in which the validity and density masks may be generated here. Note that detailed semantics of the masks should be found in <a class="el" href="classGDALWarpKernel.html">GDALWarpKernel</a>. <p><hr><h2>Member Function Documentation</h2><a class="anchor" name="52447611e7e196187a4667842f628d3b"></a><!-- doxytag: member="GDALWarpOperation::Initialize" ref="52447611e7e196187a4667842f628d3b" args="(const GDALWarpOptions *psNewOptions)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">CPLErr GDALWarpOperation::Initialize           </td>          <td>(</td>          <td class="paramtype">const <a class="el" href="structGDALWarpOptions.html">GDALWarpOptions</a> *&nbsp;</td>          <td class="paramname"> <em>psNewOptions</em>          </td>          <td>&nbsp;)&nbsp;</td>          <td width="100%"></td>        </tr>      </table></div><div class="memdoc"><p>This method initializes the GDALWarpOperation's concept of the warp options in effect. It creates an internal copy of the <a class="el" href="structGDALWarpOptions.html">GDALWarpOptions</a> structure and defaults a variety of additional fields in the internal copy if not set in the provides warp options.<p>Defaulting operations include:<ul><li>If the nBandCount is 0, it will be set to the number of bands in the source image (which must match the output image) and the panSrcBands and panDstBands will be populated.</li></ul><p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>psNewOptions</em>&nbsp;</td><td>input set of warp options. These are copied and may be destroyed after this call by the application.</td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>CE_None on success or CE_Failure if an error occurs. </dd></dl></div></div><p><a class="anchor" name="589a9b74fa370cc9eaf11bdfd9aab2ae"></a><!-- doxytag: member="GDALWarpOperation::ChunkAndWarpImage" ref="589a9b74fa370cc9eaf11bdfd9aab2ae" args="(int nDstXOff, int nDstYOff, int nDstXSize, int nDstYSize)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">CPLErr GDALWarpOperation::ChunkAndWarpImage           </td>          <td>(</td>          <td class="paramtype">int&nbsp;</td>          <td class="paramname"> <em>nDstXOff</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">int&nbsp;</td>          <td class="paramname"> <em>nDstYOff</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">int&nbsp;</td>          <td class="paramname"> <em>nDstXSize</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">int&nbsp;</td>          <td class="paramname"> <em>nDstYSize</em></td><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td width="100%"></td>        </tr>      </table></div><div class="memdoc"><p>This method does a complete warp of the source image to the destination image for the indicated region with the current warp options in effect. Progress is reported to the installed progress monitor, if any.<p>This function will subdivide the region and recursively call itself until the total memory required to process a region chunk will all fit in the memory pool defined by <a class="el" href="structGDALWarpOptions.html#a72d8bd37f896272cd979ce9dc9d65e9">GDALWarpOptions::dfWarpMemoryLimit</a>.<p>Once an appropriate region is selected <a class="el" href="classGDALWarpOperation.html#f853337e2a939f913ae4de48dc2f577a">GDALWarpOperation::WarpRegion()</a> is invoked to do the actual work.<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>nDstXOff</em>&nbsp;</td><td>X offset to window of destination data to be produced. </td></tr>    <tr><td valign="top"></td><td valign="top"><em>nDstYOff</em>&nbsp;</td><td>Y offset to window of destination data to be produced. </td></tr>    <tr><td valign="top"></td><td valign="top"><em>nDstXSize</em>&nbsp;</td><td>Width of output window on destination file to be produced. </td></tr>    <tr><td valign="top"></td><td valign="top"><em>nDstYSize</em>&nbsp;</td><td>Height of output window on destination file to be produced.</td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>CE_None on success or CE_Failure if an error occurs. </dd></dl></div></div><p><a class="anchor" name="a4fcccc201832f6f692fd290848cf4f1"></a><!-- doxytag: member="GDALWarpOperation::ChunkAndWarpMulti" ref="a4fcccc201832f6f692fd290848cf4f1" args="(int nDstXOff, int nDstYOff, int nDstXSize, int nDstYSize)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">CPLErr GDALWarpOperation::ChunkAndWarpMulti           </td>          <td>(</td>          <td class="paramtype">int&nbsp;</td>          <td class="paramname"> <em>nDstXOff</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">int&nbsp;</td>          <td class="paramname"> <em>nDstYOff</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">int&nbsp;</td>          <td class="paramname"> <em>nDstXSize</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">int&nbsp;</td>          <td class="paramname"> <em>nDstYSize</em></td><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td width="100%"></td>        </tr>      </table></div><div class="memdoc"><p>This method does a complete warp of the source image to the destination image for the indicated region with the current warp options in effect. Progress is reported to the installed progress monitor, if any.<p>Externally this method operates the same as <a class="el" href="classGDALWarpOperation.html#589a9b74fa370cc9eaf11bdfd9aab2ae">ChunkAndWarpImage()</a>, but internally this method uses multiple threads to interleave input/output for one region while the processing is being done for another.<p>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -