Omnimaga

Calculator Community => Major Community Projects => The Axe Parser Project => Topic started by: Haobo on April 29, 2015, 04:48:30 pm

Title: Image scaling
Post by: Haobo on April 29, 2015, 04:48:30 pm
I know that there already is an image scaling axiom that someone made, but what I need is for an image to only be scaled in 1 direction, or basically just stretching it. Any already made?
Title: Re: Image scaling
Post by: Runer112 on April 29, 2015, 05:03:14 pm
I believe such a routine has never been made. It may be possible to modify the existing scaled sprite Axiom to do that, though, especially if all you need is horizontal downscaling.
Title: Re: Image scaling
Post by: Haobo on April 29, 2015, 10:53:10 pm
I have very little experience with actual z80 coding, so how hard would it be to modify the axiom with this little to no experience?
Title: Re: Image scaling
Post by: Runer112 on April 29, 2015, 11:05:41 pm
Realistically, that would be nearly impossible. So unless you're planning on learning z80 assembly, you'd probably need to recruit someone to produce the code for you. If you do in fact only need downscaling in one direction, it doesn't sound like it would be a huge undertaking, as one would just need to cut out the downscaling logic for the other direction from the existing scaled sprite Axiom. Or, it could be generalized to support separate horizontal and vertical scaling factors, and you'd just use a factor of 1.0 for one of them.
Title: Re: Image scaling
Post by: Haobo on April 29, 2015, 11:09:44 pm
So... anyone want to help me? I only need scaling in the X direction, anyone? ::)
Title: Re: Image scaling
Post by: Runer112 on April 29, 2015, 11:16:59 pm
To clarify... just downscaling? Because the existing Axiom only supports downscaling, not upscaling.

If that's the case, I could perhaps give modifying the Axiom a try tomorrow.
Title: Re: Image scaling
Post by: Haobo on April 29, 2015, 11:19:02 pm
I only need downscaling, wanted to try a page flipping animation,  so downscaling x only should be enough.
Thanks if you can do it!
Title: Re: Image scaling
Post by: Runer112 on April 30, 2015, 01:16:30 pm
Alright, so as far as I can tell, the modification was successful. It uses the same tokens and input format as the original Axiom (https://www.omnimaga.org/the-axe-parser-project/scaled-sprites-axiom/msg389239/#msg389239), but each token now starts with an "H." Some weird OS behavior that I can't explain may make the "ZoomFit" token not be replaced with "HScaledClip-On(" in menus, but it should otherwise work correctly.

The Axiom and its source are attached to this post. Let me know how it goes!
Title: Re: Image scaling
Post by: Haobo on May 05, 2015, 11:51:23 am
Thanks Runer, I managed to use it to make a text reader of xkcd, here's a pic of how it turned out :P
(http://i.imgur.com/lN126rq.gif)
I removed the appvar from my version, but this works just as well. (just with an extra file to download) Going to add page numbers, possibly more scaling animations, and other stuff later.