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

Function pixacompExtendArray

deps/leptonica/src/pixcomp.c:992–1007  ·  view source on GitHub ↗

! * \brief pixacompExtendArray() * * \param[in] pixac * \return 0 if OK; 1 on error * * * Notes: * (1) We extend the boxa array simultaneously. This is * necessary in case we are NOT adding boxes simultaneously * with adding pixc. We always want the sizes of the * pixac and boxa ptr arrays to be equal. * */

Source from the content-addressed store, hash-verified

990 * </pre>
991 */
992static l_int32
993pixacompExtendArray(PIXAC *pixac)
994{
995 PROCNAME("pixacompExtendArray");
996
997 if (!pixac)
998 return ERROR_INT("pixac not defined", procName, 1);
999
1000 if ((pixac->pixc = (PIXC **)reallocNew((void **)&pixac->pixc,
1001 sizeof(PIXC *) * pixac->nalloc,
1002 2 * sizeof(PIXC *) * pixac->nalloc)) == NULL)
1003 return ERROR_INT("new ptr array not returned", procName, 1);
1004 pixac->nalloc = 2 * pixac->nalloc;
1005 boxaExtendArray(pixac->boxa);
1006 return 0;
1007}
1008
1009
1010/*!

Callers 1

pixacompAddPixcompFunction · 0.85

Calls 2

reallocNewFunction · 0.85
boxaExtendArrayFunction · 0.85

Tested by

no test coverage detected