so far ive got
int width;
int height;
int bitdepth;
stringstream ss;
string str;
typedef unsigned char byte
int _tmain(int argc, _TCHAR* argv[])
{
str = argv[1];
stringstream(str) >> width;
str = argv[2];
stringstream(str) >> height;
str = argv[3];
stringstream(str) >> bitdepth;
ifstream inFile(argv[4], ios::in | ios::binary);
byte * array = new byte[width*height];
int * intA = new int[width*height];
int x;
while(x < width*height)
{
inFile >> array[x];
x++;
}
for(int k = 0; k < width*height; k++)
intA[k] = (int)array[k];
return 0;
}
when i run this with
rawread<width><height><bitdepth><filename> in the command line i get a multitude of "=" (equal) signs!?
help please, and ive just gotten to know C++ so simple is better. I just want to read a picture into an array of integers, so that i can do things like invert it by subtracting from 255 etc.... Thanks.