PIC_NCHAN(pf), PIC_WIDTH(pf), PIC_HEIGHT(pf),
PIC_SAMEARGS(pf) (see picopen_w)
PICFILE *pf = picopen_r("file");
extern char pixels[], green[][1000];
extern float zdepth[][1000];
for(i=0; picread(pf, pixels); i)
picunpack(pf, pixels, "_c_f", green[i], zdepth[i]);
PICFILE *in = picopen_r("picture");
PICFILE *out = picopen_w("OUT", PIC_SAMEARGS(in));
int w = PIC_WIDTH(in);
int n = PIC_NCHAN(in);
char *buffer = malloc(w*n), *temp = malloc(n);
while (picread(in, buffer)) {
char *left = buffer;
char *right = buffer + n*(w - 1);
for( ; left<right; left+=n, right-=n) {
memmove(temp, left, n);
memmove(left, right, n);
memmove(right, temp, n);
}
picwrite(out, buffer);
}