You are not allowed to assign values to variables within the scope of the class, you can only do this inside the function or in the global scope.
class MyFill { public: MyFill(Mat img1, Point center1); void MyFill2 (Mat img, Point center); private: int thickness; int lineType; };
Your title should be changed to the previous one. Then you set your values in any function that you like, preferably your constructor, for example:
MyFill::MyFill(Mat img1, Point center1) { thickness = -1; lineType = 8; }
Edit - To your question in the comments:
The identifiers of variable names in the functional parameters must not coincide between the declaration and the definition, only the types and their order must correspond. This makes it more understandable, but not required.
A function prototype is really only considered as:
void MyFill2(Mat, Point);
When you give it a definition, that is, when the purpose of the identifiers really matters:
void MyFill2(Mat m, Point p) {
Joseph Pla
source share