-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
ofPixels proposal #7929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
ofPixels proposal #7929
Conversation
|
it will be closed in favor of |
danoli3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great
| //---------------------------------------------------------------------- | ||
| template<typename PixelType> | ||
| inline ofPixels_<PixelType>::ConstLine::ConstLine(const PixelType * _begin, size_t stride, size_t componentsPerPixel, size_t lineNum, ofPixelFormat pixelFormat) | ||
| inline ofPixels_<PixelType>::ConstLine::ConstLine(const PixelType * _begin, size_t stride, size_t componentsPerPixel, size_t lineNum, ofPixelFormat _pixelFormat) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the _
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to differentiate the function parameter to the private member called pixelFormat;
| return 1 * sizeof(PixelType) * 8; | ||
| static size_t numChannelsFromPixelFormat(ofPixelFormat _pixelFormat) { | ||
| std::unordered_map<ofPixelFormat, size_t> pixelFormatChannels { | ||
| { OF_PIXELS_RGB, 3 }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome
| return | ||
| std::unordered_map<ofPixelFormat, std::string> { | ||
| { OF_PIXELS_GRAY, "OF_PIXELS_GRAY" }, | ||
| { OF_PIXELS_GRAY_ALPHA, "OF_PIXELS_GRAY_ALPHA" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so much cleaner!
|
|
||
|
|
||
| PixelType * dstPixels = dst.getData(); | ||
| auto dstPixels = dst.getData(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be auto I guess
|
Looking at this PR now, I think there are contradictions in the way OF handles pixels So a better design is needed or better yet, no design at all: I really think this (pixel manipulation) is not something that should be done at OF core level. |
simplification of pixelbits / bytes, channel count, etc.