First, I'm very new to pointer functions and their terrible syntax, so play well.
I am writing a filtering method for all the pixels in my bitmap based on the function I pass. I wrote a method to dereference this method and call it in a pixel buffer, but I also need a wrapper method in my bitmap class that takes a pointer to a function and passes it. How can I do it? What is the syntax? I am a little puzzled.
Here is my code with all the mismatched bits, split and concatenated files (read all initialized variables, etc.).
struct sColour { unsigned char r, g, b, a; }; class cPixelBuffer { private: sColour* _pixels; int _width; int _height; int _buffersize; public: void FilterAll(sColour (*FilterFunc)(sColour)); }; void cPixelBuffer::FilterAll(sColour (*FilterFunc)(sColour)) {
source share