|
FWIW, that's a side-effect of how the image is processed. It isn't scanned left-to-right, top-to-bottom. It is scanned in a diagonal traversal pattern and that results in the rectangular sections that you saw. That scanning pattern results in better compression of the data than plain, old, horizontal or vertical scanning.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
Yeah, and since I was adapting the decompression algorithm from some other code, I should have put two and two together well before I did, hence my frustration.
Real programmers use butterflies
|
|
|
|
|
But not your deputy
modified 5-Apr-21 21:01pm.
|
|
|
|
|
|
If it's any consolation, a couple of years ago I spent days designing a C# system that was so elegant and beautiful it would have been a doddle to implement and update.
Only to remember that for very good reasons you can't override static functions and the whole damn thing was a pile of cr*p.
"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!
|
|
|
|
|
Quote: you can't override static functions Damn! Didn't occur to me. Must remember that!
Get me coffee and no one gets hurt!
|
|
|
|
|
Wouldn't the design work if you simply made the functions non-static so that you could override them?
|
|
|
|
|
static functions are great for async/thread-safe work, but I have not really used them for anything else.
|
|
|
|
|
No, part of the whole plan was that the static methods returned a collection of the derived class only - and if you need an instance it gets messy. And you can't cast a List<X> to List<DerivedFromX> without creating a new colection ... which gets inefficient, and that means you can't alter it (such as adding a new one).
"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!
|
|
|
|
|
I wish you'd told me that a month ago - I've wasted a couple of weeks trying to do exactly the same thing
|
|
|
|
|
Know your tools!
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
Look at it the good way : you've spared 20% of the effort !
|
|
|
|
|
|
So what's plan B: Give up on modern compression and fall all the way back to bitmaps or .pcx (run length encoding)? Flail the CPU to death repeating large chunks of the decode while throwing away all data not needed for the current scan line only to repeat?
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
I've reverted to using callbacks which report a rectangle of bitmap data at arbitrary locations throughout the logical size of the jpeg's bitmap plane.
I also solved the stream problem by seeking but there's another problem where the bitmap data isn't being written.
This is temporary. I found the problem. The problem is std::ostream is not calling std::strstreambuf.xsputn which is frustrating me to no end.
And then I saw the template bloat introduced by iostreams even as little as I was using them and I decided to write my own stream class. I'm building io::file_stream and then i'll build io::memory_stream, and then I'm good - hopefully it all works after that.
Real programmers use butterflies
|
|
|
|
|
Would eyeliner that tasted good be Chicken Tikka Mascara?
"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!
|
|
|
|
|
You'll rouge the day you thought of that shadowy comment!
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Instead of sticking to your ribs, it would stick to your lips.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
Possibly resulting in "a schmeer" without a bagel.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
That wasn’t a great line.
That wasn’t a terrible line.
It was a Maybe-line!
If you can't laugh at yourself - ask me and I will do it for you.
|
|
|
|
|
Last weekend at the PGA event in Bay Hill Bryson DeChambeau treated his fans to two unforgettable shots. On Saturday and again on Sunday he teed up on the par 5 6th hole. The hole has more than 300 yards of water between tee and green. The fairway runs around the pond and you're supposed to approach the green following the fairway's dogleg around the water.
But DeChambeau had other ideas. He aimed for a spot just to the right of the green, facing a carry well over 300 yards over water. The ball left the clubface doing just under 200 mph. It was in the air for 347 yards, before it hit the fairway and bounced and rolled 30 yards more, to end up with a 376 yard drive. I have never seen a golf ball being struck that hard and well. It was amusing to see all other players who had a view of the tee, stop to watch his swing. His shot ended up 168 yards nearer the green than that of other players.
Then DeChambeau announced that he would consider a similar strategy this coming weekend during the Player's Championship at Sawgrass. The 18th hole once again features a slight dogleg to the left around a pond. He mentioned that instead of going over the water he could go left of the water onto a patch next to the neighboring fairway, which would leave him a much shorter second shot to the green. This may be very unconventional but is perfectly within the rules.
But the PGA did not like it, so they quickly declared the area where he would land his ball, an internal out-of-bounds! Nasty! Their reasoning: They are doing it for the safety of spectators and personnel. People are at risk at every hole at these events and that does not seem to bother them. In any case, they surely could keep spectators out of that area if it were so dangerous!
Maybe the old fuddy duddies of the PGA doesn't like players to think out of the box and play the game differently!
Players 2021: PGA Tour handcuffs Bryson DeChambeau with new rule that foils his bold 18th hole strategy[^]
Get me coffee and no one gets hurt!
modified 10-Mar-21 10:24am.
|
|
|
|
|
Cp-Coder wrote: I have never seen a golf ball being struck that hard and well. I have. Happy Gilmore.
|
|
|
|
|
That is pretty frustrating. It's like telling Steph Curry he can't shoot the long shot anymore.
|
|
|
|
|
Might I add that I find the PGA, watching golf, and the entire system less interesting than counting sheets of bathroom tissue prior to folding but possibly more interesting than watching paint dry.
And that's considering the PGA at its best.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
I share your sentiments, not for golf but when watching baseball (or cricket).
Get me coffee and no one gets hurt!
|
|
|
|