classvtarray.html
来自「VC下实现图像处理。 VC下实现图像处理。 VC下实现图像处理。」· HTML 代码 · 共 758 行 · 第 1/3 页
HTML
758 行
</td> <td><p>Enlarge the array to accomodate <em>growto</em> elements. If the array can already hold this many elements, nothing is done. Otherwise, the data area of the array is enlarged (reallocating if necessary) so that <em>growto</em> contiguous elements can be stored.<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>growto</em> </td><td>Number of elements the array should be able to hold after it has grown</td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>True if array was successfully grown, else false.</dd></dl><dl compact><dt><b>See also:</b></dt><dd>vtArray::SetData <a class="el" href="classvtArray.html#9f04d263f4e82a771d106f203393edb1">vtArray::SetMaxSize</a> </dd></dl> </td> </tr></table><a class="anchor" name="479ebc765d2d240345597ecf68c6cf70"></a><!-- doxytag: member="vtArray::IsEmpty" ref="479ebc765d2d240345597ecf68c6cf70" args="() const " --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="mdPrefix" colspan="4">template<class E> </td> </tr> <tr> <td class="md" nowrap valign="top">bool <a class="el" href="classvtArray.html">vtArray</a>< E >::IsEmpty </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> const<code> [inline]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Determines whether an array has elements or not<p><dl compact><dt><b>Returns:</b></dt><dd>True if array contains no elements, else false.</dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="classvtArray.html#40e58c152ada0139faa78fb2495d5d80">vtArray::SetSize</a> <a class="el" href="classvtArray.html#ae22276c7490efee40cd72529c7a83b3">vtArray::Empty</a> </dd></dl> </td> </tr></table><a class="anchor" name="277b6409ae98fc1479707e0f5468ce26"></a><!-- doxytag: member="vtArray::RemoveAt" ref="277b6409ae98fc1479707e0f5468ce26" args="(unsigned int i, int n=1)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="mdPrefix" colspan="4">template<class E> </td> </tr> <tr> <td class="md" nowrap valign="top">bool <a class="el" href="classvtArray.html">vtArray</a>< E >::RemoveAt </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">unsigned int </td> <td class="mdname" nowrap> <em>i</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>n</em> = <code>1</code></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Removes the i'th element of the array. The following elements are shuffled up to eliminate the unused space.<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>i</em> </td><td>Index of element to remove (0 based) </td></tr> <tr><td valign="top"></td><td valign="top"><em>n</em> </td><td>Number of elements to remove (default 1)</td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>bool True if element was successfully removed, else false.</dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="classvtArray.html#f45cfa28deec67089450dd878dbc5d22">vtArray::Append</a> <a class="el" href="classvtArray.html#293a85ce4234579889beaec4a79e4aac">vtArray::SetAt</a> <a class="el" href="classvtArray.html#40e58c152ada0139faa78fb2495d5d80">vtArray::SetSize</a></dd></dl><dl compact><dt><b>Examples:</b></dt><dd><div class="fragment"><pre class="fragment"> vtArray<int16> zot(8); <span class="comment">// room for 8 shorts</span> zot.<a class="code" href="classvtArray.html#40e58c152ada0139faa78fb2495d5d80">SetSize</a>(8); <span class="comment">// now has 8 zeros</span> zot[1] = 1; <span class="comment">// second element</span> zot[2] = 2; <span class="comment">// third element</span> zot.<a class="code" href="classvtArray.html#277b6409ae98fc1479707e0f5468ce26">RemoveAt</a>(0); <span class="comment">// remove first element</span> zot.<a class="code" href="classvtArray.html#277b6409ae98fc1479707e0f5468ce26">RemoveAt</a>(-1); <span class="comment">// returns false</span></pre></div> </dd></dl> </td> </tr></table><a class="anchor" name="293a85ce4234579889beaec4a79e4aac"></a><!-- doxytag: member="vtArray::SetAt" ref="293a85ce4234579889beaec4a79e4aac" args="(unsigned int i, E)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="mdPrefix" colspan="4">template<class E> </td> </tr> <tr> <td class="md" nowrap valign="top">bool <a class="el" href="classvtArray.html">vtArray</a>< E >::SetAt </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">unsigned int </td> <td class="mdname" nowrap> <em>i</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>E </td> <td class="mdname" nowrap> <em>val</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Sets the i'th element of the array to the given value. The number of bytes copied is determined by the element size of the array specified at initialization time. If the array is not large enough, it is extended to become 1 1/2 times its current size.<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>i</em> </td><td>Index of new element (0 based) </td></tr> <tr><td valign="top"></td><td valign="top"><em>val</em> </td><td>Value of the new element.</td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>int index of element added or -1 if out of memory</dd></dl><dl compact><dt><b>Examples:</b></dt><dd><div class="fragment"><pre class="fragment"> vtArray<RGBi> cols(16); <span class="comment">// room for 16 colors</span> cols.SetAt(0, <a class="code" href="classRGBi.html">RGBi</a>(1,1,1)); <span class="comment">// first color white</span> cols.SetAt(15, <a class="code" href="classRGBi.html">RGBi</a>(1,0,0)); <span class="comment">// last color red</span> <span class="comment">// makes Colors 1-14, too</span> cols.SetAt(17, <a class="code" href="classRGBi.html">RGBi</a>(0,1,1)); <span class="comment">// causes array growth</span></pre></div> </dd></dl> </td> </tr></table><a class="anchor" name="9f04d263f4e82a771d106f203393edb1"></a><!-- doxytag: member="vtArray::SetMaxSize" ref="9f04d263f4e82a771d106f203393edb1" args="(unsigned int)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="mdPrefix" colspan="4">template<class E> </td> </tr> <tr> <td class="md" nowrap valign="top">bool <a class="el" href="classvtArray.html">vtArray</a>< E >::SetMaxSize </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">unsigned int </td> <td class="mdname1" valign="top" nowrap> <em>s</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>If the array is user-managed, MaxSize establishes the maximum number of elements that can be stored. If the array is dynamically managed by the system, setting the maximum size enlarges its data area to accomodate the required number of elements.<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>s</em> </td><td>Current maximum size of array (number of elements its data area can hold)</td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>bool, true if maximum size successfully changed, else false.</dd></dl><dl compact><dt><b>See also:</b></dt><dd>vtArray::SetData <a class="el" href="classvtArray.html#40e58c152ada0139faa78fb2495d5d80">vtArray::SetSize</a> vtArray::GetElemSize <a class="el" href="classvtArray.html#81ebc1b67b973028c847277c64cfcdd3">vtArray::Grow</a> </dd></dl> </td> </tr></table><a class="anchor" name="40e58c152ada0139faa78fb2495d5d80"></a><!-- doxytag: member="vtArray::SetSize" ref="40e58c152ada0139faa78fb2495d5d80" args="(unsigned int)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="mdPrefix" colspan="4">template<class E> </td> </tr> <tr> <td class="md" nowrap valign="top">bool <a class="el" href="classvtArray.html">vtArray</a>< E >::SetSize </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">unsigned int </td> <td class="mdname1" valign="top" nowrap> <em>s</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [inline]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Set the current array size. If the array is dynamically managed, it will be enlarged to accomodate the new size. If not, the array size cannot be set beyond the current maximum size. When the array size is enlarged, we should call constructors for the new empty elements. We don't do that yet.<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>s</em> </td><td>Current number of elements contained in array</td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>bool True if size successfully changed, else false.</dd></dl><dl compact><dt><b>See also:</b></dt><dd>vtArray::SetData <a class="el" href="classvtArray.html#81ebc1b67b973028c847277c64cfcdd3">vtArray::Grow</a> <a class="el" href="classvtArray.html#9f04d263f4e82a771d106f203393edb1">vtArray::SetMaxSize</a></dd></dl><dl compact><dt><b>Examples:</b></dt><dd><div class="fragment"><pre class="fragment"> vtArray<RGBi> cols(256); <span class="comment">// room for 256 colors</span> <span class="keywordtype">int</span> ncols = cols.GetSize(); <span class="comment">// will be zero</span> ncols = cols.GetMaxSize(); <span class="comment">// will be 256</span> cols.SetSize(ncols); <span class="comment">// calls 256 Color4 constructors NOT</span></pre></div> </dd></dl> </td> </tr></table><hr size="1"><address style="align: right;"><small>Generated on Mon Jan 14 14:40:55 2008 for vtdata library by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.5 </small></address></body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?