[Gdal-dev] Creating an empty ColorTable in C++
Roger Bivand
Roger.Bivand at nhh.no
Tue Aug 29 05:55:07 EDT 2006
I'm trying to replicate some of the inner logic of rgb2cpt.py in a C++
function from R. I'm stuck on how to declare/initialize a GDALColorTable
*ct for GDALComputeMedianCutPCT() and GDALDitherRGB2PCT() - I'm using:
GDALColorTable *ct = pRasterBand->GetColorTable();
where pRasterBand is the red band of the input data set. This obviously
upsets GDALComputeMedianCutPCT() which seems to want a naked ColorTable,
and seg.faults:
#0 0xb798bf3a in GDALColorTable::SetColorEntry ()
from /usr/local/lib/libgdal.so.1
#1 0xb798bfe5 in GDALSetColorEntry () from /usr/local/lib/libgdal.so.1
#2 0xb79b742e in GDALComputeMedianCutPCT () from /usr/local/lib/libgdal.so.1
How should I declare ct?
Grateful for any hints,
Roger
--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no
More information about the Gdal-dev
mailing list