Look at the prototype provided for the function you want to call.
void setPixel(int x, int y, const Pixel& color);
Observations:
- it wants one parameter for
x
, an int
- it wants one parameter for
y
, an int
- it wants one parameter for
color
, a Pixel
,
it happens to be a reference parameter, but that is not immediatly relevant
So first of all, any call with more than three parameters cannot work.
Second, you need to give three parameters of the right type, the first two of type int, which can be r-values. Your x
and y
might be OK, if they are int, as in
int x = 5;
int y = 5;
However, this could be a bit confusing, using the same name inside and outside of the function you are going to call. So I recommend
int outsideX = 5;
int outsideY = 5;
The third parameter, being a reference parameter, requires an actual (constant) variable of type Pixel
. You need to set one up.
Pixel outsideColor;
outsideColor.r = 255;
outsideColor.g = 0;
outsideColor.b = 255;
// this will be bright magenta
Having done these preparations you can call the function as
setPixel(outsideX, outsideY, outsideColor);