# CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.selectConvexHull

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="CSJ2K_j2k_entropy_encoder_CBlkRateDistStats_selectConvexHull_" data-uid="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.selectConvexHull*">selectConvexHull Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="CSJ2K_j2k_entropy_encoder_CBlkRateDistStats_selectConvexHull_" data-uid="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.selectConvexHull*"></a>
<h4 id="CSJ2K_j2k_entropy_encoder_CBlkRateDistStats_selectConvexHull_System_Int32___System_Double___System_Boolean___System_Int32_System_Boolean_" data-uid="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.selectConvexHull(System.Int32[],System.Double[],System.Boolean[],System.Int32,System.Boolean)">selectConvexHull(int[], double[], bool[], int, bool)</h4>
<div class="markdown level1 summary"><p>Compute the rate-distorsion slopes and selects those that lie in a
convex hull. It will compute the slopes, select the ones that form the
convex hull and initialize the 'truncIdxs' and 'truncSlopes' arrays, as
well as 'nVldTrunc', with the selected truncation points. It will also
initialize 'truncRates' and 'isTermPass' arrays, as well as
'nTotTrunc', with all the truncation points (selected or not).</p>
<pre><code>       &lt;p&gt; Note that the arrays 'rates' and 'termp' are copied, not
       referenced, so they can be modified after a call to this method.&lt;/p&gt;
</code></pre>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public virtual void selectConvexHull(int[] rates, double[] dists, bool[] termp, int n, bool inclast)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Overridable Sub selectConvexHull(rates As Integer(), dists As Double(), termp As Boolean(), n As Integer, inclast As Boolean)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a>[]</td>
      <td><span class="parametername">rates</span></td>
      <td><p>The rates (in bytes) for each truncation point in the
compressed data. This array is modified by the method.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double">double</a>[]</td>
      <td><span class="parametername">dists</span></td>
      <td><p>The reduction in distortion (with respect to no
information coded) for each truncation point. This array is modified by
the method.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a>[]</td>
      <td><span class="parametername">termp</span></td>
      <td><p>An array of boolean flags indicating, for each pass, if a
pass is terminated or not (true if terminated). If null then it is
assumed that no pass is terminated except the last one which always is.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">n</span></td>
      <td><p>The number of truncation points contained in 'rates', 'dist'
and 'termp'.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">inclast</span></td>
      <td><p>If false the convex hull is constructed as for lossy
coding. If true it is constructed as for lossless coding, in which case
it is ensured that all bit-planes are sent (i.e. the last truncation
point is always included).</p>
</td>
    </tr>
  </tbody>
</table>
</div>
