Re: Swapping NSBitmapImageRep bitmapData's
Re: Swapping NSBitmapImageRep bitmapData's
- Subject: Re: Swapping NSBitmapImageRep bitmapData's
- From: Ken Tabb <email@hidden>
- Date: Mon, 11 Jun 2001 18:22:12 +0100
And so it was that Stiphane Sudre said on 11/6/01 6:07 pm:
>
>
On lundi, juin 11, 2001, at 05:47 PM, Ken Tabb wrote:
>
>
> Hi,
>
> is there any way to swap the bitmapData array in an NSBitmapImageRep? I
>
> have some image processing code in which I would like to swap the array
>
> being pointed to by the NSBitmapImageRep. The 2 arrays are of the same
>
> length / pixel order / depth etc., just showing a different picture.
>
>
>
> Is this possible... the API docs only seem to suggest ways of getting an
>
> NSBitmapImageRep's bitmapData, rather than setting it.
>
>
Stupid suggestion:
>
>
Get the bitmap data of the NSBitmapImageRep and then copy the new array
>
into it and redisplay the NSBitmapImageRep (since they share the same
>
dimension, depth and others).
>
>
Keep a copy of the old current array in case you want to swap again.
Thanks for the suggestion, but I was aiming to prevent the need for
copying the whole array. Some of my image processing requires a source
bitmap (array) and a destination bitmap (array). If I could change which
array the NSBitmapImageRep is pointing to then it's a lot faster than
copying the whole thing each time (there's a lot of image processing
going on, resulting in about 10 swaps per image).
So does anyone reckon this is possible?
Thanks in advance,
Ken
---------
Ken Tabb.
Mac & UNIX C/C++/Java developer (Health & Human Sciences),
Machine Vision researcher/programmer (Computer Science),
University of Hertfordshire, England
http://www.health.herts.ac.uk/ken/
Certified non-Microsoft Solution Provider