MCPcopy Create free account
hub / github.com/creatale/node-dv / numaCreate

Function numaCreate

deps/leptonica/src/numabasic.c:186–209  ·  view source on GitHub ↗

--------------------------------------------------------------------------* * Numa creation, destruction, copy, clone, etc. * *--------------------------------------------------------------------------*/ ! * \brief numaCreate() * * \param[in] n size of number array to be alloc'd 0 for default * \return na, or NULL on error */

Source from the content-addressed store, hash-verified

184 * \return na, or NULL on error
185 */
186NUMA *
187numaCreate(l_int32 n)
188{
189NUMA *na;
190
191 PROCNAME("numaCreate");
192
193 if (n <= 0)
194 n = INITIAL_PTR_ARRAYSIZE;
195
196 if ((na = (NUMA *)LEPT_CALLOC(1, sizeof(NUMA))) == NULL)
197 return (NUMA *)ERROR_PTR("na not made", procName, NULL);
198 if ((na->array = (l_float32 *)LEPT_CALLOC(n, sizeof(l_float32))) == NULL) {
199 numaDestroy(&na);
200 return (NUMA *)ERROR_PTR("number array not made", procName, NULL);
201 }
202
203 na->nalloc = n;
204 na->n = 0;
205 na->refcount = 1;
206 na->startx = 0.0;
207 na->delx = 1.0;
208 return na;
209}
210
211
212/*!

Callers 15

NAN_METHODFunction · 0.85
pixGetRunCentersOnLineFunction · 0.85
pixGetRunsOnLineFunction · 0.85
ptraConcatenatePdfToDataFunction · 0.85
pixFindMaxRunsFunction · 0.85
boxaMakeSizeIndicatorFunction · 0.85
boxaMakeAreaIndicatorFunction · 0.85
boxaMakeWHRatioIndicatorFunction · 0.85
boxaPlotSidesFunction · 0.85
boxaPlotSizesFunction · 0.85
boxaGetSizesFunction · 0.85
numaGammaTRCFunction · 0.85

Calls 1

numaDestroyFunction · 0.85

Tested by

no test coverage detected