HI,
I developed one application in which i draw one line for evry 1 milli second depending upon receving data(signal strength).
depending on signal strength now i am setting pixel color as
below:
if((rowno++)<orthoT)
{
for (j = 10400; j < 13600; j++)
{
zindex=(j-10400)/DIV_FACTOR;
checkImage[i][zindex][0] = ZTable[j].SigLevel+90;
// qDebug()<<"signal strength"<<ZTable[j].SigLevel;
checkImage[i][zindex][1] = ZTable[j].SigLevel+90;
checkImage[i][zindex][2] = ZTable[j].SigLevel+50;
}
}
else
{
rowno=orthoT-1;
i=rowno;
memcpy(checkImage,&checkImage[1],sizeof(checkImage));
//qDebug()<<" After memcpy";
for (j = 10400; j < 13600; j++)
{
zindex=(j-10400)/DIV_FACTOR;
checkImage[i][zindex][0] = ZTable[j].SigLevel + 90;
checkImage[i][zindex][1] = ZTable[j].SigLevel + 90;
checkImage[i][zindex][2] = ZTable[j].SigLevel +50;
}
and then
glDrawPixels(width,height,GL_RGB,GL_UNSIGNED_BYTE,checkimage);
here i am not getting colors as required. It is giving almost same.
Now i am thinking to use GL_COLOR_INDEX instead of GL_RGBA. so that we can create different colors for different range of signal strengths. But i don’t know how to create colot table and then map that one.
Can any one send me example for this one.
Thanks in advance