• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Incompatible types error using vImage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Incompatible types error using vImage


  • Subject: Re: Incompatible types error using vImage
  • From: Ken Tozier <email@hidden>
  • Date: Wed, 31 Mar 2004 23:11:50 -0500

On Mar 31, 2004, at 11:54 AM, Fritz Anderson wrote:

> The second parameter is supposed to be an array of vImage_Buffer
> pointers. Declare result to be
> vImage_Buffer * result[3];
>
> initialize
> result[i] = malloc(sizeof(vImage_Buffer)); // etc
>
> and pass it as result.

Fritz,

I tried what you said, and am still getting the exact same compiler
error:

vImage_Buffer *result[3];

result[0] = malloc(sizeof(vImage_Buffer));
result[1] = malloc(sizeof(vImage_Buffer));
result[2] = malloc(sizeof(vImage_Buffer));

err = vImageConvert_ChunkyToPlanar8 (
(void *)sourceChannels,
result,
3,
3,
[self pixelsWide],
[self pixelsHigh],
[self bytesPerRow],
flags
);


-> passing arg 2 of `vImageConvert_ChunkyToPlanar8' from incompatible
pointer type

Maybe the vImage header file is wrong? I'm really puzzled by this one...

Ken

>
> -- F
>
> On 31 Mar 2004, at 1:48 AM, Ken Tozier wrote:
>
>> 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 *result = (vImage_Buffer *) malloc(3 *
>> sizeof(vImage_Buffer));
> ...
>> 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
>> );
>>
> --
> Fritz Anderson
> Consulting Programmer
> http://resume.manoverboard.org/
> _______________________________________________
> 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.
_______________________________________________
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.


  • Prev by Date: Re: Getting the Value of an NSSecureTextField
  • Next by Date: Re: NSNotificationCenter not working
  • Previous by thread: Re: Incompatible types error using vImage
  • Next by thread: printing a stack trace to the console
  • Index(es):
    • Date
    • Thread