src/pixabasic.c
l_int32
pixaaAddPixa(PIXAA   *pixaa,
             PIXA    *pixa,
             l_int32  copyflag)
{
l_int32  n;
PIXA    *pixac;

    PROCNAME("pixaaAddPixa");

    if (!pixaa)
        return ERROR_INT("pixaa not defined", procName, 1);
    if (!pixa)
        return ERROR_INT("pixa not defined", procName, 1);
    if (copyflag != L_INSERT && copyflag != L_COPY &&
        copyflag != L_CLONE && copyflag != L_COPY_CLONE)
        return ERROR_INT("invalid copyflag", procName, 1);

    if (copyflag == L_INSERT)
        pixac = pixa;
    else {
        if ((pixac = pixaCopy(pixa, copyflag)) == NULL)
            return ERROR_INT("pixac not made", procName, 1);
    }

    n = pixaaGetCount(pixaa);
    if (n >= pixaa->nalloc)
        pixaaExtendArray(pixaa);
    pixaa->pixa[n] = pixac;
    pixaa->n++;

    return 0;
}
/*!
 *  pixaaAddPixa()
 *
 *      Input:  pixaa
 *              pixa  (to be added)
 *              copyflag:
 *                L_INSERT inserts the pixa directly
 *                L_COPY makes a new pixa and copies each pix and each box
 *                L_CLONE gives a new handle to the input pixa
 *                L_COPY_CLONE makes a new pixa and inserts clones of
 *                    all pix and boxes
 *      Return: 0 if OK; 1 on error
 */
pixaaAddPixa()
Input:  pixaa
pixa  (to be added)
copyflag:
L_INSERT inserts the pixa directly
L_COPY makes a new pixa and copies each pix and each box
L_CLONE gives a new handle to the input pixa
L_COPY_CLONE makes a new pixa and inserts clones of
all pix and boxes
Return: 0 if OK; 1 on error
pixaaAddPixa () Input : pixaa pixa ( to be added ) copyflag : L_INSERT inserts the pixa directly L_COPY makes a new pixa and copies each pix and each box L_CLONE gives a new handle to the input pixa L_COPY_CLONE makes a new pixa and inserts clones of all pix and boxes Return : 0 if OK ; 1 on error
l_int32
pixaaAddPixa(PIXAA   *pixaa,
             PIXA    *pixa,
             l_int32  copyflag)
{
l_int32  n;
PIXA    *pixac;
    PROCNAME("pixaaAddPixa");
    if (!pixaa)
        return ERROR_INT("pixaa not defined", procName, 1);
    if (!pixa)
        return ERROR_INT("pixa not defined", procName, 1);
    if (copyflag != L_INSERT && copyflag != L_COPY &&
        copyflag != L_CLONE && copyflag != L_COPY_CLONE)
        return ERROR_INT("invalid copyflag", procName, 1);
    if (copyflag == L_INSERT)
        pixac = pixa;
    else {
        if ((pixac = pixaCopy(pixa, copyflag)) == NULL)
            return ERROR_INT("pixac not made", procName, 1);
    }
    n = pixaaGetCount(pixaa);
    if (n >= pixaa->nalloc)
        pixaaExtendArray(pixaa);
    pixaa->pixa[n] = pixac;
    pixaa->n++;
    return 0;
}
l_int32 pixaaAddPixa ( PIXAA * pixaa , PIXA * pixa , l_int32 copyflag ) { l_int32 n ; PIXA * pixac ; PROCNAME ( " " ) ; if ( ! pixaa ) return ERROR_INT ( " " , procName , 1 ) ; if ( ! pixa ) return ERROR_INT ( " " , procName , 1 ) ; if ( copyflag != L_INSERT && copyflag != L_COPY && copyflag != L_CLONE && copyflag != L_COPY_CLONE ) return ERROR_INT ( " " , procName , 1 ) ; if ( copyflag == L_INSERT ) pixac = pixa ; else { if ( ( pixac = pixaCopy ( pixa , copyflag ) ) == NULL ) return ERROR_INT ( " " , procName , 1 ) ; } n = pixaaGetCount ( pixaa ) ; if ( n >= pixaa -> nalloc ) pixaaExtendArray ( pixaa ) ; pixaa -> pixa [ n ] = pixac ; pixaa -> n ++ ; return 0 ; }
pixaaAddPixa()
      Input:  pixaa
              pixa  (to be added)
              copyflag:
                L_INSERT inserts the pixa directly
                L_COPY makes a new pixa and copies each pix and each box
                L_CLONE gives a new handle to the input pixa
                L_COPY_CLONE makes a new pixa and inserts clones of
                    all pix and boxes
      Return: 0 if OK; 1 on error
pixaaAddPixa () Input : pixaa pixa ( to be added ) copyflag : L_INSERT inserts the pixa directly L_COPY makes a new pixa and copies each pix and each box L_CLONE gives a new handle to the input pixa L_COPY_CLONE makes a new pixa and inserts clones of all pix and boxes Return : 0 if OK ; 1 on error