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

Function boxaaCopy

deps/leptonica/src/boxbasic.c:1272–1295  ·  view source on GitHub ↗

! * \brief boxaaCopy() * * \param[in] baas input boxaa to be copied * \param[in] copyflag L_COPY, L_CLONE * \return baad new boxaa, composed of copies or clones of the boxa * in baas, or NULL on error * * * Notes: * (1) L_COPY makes a copy of each boxa in baas. * L_CLONE makes a clone of each boxa in baas. * */

Source from the content-addressed store, hash-verified

1270 * </pre>
1271 */
1272BOXAA *
1273boxaaCopy(BOXAA *baas,
1274 l_int32 copyflag)
1275{
1276l_int32 i, n;
1277BOXA *boxa;
1278BOXAA *baad;
1279
1280 PROCNAME("boxaaCopy");
1281
1282 if (!baas)
1283 return (BOXAA *)ERROR_PTR("baas not defined", procName, NULL);
1284 if (copyflag != L_COPY && copyflag != L_CLONE)
1285 return (BOXAA *)ERROR_PTR("invalid copyflag", procName, NULL);
1286
1287 n = boxaaGetCount(baas);
1288 baad = boxaaCreate(n);
1289 for (i = 0; i < n; i++) {
1290 boxa = boxaaGetBoxa(baas, i, copyflag);
1291 boxaaAddBoxa(baad, boxa, L_INSERT);
1292 }
1293
1294 return baad;
1295}
1296
1297
1298/*!

Callers

nothing calls this directly

Calls 4

boxaaGetCountFunction · 0.85
boxaaCreateFunction · 0.85
boxaaGetBoxaFunction · 0.85
boxaaAddBoxaFunction · 0.85

Tested by

no test coverage detected