Author Topic: Image scaling  (Read 5959 times)

0 Members and 2 Guests are viewing this topic.

Offline Haobo

  • LV2 Member (Next: 40)
  • **
  • Posts: 27
  • Rating: +4/-0
    • View Profile
Image scaling
« 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?
Projects:
Star Cats
Five Nights at Freddy's
Phoenix Wright

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Image scaling
« Reply #1 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.

Offline Haobo

  • LV2 Member (Next: 40)
  • **
  • Posts: 27
  • Rating: +4/-0
    • View Profile
Re: Image scaling
« Reply #2 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?
Projects:
Star Cats
Five Nights at Freddy's
Phoenix Wright

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Image scaling
« Reply #3 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.

Offline Haobo

  • LV2 Member (Next: 40)
  • **
  • Posts: 27
  • Rating: +4/-0
    • View Profile
Re: Image scaling
« Reply #4 on: April 29, 2015, 11:09:44 pm »
So... anyone want to help me? I only need scaling in the X direction, anyone? ::)
Projects:
Star Cats
Five Nights at Freddy's
Phoenix Wright

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Image scaling
« Reply #5 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.

Offline Haobo

  • LV2 Member (Next: 40)
  • **
  • Posts: 27
  • Rating: +4/-0
    • View Profile
Re: Image scaling
« Reply #6 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!
Projects:
Star Cats
Five Nights at Freddy's
Phoenix Wright

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Image scaling
« Reply #7 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, 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!

Offline Haobo

  • LV2 Member (Next: 40)
  • **
  • Posts: 27
  • Rating: +4/-0
    • View Profile
Re: Image scaling
« Reply #8 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

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.