Пример #1
0
/* public */
int read_ppm(int fd, struct ppm_info *ppm)
{
    int row, ret;

    ret = read_ppm_init(fd, ppm);
    if(ret != PLUGIN_OK) {
        return ret;
    }

    for (row = 0; row < ppm->y; ++row) {
        ret = read_ppm_row(fd, ppm, row);
        if(ret != PLUGIN_OK) {
            return ret;
        }
        iv->cb_progress(row, ppm->y);
    }
    return PLUGIN_OK;
}
Пример #2
0
int read_ppm(int fd, 
             int * const cols, 
             int * const rows, 
             int * const maxval)
{
    int row;
    int format;

    read_ppm_init(fd, cols, rows, maxval, &format);
    
    if(format == PLUGIN_ERROR) {
        return PLUGIN_ERROR;
    }
    
    for (row = 0; row < *rows; ++row) {
        if( read_ppm_row(fd, row, *cols, *rows, *maxval, format) == PLUGIN_ERROR) {
            return PLUGIN_ERROR;
        }
    }
    return 1;
}