@DATABASE IMAGEPOOL
@$VER: 0.8ß
@(C) 1999-2k by Linus McCabe
@AUTHOR Linus McCabe

@REMARK Edited with Guided by Linus McCabe


@NODE "Main" "Main"
@NEXT Introduction

    @{U}@{B}ImagePool.library V0.8ß@{UU}@{UB}

Welcome to the third beta release of the ImagePool library.

@{"Introduction" LINK "Introduction"}
@{"Contents" LINK "Contents"}
@{"Configuration" LINK "ENVVAR"}

@{"History" LINK "History"}
@{"TODO" LINK "TODO"}

@{"Author" LINK "Author"}

@ENDNODE
@NODE "Introduction" "Introduction"
@NEXT TODO
@PREV Main

    @{U}@{B}Introduction@{UU}@{UB}

ImagePool.library is a library to cache images in memory.

If a program uses an image several times or several prog-
rams uses an image, the same bitmap will be used and thus
remapping only needs to be done once and memory will be
saved.

This is a beta version of the library but it's stable on
my system and been active for some time by now.

I made two simple speedtests with the included examples,
Test1 (which uses datatypes) and Test2 (which uses Image-
Pool). Figures are in microseconds and show how long time
it took to generate and show the windows.
Img1 is quite small png, Img2 is a bit larger jpg.
(and the wonderful artwork is done by me :)

Test1:                Test2:
Img1       Img2       Img1      Img2
1507754    1858776    569840    642459
1479167    1885489    424536    295732
1488082    1962212    418519    290736
1488273    1904498    426677    310528
1505026    1915313    414889    314605
1513202    1875909    420327    307133

The first time the image is loaded by ImagePool, it takes
slightly longer time, since this is the time it gets loaded
and remapped.

The image is displayed 8 times, whic, for the datatype version,
means the image is loaded and remapped 8 times. For the Image-
Pool version, it's only loaded and remapped the first time, then
copies are used.

Test1 gives ~ 185ms / image the first time, and all times.
Test2 gives ~ 71ms / image the first time, then ~53ms following
times. This could be considered a slight speed increase :)


@ENDNODE
@NODE "TODO" "TODO"
@NEXT Contents
@PREV Introduction

    @{U}@{B}TODO@{UU}@{UB}

Things waiting to be implemented:

    ° Better memusage calculation for the images.

    ° Keep cached images for 16bit+ screens even after
      the screen is closed and check the bitmapformat
      on these images instead.


    
@ENDNODE
@NODE "Contents" "Contents"
@NEXT History
@PREV TODO

    @{U}@{B}Contents@{UU}@{UB}

Files in this archive:

    docs/
        ImagePool.doc     - Autodoc for imagepool.library
        ImagePool.guide   - This guide

    examples/
                          - Two small mui programs to compare
                              loading speed with ImagePool vs
                              no ImagePool. For next release 
                              Ill make better ones! (oops, I
										didnt :)
    include/
        #?                - pragma, proto and other include
                              files for ImagePool.lib
    libs/
        imagepool.library - the library

    utils/
        try_IP            - as simple test of the library
        IP_DebugInfo      - Program that calls IP_DebugInfo

@ENDNODE
@NODE "History" "History"
@NEXT Author
@PREV Contents

    @{U}@{B}History@{UU}@{UB}

V0.8ß		Third public beta

		  ° Added Transparent pen to IPImage structure, as req-
			 uested by Benny Kjær Nielsen, Toolbar.mcc author.

		  ° Fixed, hopefully, the error in moving the last un-
			 used image to the used image-list.


V0.7ß    Second public beta

        ° Added MaskPlane to the IPImage structure.

        ° Fixed UsedMem bug that subtracted memory to
          UsedMem that was never added.

V0.5ß    First public release
@ENDNODE
@NODE "Author" "Author"
@NEXT ENVVAR
@PREV History

    @{U}@{B}Author@{UU}@{UB}

The library is written by Linus McCabe with lots of
help and suggestions from Allan Odgaard, Olaf Barthel,
Benny Kjær Nielsen and others on various mailinglists.

Also, parts of the library are based on CLib37x.lha by
Andreas Kleinert.

To get in touch with the author write to:

Sparkle@hehe.com
http://sparkle.amiga.tm

Other releases by the author includes

bdAnim, background animationplayer for the WB
GuidEd, AmigaGuide Editor (in which this guide is written)
AmiSOXPPC, PPC compile of AmiSOX 
TransferAnim.mcc, MUI customclass to display transferanims.

all availible on aminet

@ENDNODE
@NODE "ENVVAR" "Settings"
@PREV Author

    @{U}@{B}Configuration@{UU}@{UB}

There is only one configuration option at the moment,
how much memory the cache (including currently used
images) may use.

It's an env-var and you set it with

setenv IMAGEPOOL_MAXMEM <bytes>

where bytes are the amount of memory (in bytes) that
the cache may occupy.
If you wish to save your setting for next reboot, do a

copy env:IMAGEPOOL_MAXMEM envarc:

Note that this environment variable is only read at init
time of the library, so it must be flushed from memory
in order of the change to take part.
@ENDNODE
