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

Function boxaaReplaceBoxa

deps/leptonica/src/boxbasic.c:1648–1668  ·  view source on GitHub ↗

! * \brief boxaaReplaceBoxa() * * \param[in] baa * \param[in] index to the index-th boxa * \param[in] boxa insert and replace any existing one * \return 0 if OK, 1 on error * * * Notes: * (1) Any existing boxa is destroyed, and the input one * is inserted in its place. * (2) If the index is invalid, return 1 (error) * */

Source from the content-addressed store, hash-verified

1646 * </pre>
1647 */
1648l_int32
1649boxaaReplaceBoxa(BOXAA *baa,
1650 l_int32 index,
1651 BOXA *boxa)
1652{
1653l_int32 n;
1654
1655 PROCNAME("boxaaReplaceBoxa");
1656
1657 if (!baa)
1658 return ERROR_INT("baa not defined", procName, 1);
1659 if (!boxa)
1660 return ERROR_INT("boxa not defined", procName, 1);
1661 n = boxaaGetCount(baa);
1662 if (index < 0 || index >= n)
1663 return ERROR_INT("index not valid", procName, 1);
1664
1665 boxaDestroy(&baa->boxa[index]);
1666 baa->boxa[index] = boxa;
1667 return 0;
1668}
1669
1670
1671/*!

Callers 3

boxaSort2dFunction · 0.85
boxaaInitFullFunction · 0.85

Calls 2

boxaaGetCountFunction · 0.85
boxaDestroyFunction · 0.85

Tested by

no test coverage detected