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

📄 classgdalrasterband.html

📁 gdal库的学习文档
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">void GDALRasterBand::GetBlockSize           </td>          <td>(</td>          <td class="paramtype">int *&nbsp;</td>          <td class="paramname"> <em>pnXSize</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">int *&nbsp;</td>          <td class="paramname"> <em>pnYSize</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>Fetch the "natural" block size of this band.<p>GDAL contains a concept of the natural block size of rasters so that applications can organized data access efficiently for some file formats. The natural block size is the block size that is most efficient for accessing the format. For many formats this is simple a whole scanline in which case *pnXSize is set to <a class="el" href="classGDALRasterBand.html#46f78e79da622039a670107ae5a94f02">GetXSize()</a>, and *pnYSize is set to 1.<p>However, for tiled images this will typically be the tile size.<p>Note that the X and Y block sizes don't have to divide the image size evenly, meaning that right and bottom edge blocks may be incomplete. See <a class="el" href="classGDALRasterBand.html#09e1d83971ddff0b43deffd54ef25eef">ReadBlock()</a> for an example of code dealing with these issues.<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>pnXSize</em>&nbsp;</td><td>integer to put the X block size into or NULL.</td></tr>    <tr><td valign="top"></td><td valign="top"><em>pnYSize</em>&nbsp;</td><td>integer to put the Y block size into or NULL. </td></tr>  </table></dl></div></div><p><a class="anchor" name="2f7ad15eaf8044551cbbf0a25cfa9675"></a><!-- doxytag: member="GDALRasterBand::GetAccess" ref="2f7ad15eaf8044551cbbf0a25cfa9675" args="()" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname"><a class="el" href="gdal_8h.html#045e3967c208993f70257bfd40c9f1d7">GDALAccess</a> GDALRasterBand::GetAccess           </td>          <td>(</td>          <td class="paramname">          </td>          <td>&nbsp;)&nbsp;</td>          <td width="100%"></td>        </tr>      </table></div><div class="memdoc"><p>Find out if we have update permission for this band.<p>This method is the same as the C function <a class="el" href="gdal_8h.html#2ae7181ad804986bfdcc1fdbc77ef15e">GDALGetRasterAccess()</a>.<p><dl class="return" compact><dt><b>Returns:</b></dt><dd>Either GA_Update or GA_ReadOnly. </dd></dl></div></div><p><a class="anchor" name="5497e8d29e743ee9177202cb3f61c3c7"></a><!-- doxytag: member="GDALRasterBand::RasterIO" ref="5497e8d29e743ee9177202cb3f61c3c7" args="(GDALRWFlag, int, int, int, int, void *, int, int, GDALDataType, int, int)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">CPLErr GDALRasterBand::RasterIO           </td>          <td>(</td>          <td class="paramtype"><a class="el" href="gdal_8h.html#e602fdf251b6b0210a5af5a7cf7623b3">GDALRWFlag</a>&nbsp;</td>          <td class="paramname"> <em>eRWFlag</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">int&nbsp;</td>          <td class="paramname"> <em>nXOff</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">int&nbsp;</td>          <td class="paramname"> <em>nYOff</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">int&nbsp;</td>          <td class="paramname"> <em>nXSize</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">int&nbsp;</td>          <td class="paramname"> <em>nYSize</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">void *&nbsp;</td>          <td class="paramname"> <em>pData</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">int&nbsp;</td>          <td class="paramname"> <em>nBufXSize</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">int&nbsp;</td>          <td class="paramname"> <em>nBufYSize</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype"><a class="el" href="gdal_8h.html#22e22ce0a55036a96f652765793fb7a4">GDALDataType</a>&nbsp;</td>          <td class="paramname"> <em>eBufType</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">int&nbsp;</td>          <td class="paramname"> <em>nPixelSpace</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">int&nbsp;</td>          <td class="paramname"> <em>nLineSpace</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>Read/write a region of image data for this band.<p>This method allows reading a region of a <a class="el" href="classGDALRasterBand.html">GDALRasterBand</a> into a buffer, or writing data from a buffer into a region of a <a class="el" href="classGDALRasterBand.html">GDALRasterBand</a>. It automatically takes care of data type translation if the data type (eBufType) of the buffer is different than that of the <a class="el" href="classGDALRasterBand.html">GDALRasterBand</a>. The method also takes care of image decimation / replication if the buffer size (nBufXSize x nBufYSize) is different than the size of the region being accessed (nXSize x nYSize).<p>The nPixelSpace and nLineSpace parameters allow reading into or writing from unusually organized buffers. This is primarily used for buffers containing more than one bands raster data in interleaved format.<p>Some formats may efficiently implement decimation into a buffer by reading from lower resolution overview images.<p>For highest performance full resolution data access, read and write on "block boundaries" as returned by <a class="el" href="classGDALRasterBand.html#f2ee6fa0f675d7d52bc19f826d161ad6">GetBlockSize()</a>, or use the <a class="el" href="classGDALRasterBand.html#09e1d83971ddff0b43deffd54ef25eef">ReadBlock()</a> and <a class="el" href="classGDALRasterBand.html#e92a432b3fe9ec0403e692af611095c9">WriteBlock()</a> methods.<p>This method is the same as the C <a class="el" href="gdal_8h.html#f26fead53c02f8035150cc710c156752">GDALRasterIO()</a> function.<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>eRWFlag</em>&nbsp;</td><td>Either GF_Read to read a region of data, or GF_Write to write a region of data.</td></tr>    <tr><td valign="top"></td><td valign="top"><em>nXOff</em>&nbsp;</td><td>The pixel offset to the top left corner of the region of the band to be accessed. This would be zero to start from the left side.</td></tr>    <tr><td valign="top"></td><td valign="top"><em>nYOff</em>&nbsp;</td><td>The line offset to the top left corner of the region of the band to be accessed. This would be zero to start from the top.</td></tr>    <tr><td valign="top"></td><td valign="top"><em>nXSize</em>&nbsp;</td><td>The width of the region of the band to be accessed in pixels.</td></tr>    <tr><td valign="top"></td><td valign="top"><em>nYSize</em>&nbsp;</td><td>The height of the region of the band to be accessed in lines.</td></tr>    <tr><td valign="top"></td><td valign="top"><em>pData</em>&nbsp;</td><td>The buffer into which the data should be read, or from which it should be written. This buffer must contain at least nBufXSize * nBufYSize words of type eBufType. It is organized in left to right, top to bottom pixel order. Spacing is controlled by the nPixelSpace, and nLineSpace parameters.</td></tr>    <tr><td valign="top"></td><td valign="top"><em>nBufXSize</em>&nbsp;</td><td>the width of the buffer image into which the desired region is to be read, or from which it is to be written.</td></tr>    <tr><td valign="top"></td><td valign="top"><em>nBufYSize</em>&nbsp;</td><td>the height of the buffer image into which the desired region is to be read, or from which it is to be written.</td></tr>    <tr><td valign="top"></td><td valign="top"><em>eBufType</em>&nbsp;</td><td>the type of the pixel values in the pData data buffer. The pixel values will automatically be translated to/from the <a class="el" href="classGDALRasterBand.html">GDALRasterBand</a> data type as needed.</td></tr>    <tr><td valign="top"></td><td valign="top"><em>nPixelSpace</em>&nbsp;</td><td>The byte offset from the start of one pixel value in pData to the start of the next pixel value within a scanline. If defaulted (0) the size of the datatype eBufType is used.</td></tr>    <tr><td valign="top"></td><td valign="top"><em>nLineSpace</em>&nbsp;</td><td>The byte offset from the start of one scanline in pData to the start of the next. If defaulted the size of the datatype eBufType * nBufXSize is used.</td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>CE_Failure if the access fails, otherwise CE_None. </dd></dl></div></div><p><a class="anchor" name="09e1d83971ddff0b43deffd54ef25eef"></a><!-- doxytag: member="GDALRasterBand::ReadBlock" ref="09e1d83971ddff0b43deffd54ef25eef" args="(int, int, void *)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">CPLErr GDALRasterBand::ReadBlock           </td>          <td>(</td>          <td class="paramtype">int&nbsp;</td>          <td class="paramname"> <em>nXBlockOff</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">int&nbsp;</td>          <td class="paramname"> <em>nYBlockOff</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">void *&nbsp;</td>          <td class="paramname"> <em>pImage</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>Read a block of image data efficiently.<p>This method accesses a "natural" block from the raster band without resampling, or data type conversion. For a more generalized, but potentially less efficient access use <a class="el" href="classGDALRasterBand.html#5497e8d29e743ee9177202cb3f61c3c7">RasterIO()</a>.<p>

⌨️ 快捷键说明

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