! * \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 */
| 858 | * \return 0 if OK, 1 on error |
| 859 | */ |
| 860 | l_int32 |
| 861 | boxaGetBoxGeometry(BOXA *boxa, |
| 862 | l_int32 index, |
| 863 | l_int32 *px, |
| 864 | l_int32 *py, |
| 865 | l_int32 *pw, |
| 866 | l_int32 *ph) |
| 867 | { |
| 868 | BOX *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 | /*! |
no test coverage detected