[artoolkit-commits] artoolkit/lib/SRC/VideoMacOSX video.c, 1.27, 1.28
Optical marker tracking and overlay for augmented reality.
Brought to you by:
philip_lamb
From: Philip L. <phi...@us...> - 2007-09-27 09:26:10
|
Update of /cvsroot/artoolkit/artoolkit/lib/SRC/VideoMacOSX In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv3172 Modified Files: video.c Log Message: Fix for pixelFormat bug on Intel, noted by John Galeotti. Index: video.c =================================================================== RCS file: /cvsroot/artoolkit/artoolkit/lib/SRC/VideoMacOSX/video.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** video.c 6 Aug 2007 02:40:56 -0000 1.27 --- video.c 27 Sep 2007 09:26:11 -0000 1.28 *************** *** 25,28 **** --- 25,29 ---- * to allow earlier versions, AR_VIDEO_SUPPORT_OLD_QUICKTIME must * be uncommented at compile time. + * 1.4.2 2007-09-26 GALEOTTI Made -pixelformat work for format 40 and for Intel Macs. * */ *************** *** 1326,1330 **** --- 1327,1335 ---- if (strlen(line) <= 13) err_i = 1; else { + #ifdef AR_BIG_ENDIAN if (strlen(line) == 17) err_i = (sscanf(&line[13], "%4c", (char *)&pixFormat) < 1); + #else + if (strlen(line) == 17) err_i = (sscanf(&line[13], "%c%c%c%c", &(((char *)&pixFormat)[3]), &(((char *)&pixFormat)[2]), &(((char *)&pixFormat)[1]), &(((char *)&pixFormat)[0])) < 1); + #endif else err_i = (sscanf(&line[13], "%li", (long *)&pixFormat) < 1); // Integer. } *************** *** 1396,1401 **** case k8IndexedGrayPixelFormat: bytesPerPixel = 1l; default: ! fprintf(stderr, "ar2VideoOpen(): Unsupported pixel format requested.\n"); return(NULL); break; --- 1401,1413 ---- case k8IndexedGrayPixelFormat: bytesPerPixel = 1l; + break; default: ! fprintf(stderr, "ar2VideoOpen(): Unsupported pixel format requested: 0x%08x = %u = '%c%c%c%c'.\n", (unsigned int)pixFormat, (unsigned int)pixFormat, ! #ifdef AR_BIG_ENDIAN ! ((char *)&pixFormat)[0], ((char *)&pixFormat)[1], ((char *)&pixFormat)[2], ((char *)&pixFormat)[3] ! #else ! ((char *)&pixFormat)[3], ((char *)&pixFormat)[2], ((char *)&pixFormat)[1], ((char *)&pixFormat)[0] ! #endif ! ); return(NULL); break; |