How to flip an image using mirror()

Hi there,
I’m looking to flip an image using mirror(). I don’t understand how mirror works so I’m having difficulty figuring it out.
It’s for a college assignment, this is what the lecturer asked of us:

“- on the ImageClass class created a method called flipper(). This method will use
the mirror() method of ofImage to flip vertically the loaded image. The flipper()
will be called in ofApp.cpp when the key ‘a’ is pressed.”

I’m a beginner with this stuff so I’m completely lost. Any help is greatly appreciated.

1 Like
bool vertical = true;
bool horizontal = false;

try this and play with the true and false options. you should be able to see that the image flips and mirrors in different ways.

Thanks for the reply,
I used
void ImageClass::flipper(){
image.mirror(1, 0);
in the .cpp of the image.
I didn’t know that (bool vertical, bool horizontal) could be written as (1, 0), 1 being true, 0 being false.