

TABLE OF CONTENTS

MPImage.library/FreeMPImage
MPImage.library/LoadMPImage
MPImage.library/MPImageErrorMessage
MPImage.library/MPPlanarToChunky
MPImage.library/RescaleMPImage
MPImage.library/SaveMPImageA
MPImage.library/SetMPImageScreen


MPImage.library/FreeMPImage                        MPImage.library/FreeMPImage

   NAME   
  FreeMPImage -- Free an image loaded using LoadMPImage() (V3)

   SYNOPSIS
  FreeMPImage( MPi )
               A0

  void FreeMPImage( struct MPImage * );

   FUNCTION
  Frees all data associated loaded with an image using LoadMPImage().

   INPUTS
  MPi - structure returned by LoadMPImage().

   RESULT
  None.

   EXAMPLE

   NOTES

   BUGS

   SEE ALSO
  LoadMPImage()

MPImage.library/LoadMPImage                        MPImage.library/LoadMPImage

   NAME   
  LoadMPImage -- Load an image in various formats (V4)

   SYNOPSIS
  MPi = LoadMPImage( filename,screen,Flags )
  D0                       A0       A1     D0

  struct MPImage *LoadMPImage
                  ( const char *,struct Screen *,ULONG);

   FUNCTION
  Load an image in BitMap, EGSBitMap or RGB format.

   INPUTS
  filename - name of file from which to load image
           - -c or -cnumber for clipboard
  screen   - screen on which BitMap is to be used. May be NULL.
  Flags    - Flags to control image loading
      Default is to remap to screen palette and return a bitmap in BitMap
      Only way to free is to call FreeMPImage().

      MPIF_EGS         - Return E_EBitMap rather than BitMap. 
          Overrides MPIF_RGB
      MPIF_CLONEBITMAP - You are free to zero BitMap/EGS_BitMap before
          calling FreeMPImage(). You must then call FreeBitMap() or 
          E_DisposeBitMap() yourself. Ignored for MPIF_RGB/GREY. If screen
          supplied then clone is screen depth deep if possible.
      MPIF_NOREMAP     - Don't remap to the current screen colors. Ignored
          for MPIF_EGS/RGB/GREY. Returns error if 24 bit input.
      MPIF_RGB         - return Red, Green, Blue instead of BitMap.
      MPIF_GREY        - return Red, Green, Blue instead of BitMap. If
          image is greyscale then Red, Green and Blue will be the same
          and GreyScale will be TRUE
      MPIF_FORCEGREY   - As MPIF_GREY except input will always be remapped
          to greyscale.
      MPIF_LINEARGREY  - Use linear (not colour based) mapping (V5.0)

   RESULT
  MPi - Pointer to an MPImage structure holding the image data.
        NULL if an error occurs. Use MPImageErrorMessage() to get error.

   EXAMPLE

   NOTES
  If file format is JPG and env/mpimage/djpeg is set (e.g. djpeg "%s" "%s")
  and not loading a BitMap then djpeg is used.

  If file format is PNG and env/mpimage/pngtopnm is set
  (e.g. pngtopnm "%s" >"%s") and not loading a BitMap then pngtopnm is used.

  Other fileformats are IBLM (depth 1 to 8 and 24, EHB, HAM6 and HAM8),
  PBM (all types) and any picture datatype. With dctv.library(3) can also
  load DCTV images.

   BUGS
  Waits 20 seconds for djpeg/pngtopnm to start then aborts.
  Fails to set an error message if failure loading from clipboard.
  Can also fail to set an error message in other (unknown) circumstances.

   SEE ALSO
  FreeMPImage(),MPImageErrorMessage,graphics.library/FreeBitMap(),
  egs.library/E_DisposeBitMap(),MPImageErrorMessage().

MPImage.library/MPImageErrorMessage        MPImage.library/MPImageErrorMessage

   NAME   
  MPImageErrorMessage -- Return the last error set by MPImage.library. (V3)

   SYNOPSIS
  msg = MPImageErrorMessage()
  D0

  char *MPImageErrorMessage( void );

   FUNCTION
  Returns the last error message set by this opener of MPImage.library.

   INPUTS
  None.

   RESULT
  Formatted Error Message.

   EXAMPLE

   NOTES

   BUGS

   SEE ALSO

MPImage.library/MPPlanarToChunky              MPImage.library/MPPlanarToChunky

   NAME   
  MPPlanarToChunky -- Convert a bitmap to a chunky buffer (V5)

   SYNOPSIS
  MPPlanarToChunky( bitmap, chunky, width, height )
                    A0      A1      D0     D1

  void MPPlanarToChunky( struct BitMap *, UBYTE *, UWORD, UWORD);

   FUNCTION
  Converts a BitMap to a chunky buffer.

   INPUTS
  bitmap - Pointer to a standard bitmap.
  chunky - Pointer to a chunky buffer of sufficient size.
  width  - Width of bitmap.
  height - Height of bitmap.

   RESULT
  None.

   EXAMPLE

   NOTES

   BUGS

   SEE ALSO

MPImage.library/RescaleMPImage                  MPImage.library/RescaleMPImage

   NAME   
  RescaleMPImage -- Scales an image created by LoadMPImage() (V3)

   SYNOPSIS
  error = RescaleMPImage(MPi, x, y)
  D0                     A0   D0 D1

  BOOL RescaleMPImage(struct MPImage *, UWORD, UWORD);

   FUNCTION
  Scales an Image loaded by LoadMPImage() to new width and height.

   INPUTS
  MPi - Image loaded by LoadMPImage
  x   - New width of image
  y   - New height of image

   RESULT
  error - 1 for success, 0 for failure.
          Use MPImageErrorMessage() to get error.

   EXAMPLE

   NOTES
  Rescaling of bitmaps is done using BitMapScale().
  Other rescaling is done using custom code with smoothing.

  If this function fails then the MPImage is no longer usable and
  FreeMPImage() should be called to free it.

  Version 4.3 is faster for RGB.

   BUGS
  Bitmaps may not scale smoothly.
  The rescaling of EGS images is not efficent.

   SEE ALSO
  LoadMPImage(),MPImageErrorMessage(),FreeMPImage(),
  graphics.library/BitMapScale().

MPImage.library/SaveMPImageA                      MPImage.library/SaveMPImageA

   NAME   
  SaveMPImageA -- Save an image in various formats. (V3)
  SaveMPIMage -- Varargs version of SaveMPImageA (V3)

   SYNOPSIS
  succ = SaveMPImageA( file,red,green,blue,width,height,taglist)
  D0                   A0   A1  A2    A3   D0    D1     A5

  BOOL SaveMPImageA( UBYTE *,UBYTE *,UBYTE *,UBYTE *,
                                   UWORD,UWORD,struct TagItem *);

  succ = SaveMPImage( file,red,green,blue,width,height,Tag1, ...)

  BOOL SaveMPImage( UBYTE *,UBYTE *,UBYTE *,UBYTE *,
                                   UWORD,UWORD,ULONG,...);

   FUNCTION
  Saves/displays an image held in chunky buffers.

   INPUTS
  file    - filename to save file as. If NULL or "" then image is
            displayed on a custom screen.
  red     - red chunky input.
  green   - green chunky input.
  blue    - blue chunky input.
  width   - width of chunky buffers
  height  - height of chunky buffers.
  taglist - pointer to TagItem array.

  Tags are:

  MPIS_MODE   - Data is ULONG CAMG of output IFF file/screen EHB and HAM
                will be added if required. If not supplied then
                MPIS_MODENAME will be used. If that is not supplied then
                a CAMG mode will be generated.
  MPIS_MODENAME - Data is char * mode name of CAMG of output. Invalid
                  names are ignored.
  MPIS_FORMAT - Data is char * specifying output format.
                Default is MPI_BW16. Values are:
                MPI_BW16   - "BW16"   - 16 colour ILBM grey scale.
                MPI_BW256  - "BW256"  - 256 colour ILBM grey scale.
                MPI_HAM6   - "HAM6"   - HAM6 with fixed (internal) palette.
                MPI_HAM6P  - "HAM6P"  - HAM6 with generated or supplied
                                        palette - see MPIS_PALETTE.
                MPI_HAM8   - "HAM8"   - HAM8 with fixed (internal) palette.
                MPI_HAM8P  - "HAM8P"  - HAM8 with generated or supplied
                                        palette - see MPIS_PALETTE.
                MPI_ILBM24 - "ILBM24" - 24 bit ILBM.
                MPI_PPM    - "PPM"    - P6 (or P5 if red,green and blue are
                                        the same).
                MPI_COLOUR - "COLOUR" - ILBM with generated or supplied
                                        palette - see MPIS_PALETTE.
                MPI_EHB    - "EHB"    - EHB with generated or supplied
                                        palette - see MPIS_PALETTE.
                MPI_JPEG   - "JPEG"   - JPEG see NOTES.
                MPI_PNM    - "PNG"    - PNG see NOTES.
                MPI_DCTV3  - "DCTV3"  - DCTV 3 bit plane format
                MPI_DCTV4  - "DCTV4"  - DCTV 4 bit plane format
  MPIS_PALETTE - Data is char * name of ILBM to load palette from.
  MPIS_COLOURS - Data is ULONG number of colours for MPI_COLOUR.
                 Default is is number of colours in MPIS_PALETTE if
                 supplied, otherwise 16. If greater than that from
                 MPIS_PALETTE then ignored.
  MPIS_12BIT   - Data is BOOL. If TRUE then use faster 12bit colour palette
                 generating algorithm for MPI_COLOUR and MPI_EHB. Default
                 is FALSE to use 18bit algorithm.
  MPIS_LINEAR  - Data is BOOL. If TRUE then for BW16/BW256 use linear
                 (not colour based) mapping. (V5.0)
  MPIS_GREYMAP - Data is UBYTE *. For BW16/BW256 palette map. Must point
                 to at least 16 of value 0 to 15 for BW16, 256 bytes of
                 0 to 255 for BW255. (V5.0)
                 Format is e.g. 0,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1
                   Colour 0 will be black
                   Colour 1 will be white
                   etc.
                 This is the opposite to which you may expect!

   RESULT
  error - 1 for success, 0 for failure.
          Use MPImageErrorMessage() to get error.

   EXAMPLE

   NOTES
  If MPIS_FORMAT is BW16 or BW256 and red,green and blue are the same then
  a more efficent algorithm is used.

  When displaying on screen click in the top left and press a key to exit.

  If file format is JPEG and env/mpimage/cjpeg is set (e.g. cjpeg "%s" "%s")
  then cjpeg is used.

  If file format is PNG and env/mpimage/pnmtopng is set
  (e.g. 'pnmtopng "%s" >"%s"') then pnmtopng is used.

   BUGS
  Does not work for images > 1024 wide (except PPM/JPEG/PNG).
  The palette file requires a body which is loaded and then discarded.

  Waits 20 seconds for cjpeg/pnmtopng to start then aborts. This check is
  not fool proof and the PIPE:xxx can be left hanging.

  Prior to version 4.3 fails to determine a screen mode correctly.

   SEE ALSO
  MPImageErrorMessage().

MPImage.library/SetMPImageScreen              MPImage.library/SetMPImageScreen

   NAME   
  SetMPImageScreen -- Sets the Screen name for progress requesters (V3)

   SYNOPSIS
  SetMPImageScreen(ScreenName,Flags)
                   A0         D0

  void SetMPImageScreen(char *, ULONG);

   FUNCTION
  Sets the Screen Name for progress requesters for this opener.

   INPUTS
  ScreenName - Name of Public Screen, NULL for default
  Flags      - 0 - Do not show progress requesters (default)
             - MPIF_PROGRESS - Do show progress requesters
                               (except for non remapped bitmaps).

   RESULT
  None.

   EXAMPLE

   NOTES
  ScreenName must remain valid while MPImage.library is open.

   BUGS

   SEE ALSO

