src/graphics.c
PTA  *
generatePtaBoxa(BOXA    *boxa,
                l_int32  width,
                l_int32  removedups)
{
l_int32  i, n;
BOX     *box;
PTA     *ptad, *ptat, *pta;

    PROCNAME("generatePtaBoxa");

    if (!boxa)
        return (PTA *)ERROR_PTR("boxa not defined", procName, NULL);

    n = boxaGetCount(boxa);
    ptat = ptaCreate(0);
    for (i = 0; i < n; i++) {
        box = boxaGetBox(boxa, i, L_CLONE);
        pta = generatePtaBox(box, width);
        ptaJoin(ptat, pta, 0, 0);
        ptaDestroy(&pta);
        boxDestroy(&box);
    }

    if (removedups)
        ptad = ptaRemoveDuplicates(ptat, 0);
    else
        ptad = ptaClone(ptat);

    ptaDestroy(&ptat);
    return ptad;
}
/*!
 *  generatePtaBoxa()
 *
 *      Input:  boxa
 *              width
 *              removedups  (1 to remove, 0 to leave)
 *      Return: ptad, or null on error
 *
 *  Notes:
 *      (1) If the boxa has overlapping boxes, and if blending will
 *          be used to give a transparent effect, transparency
 *          artifacts at line intersections can be removed using
 *          removedups = 1.
 */
generatePtaBoxa()
Input:  boxa
width
removedups  (1 to remove, 0 to leave)
Return: ptad, or null on error

(1) If the boxa has overlapping boxes, and if blending will
be used to give a transparent effect, transparency
artifacts at line intersections can be removed using
removedups = 1.
generatePtaBoxa () Input : boxa width removedups ( 1 to remove 0 to leave ) Return : ptad or null on error ( 1 ) If the boxa has overlapping boxes and if blending will be used to give a transparent effect transparency artifacts at line intersections can be removed using removedups = 1 .
PTA  *
generatePtaBoxa(BOXA    *boxa,
                l_int32  width,
                l_int32  removedups)
{
l_int32  i, n;
BOX     *box;
PTA     *ptad, *ptat, *pta;
    PROCNAME("generatePtaBoxa");
    if (!boxa)
        return (PTA *)ERROR_PTR("boxa not defined", procName, NULL);
    n = boxaGetCount(boxa);
    ptat = ptaCreate(0);
    for (i = 0; i < n; i++) {
        box = boxaGetBox(boxa, i, L_CLONE);
        pta = generatePtaBox(box, width);
        ptaJoin(ptat, pta, 0, 0);
        ptaDestroy(&pta);
        boxDestroy(&box);
    }
    if (removedups)
        ptad = ptaRemoveDuplicates(ptat, 0);
    else
        ptad = ptaClone(ptat);
    ptaDestroy(&ptat);
    return ptad;
}
PTA * generatePtaBoxa ( BOXA * boxa , l_int32 width , l_int32 removedups ) { l_int32 i , n ; BOX * box ; PTA * ptad , * ptat , * pta ; PROCNAME ( " " ) ; if ( ! boxa ) return ( PTA * ) ERROR_PTR ( " " , procName , NULL ) ; n = boxaGetCount ( boxa ) ; ptat = ptaCreate ( 0 ) ; for ( i = 0 ; i < n ; i ++ ) { box = boxaGetBox ( boxa , i , L_CLONE ) ; pta = generatePtaBox ( box , width ) ; ptaJoin ( ptat , pta , 0 , 0 ) ; ptaDestroy ( & pta ) ; boxDestroy ( & box ) ; } if ( removedups ) ptad = ptaRemoveDuplicates ( ptat , 0 ) ; else ptad = ptaClone ( ptat ) ; ptaDestroy ( & ptat ) ; return ptad ; }
generatePtaBoxa()
      Input:  boxa
              width
              removedups  (1 to remove, 0 to leave)
      Return: ptad, or null on error
generatePtaBoxa () Input : boxa width removedups ( 1 to remove 0 to leave ) Return : ptad or null on error