|
gfx 2.0 vector canvas performance test - YouTube[^]
22 frames per second on an ESP32 WROVER based M5 Stack Core2 @ 320x240 (clock is 128x128)
mem usage: 34.66KB
code (forgive the lengthy paste, but I wanted to give a good idea of how much it was doing per frame, and what that looks like)
tbmp.fill(tbmp.bounds(),color_t::white);
pointf offset(0, 0);
pointf center(0, 0);
time_t time = current_time;
float rotation(0);
float ctheta, stheta;
ssize16 size = (ssize16)clock_canvas.dimensions();
rectf b = gfx::sizef(size.width, size.height).bounds();
b.inflate_inplace(-face_border_width - 1, -face_border_width - 1);
float w = b.width();
float h = b.height();
if(w>h) w= h;
rectf sr(0, w / 30, w / 30, w / 5);
sr.center_horizontal_inplace(b);
center = gfx::pointf(w * 0.5f + face_border_width + 1, w * 0.5f + face_border_width + 1);
clock_canvas.fill_color(face_color);
clock_canvas.stroke_color(face_border_color);
clock_canvas.stroke_width(face_border_width);
clock_canvas.ellipse(center, {center.x - 1, center.x - 1});
clock_canvas.render();
bool toggle = false;
clock_canvas.stroke_color(tick_border_color);
clock_canvas.fill_color(tick_color);
clock_canvas.stroke_width(tick_border_width);
for (float rot = 0; rot < 360.0f; rot += rot_step) {
rotation = rot;
update_transform(rotation, ctheta, stheta);
toggle = !toggle;
if (toggle) {
clock_canvas.move_to(translate(ctheta, stheta, center, offset, sr.x1, sr.y1));
clock_canvas.line_to(translate(ctheta, stheta, center, offset, sr.x2, sr.y1));
clock_canvas.line_to(translate(ctheta, stheta, center, offset, sr.x2, sr.y2));
clock_canvas.line_to(translate(ctheta, stheta, center, offset, sr.x1, sr.y2));
} else {
clock_canvas.move_to(translate(ctheta, stheta, center, offset, sr.x1, sr.y1));
clock_canvas.line_to(translate(ctheta, stheta, center, offset, sr.x2, sr.y1));
clock_canvas.line_to(translate(ctheta, stheta, center, offset, sr.x2, sr.y2 - sr.height() * 0.5f));
clock_canvas.line_to(translate(ctheta, stheta, center, offset, sr.x1, sr.y2 - sr.height() * 0.5f));
}
clock_canvas.render();
}
sr = gfx::rectf(0, w / 40, w / 16, w / 2);
sr.center_horizontal_inplace(b);
rotation = (fmodf(time / 60.0f, 60) / 60.0f) * 360.0f;
update_transform(rotation, ctheta, stheta);
clock_canvas.move_to(translate(ctheta, stheta, center, offset, sr.x1 + sr.width() * 0.5f, sr.y1));
clock_canvas.line_to(translate(ctheta, stheta, center, offset, sr.x2, sr.y2));
clock_canvas.line_to(translate(ctheta, stheta, center, offset, sr.x1 + sr.width() * 0.5f, sr.y2 + (w / 20)));
clock_canvas.line_to(translate(ctheta, stheta, center, offset, sr.x1, sr.y2));
clock_canvas.fill_color(minute_color);
clock_canvas.stroke_color(minute_border_color);
clock_canvas.stroke_width(minute_border_width);
clock_canvas.render();
sr.y1 += w / 8;
rotation = (fmodf(time / (3600.0f), 12.0f) / (12.0f)) * 360.0f;
update_transform(rotation, ctheta, stheta);
clock_canvas.move_to(translate(ctheta, stheta, center, offset, sr.x1 + sr.width() * 0.5f, sr.y1));
clock_canvas.line_to(translate(ctheta, stheta, center, offset, sr.x2, sr.y2));
clock_canvas.line_to(translate(ctheta, stheta, center, offset, sr.x1 + sr.width() * 0.5f, sr.y2 + (w / 20)));
clock_canvas.line_to(translate(ctheta, stheta, center, offset, sr.x1, sr.y2));
clock_canvas.fill_color(hour_color);
clock_canvas.stroke_color(hour_border_color);
clock_canvas.stroke_width(hour_border_width);
clock_canvas.render();
sr.y1 -= w / 8;
rotation = ((time % 60) / 60.0f) * 360.0f;
update_transform(rotation, ctheta, stheta);
clock_canvas.move_to(translate(ctheta, stheta, center, offset, sr.x1 + sr.width() * 0.5f, sr.y1));
clock_canvas.line_to(translate(ctheta, stheta, center, offset, sr.x2, sr.y2));
clock_canvas.line_to(translate(ctheta, stheta, center, offset, sr.x1 + sr.width() * 0.5f, sr.y2 + (w / 20)));
clock_canvas.line_to(translate(ctheta, stheta, center, offset, sr.x1, sr.y2));
clock_canvas.fill_color(second_color);
clock_canvas.stroke_color(second_border_color);
clock_canvas.stroke_width(second_border_width);
clock_canvas.render();
draw::bitmap(tbmp2,tbmp2.bounds(),tbmp,tbmp.bounds());
lcd_begin_draw();
lcd_flush_bitmap(trect.x1,trect.y1,trect.x2,trect.y2,tbmp2.begin());
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
TikTok - Temu Croissant Lanp[^] - contains spoken swear words.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
Well spotted Richard - at least we know he's still about albeit not here
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP
|
|
|
|
|
|
Wordle 1,212 2/6*
⬜🟩🟩⬜🟩
🟩🟩🟩🟩🟩
Lucky two days in a row!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Wordle 1,212 4/6
🟨⬜⬜🟨⬜
⬜⬜⬜🟨🟨
🟩🟨🟨⬜⬜
🟩🟩🟩🟩🟩
|
|
|
|
|
Wordle 1,212 4/6
⬜🟩⬜🟩🟩
⬜🟩⬜🟩🟩
⬜🟩🟩🟩🟩
🟩🟩🟩🟩🟩
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP
|
|
|
|
|
As for my favorite cologne, I can't limit my answer to just one.
I just bought a bottle of ARMANI Code, but I also like:
Polo Sport,
Calvin Klein CK One,
Versace Eros,
Nautica Blue,
Ralph Lauren Polo,
Hugo Boss,
Calvin Klein Eternity
Gravity,
Stetson Preferred Stock,
Burnt Hair by Boring Company, (I don't know how it smells, but I bet it's good)
Drakkar Noir By Guy Laroche,
...and so many others
What is your favorite cologne or perfume?
|
|
|
|
|
"Medium Rare Steak" for weekends, "Bacon" for weekdays.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Never really had the need for any. Although I did use Old Spice some 40+ years ago.
|
|
|
|
|
Never used any
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP
|
|
|
|
|
Don't have one, and I'm a heathen. I've been known to mix them.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Nitromethane.
You can't buy happiness, but you can but nitro, and that's pretty close.
|
|
|
|
|
|
FREE Copy Essential Software Development Career + Technical Guide eBook for review Did you just say FREE!?
DavesApps wrote: The first people to go to the link and claim it, gets it. Oh, boy! I'm on it!
|
|
|
|
|
I posted this in a different thread, but I'm posting it here to emphasize the importance of what I believe we all need to know.
Each and every one of you is part of a vibrant community. I believe it's vital for you to know that as a united community, you have the power to determine and control what happens. Remember that. I assure you, it's the truth.
Post is as follows:
I used to be part of a website just like CodeProject.com for 15+ years. Instead of coding enthusiasts, the website was made up of a community of aviation fanatics. I had so many friends in that community, and I still have many of those friends to this day.
What I'm seeing here is a carbon copy of what I experienced many years ago. I was an active member of a vibrant online aviation community. The site was massive. We had millions of active members. There were less than a half-dozen people who operated the site. It was far more work than they could handle, and they decided to accept an offer from a media company who wanted to buy the website. It transformed those half-dozen overworked owners, and operators into instant millionaires. I'm very happy for them -- all that work they put in over so many years paid off as it should have. That's about the only good thing that happened as a result of selling the website.
When the transfer of ownership became official, it decimated the community. Tens of thousands of members just abandoned the site. What was left was a cauldron of anger and backlash. The new owners of the website didn't understand how the aviation community worked. They had no idea how to foster the community. Out of panic and frustration, the new owners came down hard on the community. They were hemorrhaging money, and were desperate to keep the site afloat. Their heavy-handed policies were inconsistently enforced. People who were in charge of moderating the forums were corporate drones who demonstrated no people skills. They had no interest in aviation. They clearly enjoyed abusing their power over members. They were outright rejected by the entire aviation community, and rightly so. It became a clusterf*** of dysfunction; a complete nightmare for everyone.
Several members attempted to gather together and launch their own aviation website. They managed to gather enough funding to make a go of it. Sadly, they just didn't have the knowledge, experience, and skillset required to succeed. Their hearts were in the right place, but that was all. Their endeavor crashed and burned before it even started. The start-up funds were mishandled. This caused members of the group to become hostile toward one another. Decades-long friendships were destroyed, and the divisiveness quickly eroded the tightly held-bond that they once shared. It was ugly. It was really ugly! I watched it all happen.
Several years went by. Nothing improved. One day, we all got the news that the CEO of the company was killed in a plane crash. He had taken off from an airport in Santa Monica, California. Early in his ascent, the engine cut out. He didn't have the altitude, nor did he have the time to attempt restarting the engine, nor did he have the option to return to the airport. He crashed into an airplane hangar killing him instantly. I will never forget how the website's crippled aviation community reacted to the news. A huge wave of exuberance, celebration, and sense of retributive justice erupted within the website's aviation community. It was shocking, but certainly not surprising.
Having been a part of that website's aviation community, I experienced it all myself. I learned from history. I make a point of remembering history. If you forget history, then you are bound to repeat it.
The red flags are everywhere. It seems to be happening all over again. No one here deserves to undergo such anguish and suffering. I'm watching this carefully. I only slept for 3 hours last night. I laid in bed staring at the ceiling while deep in thought. It's been on my mind all day today. I'm not going to let such a thing happen again.
I can't say what the future holds. What I can say is that the future is in the control of every member of this community. It's absolutely vital that this community unites behind the cause to preserve itself in the face of adversity and existential crisis. In unity, it's every one of us who has the power to decide what happens.
|
|
|
|
|
Steve Raw wrote: A huge wave of exuberance, celebration, and sense of retributive justice erupted within the website's aviation community. That right there sums up everything that's wrong with the Internet.
Their online hangout going to crap is apparently more valuable then someone's life. Have zero respect for these types.
Jeremy Falcon
|
|
|
|
|
Just food for thought, let's not glorify in any way shape or form those hateful, overgrown children that would celebrate someone's death over stupid crap. Seriously. Using an example of disgusting behavior is not a great way to invigorate anyone but the disgusting.
These days you can just start a subreddit for crying out loud.
Jeremy Falcon
|
|
|
|
|
Jeremy Falcon wrote: let's not glorify in any way shape or form those hateful, overgrown children that would celebrate someone's death over stupid crap. Understand that by no means was this community just a stupid hangout for those who were a part of it. This community was so important to so many people that they'd regularly travel from all over the world on a regular basis for group meet-ups. On several occasions, I met up with other members who came to town and we had a great time talking with each other over a beer. I have so many great memories to be thankful for. That's not stupid crap to me.
To be absolutely clear, I never implied that people's behavior was something to glorify. Their behavior isn't something I endorse, however, I do understand the level of anger and hatred they felt. Their feelings were entirely justified IMO. After the years of heinous abuse that this man willfully and repeatedly imposed on other people, he brought this upon himself.
|
|
|
|
|
Steve Raw wrote: Their behavior isn't something I endorse, however, I do understand the level of anger and hatred they felt. Yeah no... defending that stupid nonsense is what children do. And let's be clear, I understand childish hatred. I've also grown the hell up when apparently most people online haven't.
And as always, people gonna argue on CP when confronted with adult topics. It's ridiculous and childish to get so angry you're excited about someone's death over a stupid website. There are 5 million ways to keep in touch with those close to you. I already mentioned one.
So, like if FB shutdown... you'd be "defending" someone laughing at someone dying over it? If you don't then it's hypocrisy. Either way you're talking about a website like its your wife. Clearly these people weren't that close if you lost contact with them forever.
You say you don't endorse it, but you're defending it. Gross.
Jeremy Falcon
|
|
|
|
|
Jeremy Falcon wrote: Yeah no... defending that stupid nonsense is what children do. And let's be clear, I understand childish hatred. I've also grown the hell up when apparently most people online haven't.
And as always, people gonna argue on CP when confronted with adult topics. It's ridiculous and childish to get so angry you're excited about someone's death over a stupid website. There are 5 million ways to keep in touch with those close to you. I already mentioned one.
So, like if FB shutdown... you'd be "defending" someone laughing at someone dying over it? If you don't then it's hypocrisy. Either way you're talking about this like its your wife. Clearly these people weren't that close if you lost contact with them forever.
You say you don't endorse it, but you're defending it. Gross. Say what you will. My stance remains unchanged.
|
|
|
|
|
Steve Raw wrote: Say what you will. My stance remains unchanged. Your stance is garbage, over emotional, and immature.
Jeremy Falcon
|
|
|
|
|
Keep it without personal attacks please, Jeremy
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.
|
|
|
|
|
I appreciate the fact that you're taking the time and effort to provide me with your constructive criticism. Now that you have provided me with your insights, I realize that my cognition is in fact garbage. I now realize that you are the authority of absolute truth. You have earned the entitlement to unconditionally dictate to me what I am required to believe, how I must reason, and what opinions I must hold. If I fail to meet your high standards, then I am not worth the time and effort you have taken to instill me with your superior moral authority. If you deem me to be overly emotional, I haven't the right to disagree. I apologize for my lack of maturity. Your ability to judge what kind of person I am is astonishing.
What do you believe you have accomplished by spewing your vitriol all over the place in a public forum? Because you cannot manage your pent-up frustrations, does this give you the right to insult and condemn others? Are you demonstrating what it is to be mature? No. Does your emotionally charged rant set a good example of how to manage your emotions properly? No. Is cowering behind your keyboard while throwing a petulant fit demonstrate the ability to understand viewpoints that don't align with your own? No.
So, what have you achieved here? If your intention was to decimate any respect I ever had for you, then congratulations. You have succeeded. I find it disappointing. Up until now, I actually believed you had some good character.
|
|
|
|
|