[Gdal-dev] Complex Data Types
Matt Hanson
mhanson at photon.com
Wed Aug 23 09:39:43 EDT 2006
Ok, so if I defined my own complex structure
struct CInt16 {
int16 real;
int16 imag;
}
and declare a pointer for a 100x100 section:
CInt16 *cbuff = new CInt16[100*100]
I *think* I should be able to pass this to RasterIO using the GDT_CInt16 type, correct?
-matt
________________________________
From: Frank Warmerdam [mailto:warmerdam at pobox.com]
Sent: Tue 8/22/2006 3:24 PM
To: Matt Hanson
Cc: gdal-dev at lists.maptools.org
Subject: Re: [Gdal-dev] Complex Data Types
Matt Hanson wrote:
> I'm a little confused with regard to GDAL's handling of complex data
> types. As there is no built in complex types for C++ what is RasterIO
> expecting as a buffer type when using the GDT_C* data types? Would it
> simply be a pointer of twice the normal length?
Matt,
Essentially the complex data types are passed around as pairs of the
basic data type. So an array of GDT_CInt16 would be an array of GInt16's
but with two values (real followed by imaginary) for each value.
So, the answer to your question is "yes".
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | President OSGF, http://osgeo.org <http://osgeo.org/>
More information about the Gdal-dev
mailing list