# CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.-ctor

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="CSJ2K_j2k_entropy_encoder_CBlkRateDistStats__ctor_" data-uid="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.#ctor*">CBlkRateDistStats Constructor
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="CSJ2K_j2k_entropy_encoder_CBlkRateDistStats__ctor_" data-uid="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.#ctor*"></a>
<h4 id="CSJ2K_j2k_entropy_encoder_CBlkRateDistStats__ctor" data-uid="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.#ctor">CBlkRateDistStats()</h4>
<div class="markdown level1 summary"><p>Creates a new CBlkRateDistStats object without allocating any space for
'truncRates', 'truncSlopes', 'truncDists' and 'truncIdxs' or 'data'.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public CBlkRateDistStats()</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New()</code></pre>
</div>


<a id="CSJ2K_j2k_entropy_encoder_CBlkRateDistStats__ctor_" data-uid="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.#ctor*"></a>
<h4 id="CSJ2K_j2k_entropy_encoder_CBlkRateDistStats__ctor_System_Int32_System_Int32_System_Int32_System_Byte___System_Int32___System_Double___System_Boolean___System_Int32_System_Boolean_" data-uid="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.#ctor(System.Int32,System.Int32,System.Int32,System.Byte[],System.Int32[],System.Double[],System.Boolean[],System.Int32,System.Boolean)">CBlkRateDistStats(int, int, int, byte[], int[], double[], bool[], int, bool)</h4>
<div class="markdown level1 summary"><p>Creates a new CBlkRateDistStats object and initializes the valid
truncation points, their rates and their slopes, from the 'rates' and
'dist' arrays. The 'rates', 'dist' and 'termp' arrays must contain the
rate (in bytes), the reduction in distortion (from nothing coded) and
the flag indicating if termination is used, respectively, for each
truncation point.</p>
<pre><code>       &lt;p&gt;The valid truncation points are selected by taking them as lying on
       a convex hull. This is done by calling the method
       selectConvexHull().&lt;/p&gt;&lt;p&gt;Note that the arrays 'rates' and 'termp' are copied, not referenced,
       so they can be modified after a call to this constructor.&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 CBlkRateDistStats(int m, int n, int skipMSBP, byte[] data, int[] rates, double[] dists, bool[] termp, int np, bool inclast)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(m As Integer, n As Integer, skipMSBP As Integer, data As Byte(), rates As Integer(), dists As Double(), termp As Boolean(), np 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">m</span></td>
      <td><p>The horizontal index of the code-block, within the subband.</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 vertical index of the code-block, within the subband.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">skipMSBP</span></td>
      <td><p>The number of skipped most significant bit-planes for
this code-block.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.byte">byte</a>[]</td>
      <td><span class="parametername">data</span></td>
      <td><p>The compressed data. This array is referenced by this
object so it should not be modified after.</p>
</td>
    </tr>
    <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 but no reference
is kept to it.</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 but no reference is kept to it.</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">np</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>
