Monday, 26 August 2013

How to get/set values in a private struct in c++?

How to get/set values in a private struct in c++?

I'm having a little problem setting values in my private struct of my
Class. It is like the following:
//ProcessImage.h
class Process_Image
{
private:
struct ImageData
{
Mat imageMatrix;
int V_Min;
int V_Max;
Imagedata(Mat img, int Vmin=0, int Vmax=255):
imageMatrix(img), V_Min(Vmin), V_Max(Vmax) {}
};
public:
bool set_V_Min(int Value);
};
//ProcessImage.cpp
bool Process_Image::set_V_Min(int Value)
{
if(value>0&&value<256)
{
ImageData.V_Min=value; //it is not working setting it like this
return true;
}
return false;
}
Where am I wrong? I think it should be possible to set the value in my
struct that way but I don't know what I'm missing. Please give me a hint
or a direction how to do it the right Way.

No comments:

Post a Comment