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

Function boxaaExtendWithInit

deps/leptonica/src/boxbasic.c:1607–1630  ·  view source on GitHub ↗

! * \brief boxaaExtendWithInit() * * \param[in] baa * \param[in] maxindex * \param[in] boxa to be replicated into the extended ptr array * \return 0 if OK, 1 on error * * * Notes: * (1) This should be used on an existing boxaa that has been * fully loaded with boxa. It then extends the boxaa, * loading all the additional ptrs with copies of box

Source from the content-addressed store, hash-verified

1605 * </pre>
1606 */
1607l_int32
1608boxaaExtendWithInit(BOXAA *baa,
1609 l_int32 maxindex,
1610 BOXA *boxa)
1611{
1612l_int32 i, n;
1613
1614 PROCNAME("boxaaExtendWithInit");
1615
1616 if (!baa)
1617 return ERROR_INT("baa not defined", procName, 1);
1618 if (!boxa)
1619 return ERROR_INT("boxa not defined", procName, 1);
1620
1621 /* Extend the ptr array if necessary */
1622 n = boxaaGetCount(baa);
1623 if (maxindex < n) return 0;
1624 boxaaExtendArrayToSize(baa, maxindex + 1);
1625
1626 /* Fill the new entries with copies of boxa */
1627 for (i = n; i <= maxindex; i++)
1628 boxaaAddBoxa(baa, boxa, L_COPY);
1629 return 0;
1630}
1631
1632
1633/*!

Callers 1

Calls 3

boxaaGetCountFunction · 0.85
boxaaExtendArrayToSizeFunction · 0.85
boxaaAddBoxaFunction · 0.85

Tested by

no test coverage detected