i don't know, honestly. the OP provides instructions that don't appear to align with it's intended function (there is a 'bug' in his question, if you will )
at this point, i think we just need to communicate with a more precise language than english. here's my best guess as to what he's trying to do:
Code:
//---------------------------------------------------------------------------
class color
{
unsigned char pixel[4];
public:
unsigned char &a;
unsigned char &b;
unsigned char &g;
unsigned char &r;
unsigned int &intVal;
const float minFloat;
const float maxFloat;
color(const float _minFloat,const float _maxFloat) :
r(pixel[0]),
g(pixel[1]),
b(pixel[2]),
a(pixel[3]),
intVal(*(unsigned int *)pixel),
minFloat(_minFloat),
maxFloat(_maxFloat)
{
intVal = 0;
}
float asFloat()
{
return (float)intVal*(maxFloat-minFloat)/0xFFFFFFFF+minFloat;
}
};
int main(int argc, char* argv[])
{
color c(0,1);
c.intVal = 0x00AABBCC;
float f = c.asFloat();
return 0;
}
//---------------------------------------------------------------------------
drsnuggles, please discuss how this may or may not accomplish what you're trying to do. i think at this point, code will be the clearest means of communication.