[Openrm-users] Change to readJPEG
Brought to you by:
wbethel
From: Tim R. <ro...@ga...> - 2003-10-07 06:27:44
|
While fiddling around with openrm some more, I discovered something odd. It appears that openGL wants it's texture images flipped upside down rather than what one would expect. I've modified step 6 in readJPEG below, to perform this flip. (hopefully I did it right, but it seems to work now for my purposes) BTW- I just wanted to mention as a side note, I've managed to create a userdefined primitive for two different animation libraries now (cal3d and glass). Both were exceedingly simply to patch into openRM. /* Step 6: while (scan lines remain to be read) */ /* jpeg_read_scanlines(...); */ /* Here we use the library's state variable cinfo.output_scanline as the * loop counter, so that we don't have to keep track ourselves. */ indx = row_stride * (cinfo.output_height-1); while (cinfo.output_scanline < cinfo.output_height) { /* jpeg_read_scanlines expects an array of pointers to scanlines. * Here the array is only one element long, but you could ask for * more than one scanline at a time if that's more convenient. */ (void) jpeg_read_scanlines(&cinfo, buffer, 1); /* Assume put_scanline_someplace wants a pointer and sample count. */ /* put_scanline_someplace(buffer[0], row_stride); */ memcpy(pd+indx, buffer[0], row_stride); indx -= row_stride; } --- Tim Rightnour <ro...@ga...> NetBSD: Free multi-architecture OS http://www.netbsd.org/ NetBSD supported hardware database: http://mail-index.netbsd.org/cgi-bin/hw.cgi |