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

Function boxaWriteStream

deps/leptonica/src/boxbasic.c:2256–2281  ·  view source on GitHub ↗

! * \brief boxaWriteStream() * * \param[in] fp file stream * \param[in] boxa * \return 0 if OK, 1 on error */

Source from the content-addressed store, hash-verified

2254 * \return 0 if OK, 1 on error
2255 */
2256l_int32
2257boxaWriteStream(FILE *fp,
2258 BOXA *boxa)
2259{
2260l_int32 n, i;
2261BOX *box;
2262
2263 PROCNAME("boxaWriteStream");
2264
2265 if (!fp)
2266 return ERROR_INT("stream not defined", procName, 1);
2267 if (!boxa)
2268 return ERROR_INT("boxa not defined", procName, 1);
2269
2270 n = boxaGetCount(boxa);
2271 fprintf(fp, "\nBoxa Version %d\n", BOXA_VERSION_NUMBER);
2272 fprintf(fp, "Number of boxes = %d\n", n);
2273 for (i = 0; i < n; i++) {
2274 if ((box = boxaGetBox(boxa, i, L_CLONE)) == NULL)
2275 return ERROR_INT("box not found", procName, 1);
2276 fprintf(fp, " Box[%d]: x = %d, y = %d, w = %d, h = %d\n",
2277 i, box->x, box->y, box->w, box->h);
2278 boxDestroy(&box);
2279 }
2280 return 0;
2281}
2282
2283
2284/*!

Callers 9

pixExtractBarcodesFunction · 0.85
pixacompWriteStreamFunction · 0.85
pixaWriteStreamFunction · 0.85
pixaaWriteStreamFunction · 0.85
recogRunViterbiFunction · 0.85
boxaaWriteStreamFunction · 0.85
boxaWriteFunction · 0.85
boxaWriteMemFunction · 0.85

Calls 3

boxaGetCountFunction · 0.85
boxaGetBoxFunction · 0.85
boxDestroyFunction · 0.85

Tested by

no test coverage detected