openframeworks / openframeworks/openFrameworks
ofPixelsRef no longer can be used with const methods.
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.4k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 9
Description
It looks like we can't have const ofPixelsRef getPixelsRef() since we merged the const PR into OF.
I got compile errors forcing me to change my methods to
const ofPixels& getPixelsRef() const;
The issue I guess with this is that ofPixelsRef encouraged users to use the typedef ofPixelsRef type so it helped encouraged copy by reference instead of a full copy.
Curious what a good solution to this is.
I guess since there is a const and non-const version of that function we could do.
ofPixelsRef getPixelsRef();
const ofPixels& getPixelsRef() const;
ping @bakercp @arturoc
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the getPixelsRef declaration in libs/openFrameworks/video/ofVideoGrabber.h at the referenced line, and compare the const and non-const forms introduced by the const change. Check how ofPixelsRef is used in nearby video APIs; done means establishing a consistent const-compatible return type without breaking the reference-oriented usage described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100