MyFillはクラスで、MyFill2はそのクラス内の関数です。
このようなクラスのパブリック関数内で変数を宣言することの違いは何ですか(太さと線の種類)->
MyFill::MyFill (Mat img, Point center)
{
MyFill2 (img, center);
}
void MyFill::MyFill2(Mat img, Point center)
{
int thickness = -1;
int lineType = 8;
circle (
img,
center,
w/32,
Scalar( 0, 0, 255 ),
thickness,
lineType
);
}
...そして、ヘッダー ファイルのように、プライベート ラベル (private:) で宣言するだけです -->
class MyFill {
public:
MyFill(Mat img1, Point center1);
void MyFill2 (Mat img, Point center);
private:
int thickness = -1;
int lineType = 8;
};
最初のものは正しく動作します。しかし、2番目のものはそうではありません。2 番目のオプションを使用したい場合、何をする必要がありますか? いくつかの説明を含む正しいコードが役立つ場合があります。