Click here to Skip to main content
15,887,027 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.

 
GeneralRe: At last, Christmas is finally over Pin
Slow Eddie5-Jan-23 4:33
professionalSlow Eddie5-Jan-23 4:33 
GeneralRe: At last, Christmas is finally over Pin
dandy725-Jan-23 8:56
dandy725-Jan-23 8:56 
GeneralRe: At last, Christmas is finally over Pin
OriginalGriff5-Jan-23 9:51
mveOriginalGriff5-Jan-23 9:51 
GeneralRe: At last, Christmas is finally over Pin
Mycroft Holmes5-Jan-23 11:10
professionalMycroft Holmes5-Jan-23 11:10 
GeneralRe: At last, Christmas is finally over Pin
jmaida5-Jan-23 15:13
jmaida5-Jan-23 15:13 
GeneralRe: At last, Christmas is finally over Pin
Damien Hansen6-Jan-23 3:57
Damien Hansen6-Jan-23 3:57 
GeneralRe: At last, Christmas is finally over Pin
englebart6-Jan-23 16:43
professionalenglebart6-Jan-23 16:43 
Praise"How the heck did I do that?" moments Pin
honey the codewitch5-Jan-23 1:28
mvahoney the codewitch5-Jan-23 1:28 
I was looking back on my graphics library code.

I allow you to wrap a byte array with a bitmap object with a completely user definable pixel format/binary footprint.

Therefore you can declare for example, a pixel that's 18 bits wide if you want, and it will allow you to access the pixels in the bitmap.

Astute bit twiddlers here may realize that this requires potentially complicated bit shifts to make it all work.

I compute the necessary code for the shifts at compile time, optimizing for situations where I can, like where a pixel is an even number of bytes wide, or special casing for monochrome, etc. Bitmap blting is memcpys, either entire bitmaps, or lines at a time if you're blting from a rectangle within a bitmap.

It's nuts.

I'm looking back on it going "that's wicked code"

I love those moments when I impress myself. Unfortunately I'm not completely certain I could repeat this wizardry.
To err is human. Fortune favors the monsters.

GeneralRe: "How the heck did I do that?" moments Pin
Ron Anders5-Jan-23 2:38
Ron Anders5-Jan-23 2:38 
GeneralRe: "How the heck did I do that?" moments Pin
dandy725-Jan-23 8:48
dandy725-Jan-23 8:48 
GeneralRe: "How the heck did I do that?" moments Pin
honey the codewitch5-Jan-23 9:33
mvahoney the codewitch5-Jan-23 9:33 
GeneralRe: "How the heck did I do that?" moments Pin
jmaida5-Jan-23 15:11
jmaida5-Jan-23 15:11 
GeneralRe: "How the heck did I do that?" moments Pin
honey the codewitch5-Jan-23 15:20
mvahoney the codewitch5-Jan-23 15:20 
GeneralRe: "How the heck did I do that?" moments Pin
englebart6-Jan-23 16:51
professionalenglebart6-Jan-23 16:51 
GeneralWSO CCC OTD 2023-01-05 Pin
OriginalGriff4-Jan-23 21:40
mveOriginalGriff4-Jan-23 21:40 
GeneralRe: WSO CCC OTD 2023-01-05 Pin
pkfox4-Jan-23 21:45
professionalpkfox4-Jan-23 21:45 
GeneralRe: WSO CCC OTD 2023-01-05 Pin
yacCarsten4-Jan-23 21:48
yacCarsten4-Jan-23 21:48 
GeneralRe: WSO CCC OTD 2023-01-05 Pin
OriginalGriff4-Jan-23 22:00
mveOriginalGriff4-Jan-23 22:00 
GeneralRe: WSO CCC OTD 2023-01-05 Pin
OriginalGriff4-Jan-23 21:59
mveOriginalGriff4-Jan-23 21:59 
GeneralRe: WSO CCC OTD 2023-01-05 Pin
pkfox4-Jan-23 22:10
professionalpkfox4-Jan-23 22:10 
GeneralRe: WSO CCC OTD 2023-01-05 Pin
OriginalGriff4-Jan-23 23:25
mveOriginalGriff4-Jan-23 23:25 
GeneralRe: WSO CCC OTD 2023-01-05 Pin
pkfox4-Jan-23 22:22
professionalpkfox4-Jan-23 22:22 
GeneralRe: WSO CCC OTD 2023-01-05 Pin
OriginalGriff4-Jan-23 23:25
mveOriginalGriff4-Jan-23 23:25 
GeneralRe: WSO CCC OTD 2023-01-05 Pin
DerekT-P5-Jan-23 0:22
professionalDerekT-P5-Jan-23 0:22 
GeneralRe: WSO CCC OTD 2023-01-05 Pin
Craig Robbins5-Jan-23 0:37
Craig Robbins5-Jan-23 0:37 

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.