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: drawing an array of pixels to the screen




What you say is true, but it seems unlikely to me that an imaging operation would be coded with fixed dimensions. More likely that each operation is a function taking image arguments with specified dimensions. In the 2d case


    fun(pixel **image, ...)

the pixels are accessed as image[y][x], and in the 1d case

   fun(pixel *image, int w, ...)

one would have to write image[y * w + x].

dave

On 12-Nov-07, at 7:38 AM, Erik Buck wrote:

There seems to be some confusion.

 In C, the following two arrays are interchangeable:

 int   twoDArray[100][500];
 int   oneDArray[100 * 500];

Both occupy the same amount of memory. They can be cast back and forth harmlessly. Both are of the following assignments are legal and meaningful:

 int   *array = twoDArray;
 int   *array = oneDArray;

Both styles of array decalartion are usable with - initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bitmapFormat:bytesPerRow:bitsPerPixel
and with openGL.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: drawing an array of pixels to the screen (From: Erik Buck <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.