Carl,
Thanks for your comments. I've replied below.
> <code>
> float** ppf = static_cast<float**>(ppInputArray);
[quoted text clipped - 5 lines]
> for (...)
> </code>
This gives me an "error C2440: 'static_cast': cannot convert from
'void**' to 'float**'". I'm new to c++ and am surprised at how hard it is
to get the compiler to swallow this. What is the purpose of void pointers
if the compiler won't allow you to cast them? Is there a project option I
can use?
> Note that this is an odd organization for an array of triples. In
> memory, this will have all of the Red values, followed by all of the
[quoted text clipped - 3 lines]
> typically the RGB values of a particular triple will be adjacent in
> memory. In that case, you would want something like:
This format (and library) is inherited from satellite imagery which can
have many bands. Its known as BIL or binary interleaved (I think). Its
from the ERMapper ECW/JPeg200 sdk.
..snip..
> One other comment: passing the input array as a double-indirect
> pointer often implies that the called routine is expected to allocate
[quoted text clipped - 16 lines]
> If you're not allocating the array in the callback, there's really no
> point in passing a pointer to pointer parameter.
Well this is interesting. I dont think this is the case as there are some
working examples for the C interface that don't allocate memory. In those
examples it is dereferenced like this:
float *pRed = ppInputArray[0];
but that won't compile in c++ either.
cheers
Marc
Marc Pelletier - 07 Jun 2005 16:11 GMT
> This gives me an "error C2440: 'static_cast': cannot convert from
> 'void**' to 'float**'". I'm new to c++ and am surprised at how hard it
> is to get the compiler to swallow this. What is the purpose of void
> pointers if the compiler won't allow you to cast them? Is there a
> project option I can use?
I should probably also mention I am using visual studio .net 7.1.3088
cheers
Marc
David Lowndes - 07 Jun 2005 23:04 GMT
>> float** ppf = static_cast<float**>(ppInputArray);
>This gives me an "error C2440: 'static_cast': cannot convert from
>'void**' to 'float**'".
Try reinterpret_cast rather than static_cast.
Dave

Signature
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Carl Daniel [VC++ MVP] - 07 Jun 2005 23:32 GMT
>>> float** ppf = static_cast<float**>(ppInputArray);
>
>>This gives me an "error C2440: 'static_cast': cannot convert from
>>'void**' to 'float**'".
>
> Try reinterpret_cast rather than static_cast.
'zactly.
-cd
Marc Pelletier - 08 Jun 2005 01:42 GMT
> Try reinterpret_cast rather than static_cast.
That works!
So does this
float *Red = (float *)(ppInputArray[0]);
float *Green = (float *)(ppInputArray[1]);
float *Blue = (float *)(ppInputArray[2]);
Thanks everyone.
cheers
Marc