Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reading 10 bit uncompressed 4:2:2 QuickTimes?



Paul,

To determine the actual precision of a pixel, use 'ICMGetPixelFormatInfo()' and look at the 'bitsPerPixel' field of the 'ICMPixelFormatInfo'.

Currently I am not using any of the ICM functions. Do you have any pointers to sample code on how to call ICMGetPixelFormatInfo?

Here's some code that calls 'ICMGetPixelFormatInfo()' for 'k64ARGBPixelFormat'. Note that QuickTime still doesn't yet set the 'cmpCount' and 'cmpSize' for any of its built-in pixel formats, and that it only bothers to set the 'horizontalSubsampling' and 'verticalSubsampling' fields for pixel formats whose components are nonuniformly sampled.


OSErr lError = noErr;
long lQuickTimeVersion;
OSType lPixelFormat = k64ARGBPixelFormat;
ICMPixelFormatInfo lPixelFormatInfo;
Gestalt(gestaltQuickTimeVersion, &lQuickTimeVersion);
lPixelFormatInfo.size = sizeof(ICMPixelFormatInfo);
lError = ICMGetPixelFormatInfo(lPixelFormat, &lPixelFormatInfo);
if (!lError){
unsigned int lPlaneIndex = 0;
printf("Pixel format '%c%c%c%c' (0x%08X)\n", lPixelFormat>>24, lPixelFormat>>16, lPixelFormat>>8, lPixelFormat, lPixelFormat);
printf("\tformatFlags 0x%08X\n", lPixelFormatInfo.formatFlags);
printf("\tdefaultGammaLevel %x\n", lPixelFormatInfo.defaultGammaLevel);
if (lQuickTimeVersion>0x06500000){
printf("\tcmpCount %d\n", lPixelFormatInfo.cmpCount);
printf("\tcmpSize %d\n", lPixelFormatInfo.cmpSize);
}
for (lPlaneIndex=0; lPixelFormatInfo.bitsPerPixel [lPlaneIndex]; lPlaneIndex++){
printf("\tplane %d:\n", lPlaneIndex);
printf("\t\tbitsPerPixel %d\n", lPixelFormatInfo.bitsPerPixel[lPlaneIndex]);
if (lQuickTimeVersion>0x06000000){
printf("\t\thorizontalSubsampling %d\n", lPixelFormatInfo.horizontalSubsampling[lPlaneIndex]);
printf("\t\tverticalSubsampling %d\n", lPixelFormatInfo.verticalSubsampling[lPlaneIndex]);
}
}
}


Andreas Wittenstein
BitJazz Inc.
http://www.bitjazz.com/sheervideo/

_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-api/email@hidden

This email sent to email@hidden
References: 
 >reading 10 bit uncompressed 4:2:2 QuickTimes? (From: Paul Miller <email@hidden>)
 >Re: reading 10 bit uncompressed 4:2:2 QuickTimes? (From: Andreas Wittenstein <email@hidden>)
 >Re: reading 10 bit uncompressed 4:2:2 QuickTimes? (From: Paul Miller <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.