Slide 24
Slide 24 text
/*
...
static JDIMENSION read_scanlines(j_decompress_ptr dinfo, unsigned char *buf, int stride, int height) {
JSAMPROW *rows = alloca(sizeof(JSAMPROW) * height);
int i;
for (i = 0; i < height; i++) {
rows[i] = &buf[i * stride];
}
return jpeg_read_scanlines(dinfo, rows, height);
}
*/
import "c"
func (dec *Decoder) ReadScanline(p [][]uint8) (n int, err error) {
n := C.read_scanline(dec.dinfo, p, dec.Stride, dec.Height);
return n, nil
}
libjpegͷ߹jpeg_read_scanlinesΛݺͿ͚ͩ