Proposal to change IMGLIB libraries

Discussions related to the code libraries supplied with BB4W & BBCSDL
RichardRussell
Posts: 306
Joined: Tue 15 Oct 2019, 09:10

Proposal to change IMGLIB libraries

Post by RichardRussell »

The IMGLIB libraries that I recently published, for BB4W and BBCSDL, take a scale parameter (which determines the size of the rendered image) and a flip parameter (which controls whether the image is flipped horizontally and/or vertically). I am considering changing this interface so that instead they take a horizontal scale and a vertical scale, with flipping determined by the signs. So a horizontal scale factor of -1.0 would result in a horizontal flip.

This would provide the additional flexibility of being able to change the aspect ratio, whilst not increasing the number of parameters. What do you think? Is this a good idea? Obviously it's an incompatible change but I don't imagine very many people have already used the libraries. If I don't receive any major objections I will revise and re-publish the libraries.
If you have a comment about the style or tone of this message please report it to the moderators by clicking the exclamation mark icon, rather than complaining on the public forum.

DDRM
Posts: 168
Joined: Mon 02 Apr 2018, 18:04

Re: Proposal to change IMGLIB libraries

Post by DDRM »

Hi Richard,

That sounds an eminently sensible suggestion - and as you say, it's unlikely the libraries are already too deeply embedded in existing programs!

:-)

D

RichardRussell
Posts: 306
Joined: Tue 15 Oct 2019, 09:10

Re: Proposal to change IMGLIB libraries

Post by RichardRussell »

I've also added a new procedure to both libraries:

Code: Select all

      REM Multiply the image's R, G, B, A values by the specified factors:
      DEF PROC_imgMult(i%%, r, g, b, a)
This can be useful for automatically creating a shadow image (attenuate the RGB to zero; halve, say, the alpha) or fading an image in or out (gradually change the alpha channel from 0.0 to 1.0, or from 1.0 to 0.0).
If you have a comment about the style or tone of this message please report it to the moderators by clicking the exclamation mark icon, rather than complaining on the public forum.

User avatar
hellomike
Posts: 81
Joined: Sat 09 Jun 2018, 09:47

Re: Proposal to change IMGLIB libraries

Post by hellomike »

I just made a little program to test the library.

Feel free to make the proposed changes. Also every additional functionality is welcome.

Mike