Skip to content
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

ofPixels proposal #7929

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

ofPixels proposal #7929

wants to merge 18 commits into from

Conversation

dimitre
Copy link
Member

@dimitre dimitre commented May 5, 2024

simplification of pixelbits / bytes, channel count, etc.

@dimitre dimitre marked this pull request as draft May 5, 2024 21:16
@dimitre
Copy link
Member Author

dimitre commented May 11, 2024

it will be closed in favor of

Copy link
Member

@danoli3 danoli3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great

scripts/ci/linuxrpi/install.sh Outdated Show resolved Hide resolved
@@ -1368,7 +1371,7 @@ inline typename ofPixels_<PixelType>::ConstPixel ofPixels_<PixelType>::ConstPixe

//----------------------------------------------------------------------
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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the _

Copy link
Member Author

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 },
Copy link
Member

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" },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so much cleaner!

@@ -1344,30 +1332,41 @@ bool ofPixels_<PixelType>::resizeTo(ofPixels_<PixelType>& dst, ofInterpolationMe
size_t dstHeight = dst.getHeight();
size_t bytesPerPixel = getBytesPerPixel();


PixelType * dstPixels = dst.getData();
auto dstPixels = dst.getData();
Copy link
Member

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

@dimitre dimitre marked this pull request as ready for review July 28, 2024 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants