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

Function boxaGetBoxGeometry

deps/leptonica/src/boxbasic.c:860–886  ·  view source on GitHub ↗

! * \brief boxaGetBoxGeometry() * * \param[in] boxa * \param[in] index to the index-th box * \param[out] px, py, pw, ph [optional] each can be null * \return 0 if OK, 1 on error */

Source from the content-addressed store, hash-verified

858 * \return 0 if OK, 1 on error
859 */
860l_int32
861boxaGetBoxGeometry(BOXA *boxa,
862 l_int32 index,
863 l_int32 *px,
864 l_int32 *py,
865 l_int32 *pw,
866 l_int32 *ph)
867{
868BOX *box;
869
870 PROCNAME("boxaGetBoxGeometry");
871
872 if (px) *px = 0;
873 if (py) *py = 0;
874 if (pw) *pw = 0;
875 if (ph) *ph = 0;
876 if (!boxa)
877 return ERROR_INT("boxa not defined", procName, 1);
878 if (index < 0 || index >= boxa->n)
879 return ERROR_INT("index not valid", procName, 1);
880
881 if ((box = boxaGetBox(boxa, index, L_CLONE)) == NULL)
882 return ERROR_INT("box not found!", procName, 1);
883 boxGetGeometry(box, px, py, pw, ph);
884 boxDestroy(&box);
885 return 0;
886}
887
888
889/*!

Callers 15

boxaMakeSizeIndicatorFunction · 0.85
boxaMakeAreaIndicatorFunction · 0.85
boxaMakeWHRatioIndicatorFunction · 0.85
boxaTestEvenOddHeightFunction · 0.85
boxaPlotSidesFunction · 0.85
boxaPlotSizesFunction · 0.85
boxaGetExtentFunction · 0.85
boxaSizeRangeFunction · 0.85
boxaLocationRangeFunction · 0.85
boxaGetAreaFunction · 0.85
ptaaGetBoundaryPixelsFunction · 0.85
ccbaGenerateGlobalLocsFunction · 0.85

Calls 3

boxaGetBoxFunction · 0.85
boxGetGeometryFunction · 0.85
boxDestroyFunction · 0.85

Tested by

no test coverage detected