Difference between getPixels() and getPixelsRef()

Hi everybody,
can anyone explain the differences between these two lines of code?



Img.setFromPixels(grabber.getPixels(), 320, 240);

Img is an instance of class ofxCvColorImage

Thanks to whoever will respond!

Hey there @claire

From the documentation
ofVideoGrabber Docs

It seems that it getPixelsRef() must be deprecated or no longer in use - since it is not in the documents. (I am sure one of the ofx devs can clarify this :stuck_out_tongue:).

As for getPixels() - that returns a pointer to the pixels - since pixels are in a huge data structure and we do not want to copy the whole thing.

We can for example store the pixels (via pointer) in ofPixels.

ofPixels pixels = grabber.getPixels();

I am quite new to c++ so I hope that helped :slight_smile:,