Click here to Skip to main content
15,887,264 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: quote o' the next 24 hours of ai apocalypse Pin
BillWoodruff16-Sep-23 5:06
professionalBillWoodruff16-Sep-23 5:06 
GeneralRe: quote o' the next 24 hours of ai apocalypse Pin
Marc Clifton16-Sep-23 7:44
mvaMarc Clifton16-Sep-23 7:44 
GeneralRe: quote o' the next 24 hours of ai apocalypse Pin
BillWoodruff16-Sep-23 14:54
professionalBillWoodruff16-Sep-23 14:54 
GeneralRe: quote o' the next 24 hours of ai apocalypse Pin
David O'Neil16-Sep-23 11:16
professionalDavid O'Neil16-Sep-23 11:16 
GeneralRe: quote o' the next 24 hours of ai apocalypse Pin
Ron Anders16-Sep-23 12:07
Ron Anders16-Sep-23 12:07 
GeneralRe: quote o' the next 24 hours of ai apocalypse Pin
BillWoodruff16-Sep-23 15:04
professionalBillWoodruff16-Sep-23 15:04 
GeneralRe: quote o' the next 24 hours of ai apocalypse Pin
jmaida16-Sep-23 15:08
jmaida16-Sep-23 15:08 
GeneralWicked code! Pin
honey the codewitch15-Sep-23 19:01
mvahoney the codewitch15-Sep-23 19:01 
This my friends, is really neat.

With my GFX library:
C++
template<size_t BitDepth>
using bgrx_pixel = gfx::pixel<
	gfx::channel_traits<gfx::channel_name::B,(BitDepth/4)>,
    gfx::channel_traits<gfx::channel_name::G,((BitDepth/4)+(BitDepth%4))>,
    gfx::channel_traits<gfx::channel_name::R,(BitDepth/4)>,
	gfx::channel_traits<gfx::channel_name::nop,(BitDepth/4),0,(1<<(BitDepth/4))-1,(1<<(BitDepth/4))-1>    
>;


You can then do auto col = color<bgrx_pixel<32>>::purple and get a pixel back in the format of 0xBBGGRRFF (where RR GG and BB are each a byte and represent the red, green, and blue color channels, and FF is just a NOP channel - unused - and set to 0xFF). Purple would be like 0xFF00FFFF.

With this you can create bitmaps (bitmap<bgrx_pixel<32>>)in this format and feed them right to DirectX, which happily eats bitmaps with this pixel footprint.

The template code to make this work is pretty crazy. The fact that it's pretty easy to declare new pixel formats made it possible for me to port my code from IoT to DirectX on a PC so I can rapidly prototype without having to upload to a device each time.

I've never really used this feature in the wild. My color format is usually either 16-bit color, monochrome or grayscale.

It was confusing at first though because originally my nop channel was an alpha channel, and so it wasn't rendering (black screen) because DirectX is set to ignore that channel, and my GFX library assumed it would be respected.

Anyway, after I overcame that the rest was easy. Same code of mine works in Arduino, ESP-IDF, probably Zephyr, and now the PC.

Say what you want about C and C++ they truly run everywhere.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix

GeneralRe: Wicked code! Pin
David O'Neil15-Sep-23 20:59
professionalDavid O'Neil15-Sep-23 20:59 
GeneralRe: Wicked code! Pin
Richard MacCutchan16-Sep-23 0:25
mveRichard MacCutchan16-Sep-23 0:25 
GeneralRe: Wicked code! Pin
pkfox16-Sep-23 4:11
professionalpkfox16-Sep-23 4:11 
GeneralRe: Wicked code! Pin
honey the codewitch16-Sep-23 5:02
mvahoney the codewitch16-Sep-23 5:02 
GeneralRe: Wicked code! Pin
jmaida16-Sep-23 15:12
jmaida16-Sep-23 15:12 
GeneralRe: Wicked code! Pin
0x01AA16-Sep-23 4:37
mve0x01AA16-Sep-23 4:37 
GeneralRe: Wicked code! Pin
honey the codewitch16-Sep-23 5:01
mvahoney the codewitch16-Sep-23 5:01 
GeneralRe: Wicked code! Pin
honey the codewitch16-Sep-23 5:01
mvahoney the codewitch16-Sep-23 5:01 
GeneralRe: Wicked code! Pin
Nelek16-Sep-23 5:45
protectorNelek16-Sep-23 5:45 
GeneralRe: Wicked code! Pin
Richard Andrew x6416-Sep-23 6:16
professionalRichard Andrew x6416-Sep-23 6:16 
GeneralRe: Wicked code! Pin
Nelek16-Sep-23 11:45
protectorNelek16-Sep-23 11:45 
Generalneed to write a small SQL parser Pin
Southmountain15-Sep-23 18:14
Southmountain15-Sep-23 18:14 
GeneralRe: need to write a small SQL parser Pin
honey the codewitch15-Sep-23 18:53
mvahoney the codewitch15-Sep-23 18:53 
GeneralRe: need to write a small SQL parser Pin
Southmountain16-Sep-23 8:50
Southmountain16-Sep-23 8:50 
GeneralRe: need to write a small SQL parser Pin
PIEBALDconsult16-Sep-23 3:34
mvePIEBALDconsult16-Sep-23 3:34 
GeneralRe: need to write a small SQL parser Pin
Southmountain16-Sep-23 8:49
Southmountain16-Sep-23 8:49 
GeneralRe: need to write a small SQL parser Pin
PIEBALDconsult16-Sep-23 19:25
mvePIEBALDconsult16-Sep-23 19:25 

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.