! * \brief pixacompExtendArray() * * \param[in] pixac * \return 0 if OK; 1 on error * * * Notes: * (1) We extend the boxa array simultaneously. This is * necessary in case we are NOT adding boxes simultaneously * with adding pixc. We always want the sizes of the * pixac and boxa ptr arrays to be equal. * */
| 990 | * </pre> |
| 991 | */ |
| 992 | static l_int32 |
| 993 | pixacompExtendArray(PIXAC *pixac) |
| 994 | { |
| 995 | PROCNAME("pixacompExtendArray"); |
| 996 | |
| 997 | if (!pixac) |
| 998 | return ERROR_INT("pixac not defined", procName, 1); |
| 999 | |
| 1000 | if ((pixac->pixc = (PIXC **)reallocNew((void **)&pixac->pixc, |
| 1001 | sizeof(PIXC *) * pixac->nalloc, |
| 1002 | 2 * sizeof(PIXC *) * pixac->nalloc)) == NULL) |
| 1003 | return ERROR_INT("new ptr array not returned", procName, 1); |
| 1004 | pixac->nalloc = 2 * pixac->nalloc; |
| 1005 | boxaExtendArray(pixac->boxa); |
| 1006 | return 0; |
| 1007 | } |
| 1008 | |
| 1009 | |
| 1010 | /*! |
no test coverage detected