Image.clone() update? // 'clone' is a protected member of 'ofImage_<unsigned char>'


#1

Hello,

I’m a newbie on oF so forgive me if this sounds obvious!

I’m running examples from Mastering openFrameworks: Creative Coding Demystified // Page 102 - A simple geometrical distortion example (https://github.com/firmread/ofDemystified/blob/master/04-Images-06-HorizontalDistortion/src/ofApp.cpp).

When I want to clone my initial image I get this message

image.load( "303828.fig.001" ); 
image.clone(image2); 

’clone’ is a protected member of 'ofImage_'

Could someone explain me what has changed as .clone() seems to be obsolete?

Cheers,
Juliette


#2

I think that it is done to avoid an image clone itself. like

image.clone(image); 

You can just use the = operator.
so it would be just

image = image2; 

cheers


#3

It worked,

Thank you!!