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: QTNewGWorldFromPtr for large width images




On May 31, 2005, at 12:26 PM, Santino wrote:

At 9:30 -0500 31-05-2005, Scott Thompson wrote:

On May 30, 2005, at 4:58 PM, Pradeep Kumar wrote:

I am using the OpenGL Image sample code to open a panorama image with dimensions 7000+
X 3000+ pixels. It leaves a big rectangle of black area on the top left area when displaying in
the window. I open the same image in qtgraphics QuickTime sample code and the image
displays fine in the window. Although the code used in both these sample code uses Graphic
Importer component to draw the only difference is that in the qtgraphics renders the image to
a window and the OpenGL image sample code renders the image to a GWorld created using
QTNewGWorldFromPtr.


Is there a difference between the GWorld created by QTNewGWorld and NewGWorld variants
and the one that is created for the window by NewCWindow?


There really shouldn't be any difference between the ports created by all of these methods, unless you are using different pixel formats. QTNewGWorld allows you to create GWorlds with pixel types that that QuickDraw doesn't understand.

I realize that the rowBytes parameter is a limiting factor of GWorld, but is there a way to work around this?


At 7000 pixels wide your rowBytes should be somewhere in the neighborhood of 28000. This is certainly a small enough number to fit into a long valued variable like the rowBytes. How do you find the "rowByes" parameter to be a limiting factor?




It seems to me that rowBytes in a QuickDraw PixMap is a short (16 bits) and the max value is 0x7FFF but I remember from some the OS8 sources that you can not create RGB pixmap with more than 4000 points.



Rowbytes was indeed a short in a PixMap, but the top two bits were used as flags, and so as a result, the maximum rowbytes was 0x3fff, so 16383/4 gives you a hard limit 4095 for 32 bit pix (and less once you took into account padding that was done).

However, "extended" pixmaps (introduced in OS 9?) had a separate field for things like this, and it was declared as a long (and "was" being the key word here - it was only exposed in one version of the headers) so using a gworld as wide as one would reasonably want has been doable ever since (there were some minor limitations with certain printer drivers in OS 9, but again, that was "back in the day").


Glenn Andreas email@hidden <http://www.gandreas.com/> wicked fun! Widgetarium | the quickest path to widgets

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

This email sent to email@hidden
References: 
 >QTNewGWorldFromPtr for large width images (From: "Pradeep Kumar" <email@hidden>)
 >Re: QTNewGWorldFromPtr for large width images (From: Scott Thompson <email@hidden>)
 >Re: QTNewGWorldFromPtr for large width images (From: Santino <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.