Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.acorn.programmer > #6384

Re: Reading the dimensions of a sprite or JPEG on disk

From Martin Wuerthner <spamtrap@mw-software.com>
Newsgroups comp.sys.acorn.programmer
Subject Re: Reading the dimensions of a sprite or JPEG on disk
Date 2022-06-07 16:33 +0200
Organization MW Software
Message-ID <mpro.rd434c00756yg00vg.spamtrap@mw-software.com> (permalink)
References (7 earlier) <ZeadnfdmIvFTZAn_nZ2dnUU7-WfNnZ2d@brightview.co.uk> <59f119bd97Paul@sprie.nl> <_-CdncrtZoeZZQj_nZ2dnUU7-UPNnZ2d@brightview.co.uk> <59f13aedf2Paul@sprie.nl> <Aa-dnfbF4Md84gv_nZ2dnUU7-KHNnZ2d@brightview.co.uk>

Show all headers | View raw


Gerald Holdsworth <nospam@hollypops.co.uk> wrote:

> On 31/05/2022 14:30, Paul Sprangers wrote:
> > In article <_-CdncrtZoeZZQj_nZ2dnUU7-UPNnZ2d@brightview.co.uk>,
> >     Gerald Holdsworth <nospam@hollypops.co.uk> wrote:
> > 
> > > What I meant was that I'm sure that if !Paint can do this, then the
> > > RISC OS SWI calls can probably do it. I.e., I'm wondering if !Paint is
> > > just a wrapper around the OS_Sprite calls.
> > 
> > Ah, I see what you mean. But since I still have to scale the resulting
> > sprite, I could as well use the ChangeFSI function right away.
> > 
> 
> OS_SpriteOp 52 paints a scaled sprite onto the screen. I can't see any
> calls to rescale a sprite as a new sprite in the area.

The way this is usually done is to create a new sprite in the area (or some
other area), redirect output to it via OS_SpriteOp 60 and then use
OS_SpriteOp 52 (or 56 using a matrix) to plot the original sprite scaled
into your new sprite.

Be careful when using SpriteOp 60. Never forget to switch output back to the
screen, and if your code crashes while output is switched, you will usually
have to reboot.

In terms of quality you are much better off using ChangeFSI, since SpriteOp
52 scales down in a very naive way, which causes massive aliasing effects,
while ChangeFSI interpolates between pixel values and uses error diffusion.

-- 
Martin Wuerthner         MW Software      http://www.mw-software.com/

------- RISC OS Software for Design, Printing and Publishing --------

Back to comp.sys.acorn.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Reading the dimensions of a sprite or JPEG on disk Paul Sprangers <Paul@sprie.nl> - 2022-05-28 12:08 +0200
  Re: Reading the dimensions of a sprite or JPEG on disk News <chrisjohnson@spamcop.net> - 2022-05-28 11:37 +0100
    Re: Reading the dimensions of a sprite or JPEG on disk Paul Sprangers <Paul@sprie.nl> - 2022-05-28 12:48 +0200
      Re: Reading the dimensions of a sprite or JPEG on disk Gerald Holdsworth <nospam@hollypops.co.uk> - 2022-05-28 14:26 +0100
        Re: Reading the dimensions of a sprite or JPEG on disk Paul Sprangers <Paul@sprie.nl> - 2022-05-30 13:58 +0200
          Re: Reading the dimensions of a sprite or JPEG on disk Gerald Holdsworth <nospam@hollypops.co.uk> - 2022-05-30 15:16 +0100
            Re: Reading the dimensions of a sprite or JPEG on disk Paul Sprangers <Paul@sprie.nl> - 2022-05-30 16:51 +0200
              Re: Reading the dimensions of a sprite or JPEG on disk Gerald Holdsworth <nospam@hollypops.co.uk> - 2022-05-30 18:07 +0100
                Re: Reading the dimensions of a sprite or JPEG on disk Paul Sprangers <Paul@sprie.nl> - 2022-05-31 09:27 +0200
                Re: Reading the dimensions of a sprite or JPEG on disk Gerald Holdsworth <nospam@hollypops.co.uk> - 2022-05-31 12:12 +0100
                Re: Reading the dimensions of a sprite or JPEG on disk Paul Sprangers <Paul@sprie.nl> - 2022-05-31 15:30 +0200
                Re: Reading the dimensions of a sprite or JPEG on disk Gerald Holdsworth <nospam@hollypops.co.uk> - 2022-05-31 21:51 +0100
                Re: Reading the dimensions of a sprite or JPEG on disk Steve Fryatt <news@stevefryatt.org.uk> - 2022-05-31 23:29 +0100
                Re: Reading the dimensions of a sprite or JPEG on disk Martin Wuerthner <spamtrap@mw-software.com> - 2022-06-07 16:33 +0200
                Re: Reading the dimensions of a sprite or JPEG on disk Paul Sprangers <Paul@sprie.nl> - 2022-06-11 08:56 +0200
                Re: Reading the dimensions of a sprite or JPEG on disk Sprow <news@sprow.co.uk> - 2022-06-12 08:15 -0700
                Re: Reading the dimensions of a sprite or JPEG on disk Martin <News03@avisoft.f9.co.uk> - 2022-05-31 13:10 +0100
                Re: Reading the dimensions of a sprite or JPEG on disk Paul Sprangers <Paul@sprie.nl> - 2022-05-31 15:59 +0200
                Re: Reading the dimensions of a sprite or JPEG on disk News <chrisjohnson@spamcop.net> - 2022-05-31 16:28 +0100
                Re: Reading the dimensions of a sprite or JPEG on disk News <chrisjohnson@spamcop.net> - 2022-05-31 16:51 +0100
                Re: Reading the dimensions of a sprite or JPEG on disk Paul Sprangers <Paul@sprie.nl> - 2022-05-31 18:33 +0200

csiph-web