Mailing Lists: Apple Mailing Lists

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

Incompatible types error using vImage



I'm trying to package the vImage function
"vImageConvert_ChunkyToPlanar8" inside an easier to use
NSBitmapImageRep category like the following but it keeps choking on
the indicated line. I'm sure it's a simple "C" syntax error, but
nothing I've tried satisfies the compiler. Could someone point out what
I'm doing wrong?

- (vImage_Buffer *) planar8Data
{
vImage_Error err = kvImageNoError;
vImage_Flags flags = 0;
vImage_Buffer *result = (vImage_Buffer *) malloc(3 *
sizeof(vImage_Buffer));

void *sourceChannels[3] = { [self bitmapData],
[self bitmapData] + 1,
[self bitmapData] + 2};

(result + 0)->height = (result + 1)->height = (result + 2)->height =
[self pixelsHigh];
(result + 0)->width = (result + 1)->width = (result + 2)->width =
[self pixelsWide];
(result + 0)->rowBytes = (result + 1)->rowBytes = (result +
2)->rowBytes = [self bytesPerRow];

err = vImageConvert_ChunkyToPlanar8 (
(void *)sourceChannels,
//----------------------------- this is the problem line
---------------------------------
// this doesn't work
result,

// neither does this
(vImage_Buffer *) result,

// nor this
&result
/
/-----------------------------------------------------------------------
-----------------------
3,
3,
[self pixelsWide],
[self pixelsHigh],
[self bytesPerRow],
flags
);
}

The function is defined like so in the vImage documentation:

vImage_Error vImageConvert_ChunkyToPlanar8 (
const void *srcChannels[],
const vImage_Buffer *destPlanarBuffers[],
unsigned int channelCount,
size_t srcStrideBytes,
unsigned int srcWidth,
unsigned int srcHeight,
unsigned int srcRowBytes,
vImage_Flags flags
);

Thanks for any help

Ken
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.




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.