|
From: | Fabio Mascelloni |
Subject: | Mapping float values to colors. |
Date: | Tue, 27 Jul 1999 21:25:29 +0200 |
- updateRaster
{
unsigned row,column;
unsigned current_element=0;
for (row=0 ; row <matrixDim ;row++)
for (column=0 ; column <matrixDim
; column++)
{
[colMap setColor: currentelement ToRed: (double) new_mean[i][j]
Green:0 Blue:0];
[dsplRaster drawPointX: i Y: j Color: currentelement];
current_element++;
}
[dsplRaster drawSelf];
return self;
}
But Colormap seems to dislike the re-assignement of the colors.
Then I thought to rebuild the Colormap each time,creating it in its
own Zone,which was dropped after the raster
had been updated:
- updateRaster
{
unsigned row,column;
unsigned current_element=0;
id <Colormap> colMap;
id <Zone> newZone;
newZone=[Zone create:[self getZOne]];
colMap=[Colormap create: newZone];
[dsplRaster setColorMap: colMap];
for (row=0 ; row <matrixDim ;row++)
for (column=0 ; column <matrixDim
; column++)
{
[colMap setColor: currentelement ToRed: (double) new_mean[i][j]
Green:0 Blue:0];
[dsplRaster drawPointX: i Y: j Color: currentelement];
current_element++;
}
[dsplRaster drawSelf];
[newZone drop];
return self;
}
This method doesn't work too.
So,can you tell me where did I go wrong and how can I could face this
problem?
Thanks in advance,Fabio.
[Prev in Thread] | Current Thread | [Next in Thread] |