Imageクラスは、BMPクラスのサブクラスです。このメソッドで画像を操作するために、BMPクラスのいくつかのメソッドTellHeight()、TellWidth()などを使用しようとしています。ただし、BMPを作成してその関数を呼び出そうとすると、コンパイル時に次のようなエラーが発生します。
未定義の記号:
BMP :: BMP()、参照元:
Image :: invertcolors()
これはメソッドinvertcolors()です:
void Image::invertcolors()
{
BMP img_invert;
img_invert.ReadFromFile("inverted.bmp");
//int height =img_invert.TellHeight();
//int width = img_invert.TellWidth();
//for(int i = 0; i<height; i++)
//{
//for(int j =0; j<width; j++)
//{
//RGBApixel* current = img_invert(j,i);
//current->Blue = 255 - (current->Blue);
//current->Green = 255 - (current->Green);
//current->Red = 255 - (current->Red);
//current->Alpha = 255 - (current->Alpha);
//}
//}
}