@database Bitmapper.guide

@$VER: BitMapper V2.60 - By Fabio Rotondo (C)Amiga Foundation Classes

This guide file has been created using AutoGuide V1.05 - By Fabio Rotondo (fsoft@intercom.it).

@node Main "Amiga Foundation Classes: bitmapper"



                  ** BitMapper - Original By Fabio Rotondo **

                       * Part of the Amiga Foundation Classes *

        @{" Introduction " link "BitMapper_introduction"}             @{" Author's Info " link "author"}        @{" Amiga Foundation Classes " LINK "AFC.Guide/main"}
    
   Requires:

   Class Base: $00040000

   NEW COMMANDS                          BRIEF DESCRIPTION
   -------------------------------------------------------------------------
   @{" bitmapper()                         " link "BitMapper_bitmapper"} Initailizes the class.
   @{" allocbitmap(w,h,d, lay=F, rp=F)     " link "BitMapper_allocbitmap"} Creates a bitmap.
   @{" assign(bmp,w=-1,h=-1,lay=F,r=F)     " link "BitMapper_assign"} Copies a bitmap.
   @{" bitmap()                            " link "BitMapper_bitmap"} Returns a pointer to bitmap.
   @{" clear()                             " link "BitMapper_clear"} Free all bitmap's resources.
   @{" clearrastport()                     " link "BitMapper_clearrastport"} Frees bitmap's rastport.
   @{" clearlayers()                       " link "BitMapper_clearlayers"} Frees bitmap's layers.
   @{" cludge(mem)                         " link "BitMapper_cludge"} Converts a memory area into a bitmap.
   @{" createlayers(w=-1, h=-1)            " link "BitMapper_createlayers"} Creates bitmap layers.
   @{" createrastport()                    " link "BitMapper_createrastport"} Creates bitmap rastport.
   @{" depth()                             " link "BitMapper_width"} Returns bitmap's depth.
   @{" dump(fname)                         " link "BitMapper_dump"} Dumps a bitmap into a file.
   @{" freebitmap()                        " link "BitMapper_freebitmap"} Free the bitmap.
   @{" height()                            " link "BitMapper_width"} Returns bitmap's height.
   @{" image()                             " link "BitMapper_image"} Returns the Image structure of the bitmap.
   @{" loadraw()                           " link "BitMapper_loadraw"} Loads up a raw data bitmap.
   @{" rastport()                          " link "BitMapper_rastport"} Scans a Directory.
   @{" version()                           " link "BitMapper_version"} Returns bitmapper version.
   @{" width()                             " link "BitMapper_width"} Returns bitmap's width.

   @{" Error Table " LINK bitmapper_ErrorTable}
@endnode

@node "BitMapper_Introduction" "Introduction"

    BitMapper is an E object I have created to easyly manage bitmaps.

    Main features are:

        * Different OS2.0 and OS3.0 allocbitmap() method.

        * Methods to handle bitmap's rastport and layers.

@endnode

@node "author" "Author's Info"

    Original By:  Fabio Rotondo  (fsoft@intercom.it)

    E Version By: Fabio Rotondo

    
    
    Address:

            Fabio Rotondo
            C.so Vercelli 9
            28100 Novara
            ITALY

            e-mail: fsoft@intercom.it
                    Fabio.Rotondo@deagostini.it

            Phone:  (ITA) - (0)321 -   459676  (home)
                    (ITA) - (0)2   - 38086520  (office)
                    (ITA) - (0)338 -  7336477  (GSM Phone)

            Fax:    (ITA) - (0)2   - 38086278

            Web:    http://www.intercom.it/~fsoft               (my home page)

                    http://www.intercom.it/~fsoft/ablast.html   (Amiga Blast Home Page)

@endnode

@node bitmapper_ErrorTable "BitMapper / Error Table "

VALUE           | DESCRIPTION
----------------+----------------------------------
$0000           | No Memory.
$0001           | Could not open layer library
$0002           | Could not create the layer
$0003           | Could not create behind layer
$0004           | File not found
$0005           | Could not create file
@endnode

@node "BitMapper_bitmapper" "Amiga Foundation Classes: bitmapper/bitmapper()"
           NAME: bitmapper()

    DESCRIPTION: Use this method to initailize the object.

          INPUT: NONE.

        RESULTS: NONE.

       SEE ALSO:
@endnode

@node "BitMapper_clear" "Amiga Foundation Classes: bitmapper/clear()"
           NAME: clear()

    DESCRIPTION: This method frees all memory allocated by the class.

          INPUT: NONE.

        RESULTS: NONE.

          RAISE:

       SEE ALSO: @{" allocbitmap() " LINK bitmapper_alloc}
                 @{" freebitmap()  " LINK bitmapper_freebitmap}
@endnode

@node "BitMapper_allocbitmap" "Amiga Foundation Classes: bitmapper/allocbitmap()"
           NAME: allocbitmap(width, height, depth, layers=FALSE, rastport=FALSE)

    DESCRIPTION: This method allocates a bitmap and a rastport for it.
                 It also frees all datas previously allocated on the same
                 object.

          INPUT: width                  - Bitmap width  (in pixels)
                 height                 - Bitmap height (in pixels)
                 depth                  - Bitmap depth  (1...8)
                 layers                 - (Optional) if TRUE, a layer structure
                                          will be created. Default is FALSE.
                 rastport               - (Optional) if TRUE, a rastport will be
                                          created. Default is FALSE.

        RESULTS:

       SEE ALSO: @{" freebitmap()     " LINK bitmapper_freebitmap}
                 @{" createlayers()   " LINK bitmapper_createlayers}
                 @{" createrastport() " LINK bitmapper_createrastport}
@endnode

@node "BitMapper_createlayers" "Amiga Foundation Classes: bitmapper/createlayers()"
           NAME: createlayers(w=-1, h=-1)

    DESCRIPTION: This method creates a layers structure for the bitmap.

          INPUT: w, h          - (Optional) Layer's width and height. If these
                                 params are omitted, layers' size will be the same
                                 of the bitmap.

        RESULTS: TRUE          - creation successfull.
                 FALSE         - creation failed. (Maybe no bitmap allocated)

       SEE ALSO: @{" clearlayers()    " LINK bitmapper_clearlayers}
                 @{" createrastport() " LINK bitmapper_createrastport}
@endnode

@node "BitMapper_createrastport" "Amiga Foundation Classes: bitmapper/createrastport()"
           NAME: createrastport()

    DESCRIPTION: This method creates a rastport for the bitmap present in the
                 class.

          INPUT: NONE

        RESULTS: TRUE   - creation successfull.
                 FALSE  - creation failed. (Maybe no bitmap allocated)

       SEE ALSO: @{" clearrastport() " LINK bitmapper_clearrastport}
                 @{" createlayers()  " LINK bitmapper_createlayers}
@endnode

@node "BitMapper_clearrastport" "Amiga Foundation Classes: bitmapper/clearrastport()"
           NAME: clearrastport()

    DESCRIPTION: This method will free bitmap's rastport.

          INPUT: NONE.

        RESULTS: rastport is freed from the memory.

       SEE ALSO: @{" createrastport() " LINK bitmapper_createrastport}

@endnode

@node "BitMapper_clearlayers" "Amiga Foundation Classes: bitmapper/clearlayers()"
           NAME: clearlayers()

    DESCRIPTION: This method frees bitmap's layers.

          INPUT: NONE.

        RESULTS: Layer's memory is freed.

           NOTE: By freeing the layers you'll free also the rastport!!!

       SEE ALSO: @{" createlayers()   " LINK bitmapper_createlayers}
                 @{" createrastport() " LINK bitmapper_createrastport}
@endnode

@node "BitMapper_freebitmap" "Amiga Foundation Classes: bitmapper/freebitmap"
           NAME: freebitmap()

    DESCRIPTION: This method frees the bitmap and, eventually, also 
                 the rastport and layers.

          INPUT: NONE.

        RESULTS: NONE.

       SEE ALSO: @{" allocbitmap()  " LINK bitmapper_alloc}
                 @{" freelayers()   " LINK bitmapper_freelayers}
                 @{" freerastport() " LINK bitmapper_freerastport}
@endnode

@node "BitMapper_assign" "Amiga Foundation Classes: bitmapper/assign"
           NAME: assign(bitmap:PTR TO bitmap, w=-1, h=-1, layers=FALSE, rport=FALSE)

    DESCRIPTION: Use this method to "change" on the fly the bitmap
                 with a new one. Note that all datas of the previous
                 bitmap will be lost.

          INPUT: bitmap     - (PTR TO bitmap) a new bitmap to handle.
                 w,h        - (Optional) Bitmap's width and height
                              to copy. You can set width and height to
                              a different (usally minor) size of the original
                              bitmap, to copy just a part of it.

                 layers     - (Optional) if TRUE a layer structure will be
                              created.

                 rastport   - (Optional) if TRUE a rastport structure will be
                              created.

        RESULTS: NONE.

          NOTES: this method calls @{" allocbitmap() "  LINK bitmapper_allocbitmap}.

                 this method may use the blitter.

       SEE ALSO: @{" allocbitmap() "  LINK bitmapper_allocbitmap}.
@endnode

@node "BitMapper_rastport" "Amiga Foundation Classes: bitmapper/rastport"
           NAME: rastport()

    DESCRIPTION: This method returns the 8Bit bitmap's rastport.

          INPUT: NONE.

        RESULTS: a ptr to a rastport. It may be NIL.

       SEE ALSO: @{" createrastport() " LINK bitmapper_createrastport}
                 @{" allocbitmap()    " LINK bitmapper_alloc}


@endnode

@node "BitMapper_bitmap" "Amiga Foundation Classes: bitmapper/bitmap()"
           NAME: bitmap()

    DESCRIPTION: This method returns a PTR TO bitmap

          INPUT: NONE.

        RESULTS: a PTR TO bitmap. It may be NIL.

       SEE ALSO: @{" allocbitmap() " LINK bitmapper_allocbitmap}
@endnode

@node "BitMapper_version" "Amiga Foundation Classes: bitmapper/version()"
           NAME: version()

    DESCRIPTION: This method returns class version and revision.

          INPUT: NONE.

        RESULTS: This method returns TWO values, Version and Revision.

       SEE ALSO:
@endnode

@node "BitMapper_cludge" "Amiga Foundation Classes: bitmapper/cludge()"
           NAME: cludge(mem:PTR TO LONG)

    DESCRIPTION: This method converts a memory area into a bitmap

          INPUT: mem    - Memory address.

        RESULTS: This method returns THREE values: width, height and depth
                 of the cludged bitmap.

           NOTE: The bitmap MUST be created using @{" dump() " LINK bitmapper_dump} method!

       SEE ALSO: @{" dump()     " LINK "BitMapper_dump"}
                 @{" loadraw()  " LINK "BitMapper_loadraw"}
@endnode

@node "BitMapper_loadraw" "Amiga Foundation Classes: bitmapper/loadraw()"
           NAME: loadraw(fname:PTR TO CHAR)

    DESCRIPTION: This method loads up a file containing a previously dump()ed
                 bitmap.

          INPUT: fname        - File name to load.

        RESULTS: This method returns THREE values: width, height and depth
                 of the loaded raw data.

           NOTE: The bitmap MUST be created using @{" dump() " LINK bitmapper_dump} method!

       SEE ALSO: @{" dump()   " LINK "BitMapper_dump"}
                 @{" cludge() " LINK "BitMapper_cludge"}
@endnode

@node "BitMapper_dump" "Amiga Foundation Classes: bitmapper/dump()"
           NAME: dump(fname:PTR TO CHAR)

    DESCRIPTION: This method dumps a bitmap inbt a raw data format file.

          INPUT: fname        - File name where to dump the bitmap.

        RESULTS: NONE

       SEE ALSO: @{" loadraw() " LINK "BitMapper_loadraw"}
@endnode

@node "BitMapper_width" "Amiga Foundation Classes: bitmapper/width()"
           NAME: width()

    DESCRIPTION: This method returns bitmap's width.

          INPUT: NONE.

        RESULTS: Bitmap's width.

       SEE ALSO: @{" height() " LINK "BitMapper_height"}
                 @{" depth()  " LINK "BitMapper_depth"}
@endnode

@node "BitMapper_height" "Amiga Foundation Classes: bitmapper/height()"
           NAME: height()

    DESCRIPTION: This method returns bitmap's height.

          INPUT: NONE.

        RESULTS: Bitmap's height.

       SEE ALSO: @{" width() " LINK "BitMapper_width"}
                 @{" depth()  " LINK "BitMapper_depth"}
@endnode

@node "BitMapper_depth" "Amiga Foundation Classes: bitmapper/depth()"
           NAME: depth()

    DESCRIPTION: This method returns bitmap's depth.

          INPUT: NONE.

        RESULTS: Bitmap's depth.

       SEE ALSO: @{" height() " LINK "BitMapper_height"}
                 @{" width()  " LINK "BitMapper_width"}
@endnode

@node "bitmapper_image" "Amiga Foundation Classes: Bitmapper/image()"

           NAME: image()

    DESCRIPTION: Sometimes, it is usefull to obtain picture Image structure, the one
                 used by Ituition gadgets. Using this method, you can obtain this
                 Image structure.

          INPUT: NONE

        RESULTS: a pointer to a valid Image structure.

           NOTE: This method is *slow* the first time you call it, because it has
                 to create the Image structure and picture. Then, it will be
                 fastlighting, until you don't load another picture in the class.

       SEE ALSO: 

@endnode

