Starting on line 79:
Code: Select all
int ReadPGM::readImage(char *filename, vector<double> &pixelData) {
Magick::Image image;
image.read(filename);
Magick::Pixels view(image);
int x = view.x; //testing
MagickLib::PixelPacket *pixels = view.getConst(view.x, view.y, view.columns, view.rows);
//TODO: if there's an error, return -1
for (unsigned int row=0; row < view.rows; row++) {
for (unsigned int col=0; col < view.columns; col++ ) {
Magick::Color color(pixels[row * view.rows + col]);
pixelData[row * view.rows + col] = Magick::Color::scaleQuantumToDouble(color.blueQuantum());
cout << pixels[row][col];
}
cout << endl;
}
return 1;
}
Code: Select all
g++ -I/sw/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"ReadPGM.d" -MT"ReadPGM.d" -o"ReadPGM.o" "../ReadPGM.cpp"
../ReadPGM.cpp: In member function 'int ReadPGM::readImage(char*, std::vector<double, std::allocator<double> >&)':
../ReadPGM.cpp:83: error: argument of type 'int (Magick::Pixels::)()const' does not match 'int'
../ReadPGM.cpp:84: error: no matching function for call to 'Magick::Pixels::getConst(<unknown type>, <unknown type>, <unknown type>, <unknown type>)'
/sw/include/Magick++/Pixels.h:37: note: candidates are: const MagickLib::PixelPacket* Magick::Pixels::getConst(int, int, unsigned int, unsigned int)
../ReadPGM.cpp:88: error: invalid use of member (did you forget the '&' ?)
../ReadPGM.cpp:89: error: invalid use of member (did you forget the '&' ?)
../ReadPGM.cpp:90: error: invalid use of member (did you forget the '&' ?)
../ReadPGM.cpp:91: error: invalid use of member (did you forget the '&' ?)
../ReadPGM.cpp:92: error: no match for 'operator[]' in '*((+(row * 8u)) + pixels)[col]'
../ReadPGM.cpp:83: warning: unused variable 'x'