Click here to Skip to main content
15,895,746 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
QuestionLeveling up Pin
honey the codewitch30-May-21 6:29
mvahoney the codewitch30-May-21 6:29 
AnswerRe: Leveling up Pin
Greg Utas30-May-21 7:04
professionalGreg Utas30-May-21 7:04 
GeneralRe: Leveling up Pin
honey the codewitch30-May-21 7:14
mvahoney the codewitch30-May-21 7:14 
GeneralRe: Leveling up Pin
Greg Utas30-May-21 7:25
professionalGreg Utas30-May-21 7:25 
GeneralRe: Leveling up Pin
Joe Woodbury30-May-21 10:15
professionalJoe Woodbury30-May-21 10:15 
GeneralRe: Leveling up Pin
honey the codewitch30-May-21 11:47
mvahoney the codewitch30-May-21 11:47 
AnswerRe: Leveling up Pin
Mircea Neacsu30-May-21 13:56
Mircea Neacsu30-May-21 13:56 
GeneralRe: Leveling up Pin
honey the codewitch30-May-21 14:23
mvahoney the codewitch30-May-21 14:23 
Prior to C++20 many of the metaprogramming techniques in C++ are effectively “hackish” because while C++ does support this kind of thing, it wasn’t originally designed for it.

I've hidden those complicated constructs I needed behind usable facades, but the code to make them work is necessarily ... difficult.

In my pixel class it would have been impossible performance wise to create a pixel in an arbitrary binary format with an arbitrary set of named channels without doing metaprogramming.

In C++17 and particularly 14 which I target, some of the code is necessarily complicated. Like you, I don’t like it. But, it is C++ and it is metaprogramming, and so this is par for the course. You either cope with it and the mess it brings, or avoid it altogether.

Furthermore, of course you aren't going to understand it without knowing anything about it.

If I were to explain the concept of pixels and channels you would get it. (I didn't invent the concept of channels either - they're just what individual values of a particular color model are called) - the alpha channel in graphics parlance is the channel that specifies the transparency of a pixel.

If you have an rgba8888 pixel that's 4 channels, 8 bits each, specifying red green blue and alpha. This is the standard pixel format in .NET.

But the pixel format for an ILI9341 display device is rgb565 with no alpha channel.

JPGs use YbCbCr pixels, so it's not even an RGB color model.

My library supports all of these and whatever else you define because it is cross platform, which was one of the goals - to be device agnostic.

I didn't expect you to understand exactly what that code was doing.

Now, if you didn't understand that code after reading this: GFX Forever: The Complete Guide to GFX for IoT[^] then one of us - probably me - has a communication issue
Real programmers use butterflies


modified 30-May-21 22:32pm.

AnswerRe: Leveling up Pin
Jon McKee30-May-21 14:39
professionalJon McKee30-May-21 14:39 
GeneralRe: Leveling up Pin
honey the codewitch30-May-21 14:44
mvahoney the codewitch30-May-21 14:44 
AnswerRe: Leveling up Pin
Kenneth Haugland30-May-21 21:49
mvaKenneth Haugland30-May-21 21:49 
GeneralRe: Leveling up Pin
honey the codewitch31-May-21 3:06
mvahoney the codewitch31-May-21 3:06 
GeneralRe: Leveling up Pin
Kenneth Haugland31-May-21 3:22
mvaKenneth Haugland31-May-21 3:22 
GeneralRe: Leveling up Pin
honey the codewitch31-May-21 4:23
mvahoney the codewitch31-May-21 4:23 
AnswerRe: Leveling up Pin
Sander Rossel31-May-21 1:11
professionalSander Rossel31-May-21 1:11 
GeneralRe: Leveling up Pin
honey the codewitch31-May-21 3:09
mvahoney the codewitch31-May-21 3:09 
GeneralRe: Leveling up Pin
Sander Rossel31-May-21 3:40
professionalSander Rossel31-May-21 3:40 
GeneralRe: Leveling up Pin
honey the codewitch31-May-21 4:20
mvahoney the codewitch31-May-21 4:20 
GeneralR.I.P. B.J. Thomas Pin
Cp-Coder30-May-21 2:29
Cp-Coder30-May-21 2:29 
GeneralRe: R.I.P. B.J. Thomas Pin
Richard Andrew x6430-May-21 3:05
professionalRichard Andrew x6430-May-21 3:05 
GeneralRe: R.I.P. B.J. Thomas Pin
Cp-Coder30-May-21 3:45
Cp-Coder30-May-21 3:45 
GeneralWanna use Edge? You might ... Pin
OriginalGriff30-May-21 2:11
mveOriginalGriff30-May-21 2:11 
GeneralRe: Wanna use Edge? You might ... Pin
Daniel Pfeffer30-May-21 2:15
professionalDaniel Pfeffer30-May-21 2:15 
GeneralRe: Wanna use Edge? You might ... Pin
OriginalGriff30-May-21 2:35
mveOriginalGriff30-May-21 2:35 
GeneralRe: Wanna use Edge? You might ... Pin
Richard Andrew x6430-May-21 4:47
professionalRichard Andrew x6430-May-21 4:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.