|
I'm working with pixel buffers and "writeable bitmaps" which totally abstract me from the hardware. My productivity is what keeps me going when things get to be a slog ... while new ideas / enhancements are purcolating. And I remind myself it's (partly) the journey.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
That was the first thing I did in htcw_gfx (GFX)
I wrote a pixel template that allows you to define its binary footprint and color model using a series of "channel_trait" template instantiations that define the channel properties. Many pixels have R G and B channels, but it's not limited to that. Defining each channel individually to make up a pixel allows me to support virtually any binary footprint and color model. I made a brief pixel declaration in my Winduino example for my GFX lib to write out in DirectX native 32bit BGRx format.
From there I wrote a bitmap template class, which is basically a variable that holds pixel data. It can be written to as it itself is a draw target (both draw destination and draw source) or read from and applied to other draw targets. It's templated by the type of pixel (as above, for example RGB565) and the type of palette (if any)
It's so abstract I can support other formats and screen styles by changing barely anything. All my draw routines take pixels in any format and do behind the scenes conversion transparently (w/ alpha blending as available and called for)
I've written whole applications, only to have the screen hardware changed on me last minute. Takes me minutes to update, if I already wrote it to be resolution agnostic (which I typically do)
Here's a series of pixel declaration templates for color models of various types (including grayscale and indexed/palleted pixels) non-exaustive, just so you can see what it looks like:
template<size_t BitDepth>
using rgb_pixel = pixel<
channel_traits<channel_name::R,(BitDepth/3)>,
channel_traits<channel_name::G,((BitDepth/3)+(BitDepth%3))>,
channel_traits<channel_name::B,(BitDepth/3)>
>;
template<size_t BitDepth>
using rgba_pixel = pixel<
channel_traits<channel_name::R,(BitDepth/4)>,
channel_traits<channel_name::G,((BitDepth/4)+(BitDepth%4))>,
channel_traits<channel_name::B,(BitDepth/4)>,
channel_traits<channel_name::A,(BitDepth/4),0,(1<<(BitDepth/4))-1,(1<<(BitDepth/4))-1>
>;
template<size_t BitDepth>
using gsc_pixel = pixel<
channel_traits<channel_name::L,BitDepth>
>;
template<size_t BitDepth>
using yuv_pixel = pixel<
channel_traits<channel_name::Y,((BitDepth/3)+(BitDepth%3))>,
channel_traits<channel_name::U,(BitDepth/3)>,
channel_traits<channel_name::V,(BitDepth/3)>
>;
template<size_t BitDepth>
using yuva_pixel = pixel<
channel_traits<channel_name::Y,((BitDepth/4)+(BitDepth%4))>,
channel_traits<channel_name::U,(BitDepth/4)>,
channel_traits<channel_name::V,(BitDepth/4)>,
channel_traits<channel_name::A,(BitDepth/4),0,(1<<(BitDepth/4))-1,(1<<(BitDepth/4))-1>
>;
template<size_t BitDepth>
using ycbcr_pixel = pixel<
channel_traits<channel_name::Y,((BitDepth/3)+(BitDepth%3))>,
channel_traits<channel_name::Cb,(BitDepth/3)>,
channel_traits<channel_name::Cr,(BitDepth/3)>
>;
template<size_t BitDepth>
using ycbcra_pixel = pixel<
channel_traits<channel_name::Y,((BitDepth/4)+(BitDepth%4))>,
channel_traits<channel_name::Cb,(BitDepth/4)>,
channel_traits<channel_name::Cr,(BitDepth/4)>,
channel_traits<channel_name::A,(BitDepth/4),0,(1<<(BitDepth/4))-1,(1<<(BitDepth/4))-1>
>;
template<size_t BitDepth>
using indexed_pixel=pixel<channel_traits<channel_name::index,BitDepth>>;
You then use them like
gfx::rgb_pixel<16> px = gfx::color<gfx::rgb_pixel<16>>::purple;
px.channel<gfx::channel_name::G>(31);
float r = px.channelr<gfx::channel_name::R>();
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
modified 2-Oct-23 15:11pm.
|
|
|
|
|
Quote: Arguing with an Electrical Engineer is liking wrestling with a pig in mud, after a while you realize the pig is enjoying it!
From Jack Ganssle's newsletter
I don't think before I open my mouth, I like to be as surprised a everyone else.
PartsBin an Electronics Part Organizer - Release Version 1.1.0 JaxCoder.com
Latest Article: SimpleWizardUpdate
|
|
|
|
|
There's more than a grain of truth to that.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
EE's are resistant.
"A little time, a little trouble, your better day"
Badfinger
|
|
|
|
|
Sometimes, other times we conduct ourselves in a respectful manner.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
Ohm Mane Padme Ohm...
Software Zen: delete this;
|
|
|
|
|
I don't argue with electrical engineers - at least about their field.
I'd as soon argue with a theoretical physicist.
Totally out of my element - foolish of me to think I should.
I just work with 'em. There is one I work with that's kinda difficult, but I think it's mostly because he's looking to retirement and his priorities have shifted away from work.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
In my early career I worked with many EEs and they can be difficult, but I got along with them fairly well.
I don't think before I open my mouth, I like to be as surprised a everyone else.
PartsBin an Electronics Part Organizer - Release Version 1.1.0 JaxCoder.com
Latest Article: SimpleWizardUpdate
|
|
|
|
|
we are not difficult... we are just passionate about our opinion and what we think is true
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Most of the ones I worked with were of the opinion that they were right until proven wrong.
I don't think before I open my mouth, I like to be as surprised a everyone else.
PartsBin an Electronics Part Organizer - Release Version 1.1.0 JaxCoder.com
Latest Article: SimpleWizardUpdate
|
|
|
|
|
Mike Hankey wrote: Most of the ones I worked with were of the opinion that they were right until proven wrong. So do I. The biggest difference between me and others is, that once proven wrong I have no problem at all to say "Sorry, I was wrong" and accept the new truth.
I just have big problems with "because I say so", "it is like that" and other not so useful arguments
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Nelek wrote: I just have big problems with "because I say so", "it is like that" and other not so useful arguments
I went to a catholic school. I remember there was a lot of that.
|
|
|
|
|
Lots of laws are that way, too. It is forbidden because you shouldn't do it. It hurts nobody or nothing, but you just ain't supposed to!
|
|
|
|
|
trønderen wrote: Lots of laws are that way, too.
I forget the details, but I'm somehow reminded of some debate sparked by some art exhibit that perhaps (it was being argued) "went too far".
A judge was asked how he told mere nudity apart from porn, and his best answer went along the lines of "I know it when I see it". Which sent a pretty bad message IMO considering it came from someone whose job it is to interpret the law. Laws shouldn't be vague.
|
|
|
|
|
The most recent case of funny lawsuits (well, the case hasn't reached the courts yet - The last I heard was that the criminal wasn't yet caught) is whether indecent exposure to a car is against the law. Noone saw it happen, late at night when a young man entered the parking house, empty except for the cars, and flashing himself to a parked Tesla. He obviously knew that a Tesla has cameras recording whatever happens around the car, even when parked and seemingly completely turned off.
The owner of the car didn't look through the videos until a couple of days later, to discover the naked young man who obviously was aware of the cameras. So the legal question is: Can you be fined or thrown in prison because a car saw you flashing yourself?
Note that Internet wasn't involved. If the image was transmitted over the Internet and the man had touched himself, the viewer (here: the car owner) would have been arrested. Provided, of course, that the viewer was a male. If the flasher was below 14 years of age, the car owner would have been arrested for raping the child. That is in Norway - I hope that it is not common in other countries.
|
|
|
|
|
Given that my father is/was one...
|
|
|
|
|
they get a charge out of it.
"A little time, a little trouble, your better day"
Badfinger
|
|
|
|
|
Is that acceptable current usage?
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
Amped also works
"A little time, a little trouble, your better day"
Badfinger
|
|
|
|
|
So yeah, um... I can think of others this tooooootaaaalllly applies to as well.
Jeremy Falcon
|
|
|
|
|
Absolutely!
I don't think before I open my mouth, I like to be as surprised a everyone else.
PartsBin an Electronics Part Organizer - Release Version 1.1.0 JaxCoder.com
Latest Article: SimpleWizardUpdate
|
|
|
|
|
I updated C'YaPass in the Windows app store.
You can see it in the app store[^]. Its 100% FREE & open source.
User Experience
Anyways, everything went well with the update so I went to update it on my Win10 computer so I could get the user experience and see how it all worked.
When I visited the app store and looked at the app, it didn't say anything about there being an update.
I was confused -- it had been more than 24 hours after my windows app store dev account said it would be available.
Reboot - Nothing
I rebooted and visited the store again. Again, nothing. It showed that I owned the app but nothing about updates. I started the app from the app store to see if it would trigger anything. It started the older installed version (1.4.7)
I didn't notice anything. Then I decided to shut down the computer and check again later.
WinGet COM Server
When I attempted to shut down the computer, I was notified that some process was running and asked if I'd like to kill it.
I canceled the shutdown and looked in Task Manager and I saw this (snapshot)[^].
WinCOMServer => WindowsPackageManagerServer.exe... and that thing is eating up some process. Wow!
I decided to wait until that service completed.
Yep, after that cryptic service completed then the App Store (which I had closed previously) now had an [Install] button -- but not an [Update] button like it should. Oy!
I ran the install and the latest version 1.4.8 was installed as expected.
So, that is the user experience...
modified 2-Oct-23 9:24am.
|
|
|
|
|
Coincidence...
I yesterday was at a friends place teaching he and a friend of him automation. He told me about the DOS "winget" prompt.
I commented it a couple of threads above this. You might like it too.
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Just concluded a fifteen day tour of seven countries in Western Europe. Had visited the US more than 10 years ago.
Noticed a similarity in the graffiti font on the walls, in Europe and US. The same styling of letters, the same leftward slant. In more than half of the cases.
Is there someone who teaches the graffiti writers about this so-called graffiti font? Cannot be just a coincidence, isn't it?
|
|
|
|
|