home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 19 / AACD19.BIN / AACD / Programming / MCC_ImageDB / Doc / MCC_ImageDB.doc
Encoding:
Text File  |  2000-12-28  |  6.1 KB  |  248 lines

  1. TABLE OF CONTENTS
  2.  
  3. ImageDB.mcc/---Overview---
  4. ImageDB.mcc/---guigfx.library---
  5. ImageDB.mcc/MUIA_ImageDB_GuiGFXBase
  6. ImageDB.mcc/MUIM_ImageDB_DeleteImage
  7. ImageDB.mcc/MUIM_ImageDB_GetImage
  8. ImageDB.mcc/MUIM_ImageDB_GetName
  9. ImageDB.mcc/MUIM_ImageDB_InitImage
  10. ImageDB.mcc/MUIM_ImageDB_LoadImage
  11. ImageDB.mcc/MUIM_ImageDB_RemoveImage
  12. ImageDB.mcc/MUIM_ImageDB_ScaleImage
  13. ImageDB.mcc/---Overview---
  14.  
  15.     The goal of this class was to implement some kind of "textures" manager
  16.     for StormMesa, so it could be easy to load a texture from a file and use it in the
  17.     StormMesa context. Some kind of Images database is included in ImageDB objects
  18.     for this purpose.
  19.  
  20.     The "textures" will be loaded with the help of an external library: guigfx.library
  21.     from Timm S.Mueller. Guigfx uses datatypes if necessary, so your installed Datatypes
  22.     will be used as an alternative. GuiGFX library could be find on the nearest Aminet.
  23.  
  24.     The ImageDB object will take care of all initialisation and memory allocation for
  25.     the textures/images. The image is then accessible in a way StormMesa could use it.
  26.  
  27.     Warning: ImageDB is not a MUI_Area subclass, you can't use it in GUIs, but better
  28.              as a stand alone MUI object.
  29.  
  30. ImageDB.mcc/---guigfx.library---
  31.  
  32.     All the texture/images handling uses guigfx.library written by Timm S. Mueller.
  33.     You have ton install this library to use ImageDB.mcc.
  34.  
  35.     For more information look at guigfx doumentation.
  36.  
  37. ImageDB.mcc/MUIA_ImageDB_GuiGFXBase
  38.  
  39.   NAME
  40.     MUIA_ImageDB_GuiGFXBase -- [..G], BOOL
  41.  
  42.   FUNCTION
  43.     Returns the global base pointer to the guigfx.library.
  44.  
  45.   BUGS
  46.  
  47.   SEE ALSO
  48.  
  49.  
  50. ImageDB.mcc/MUIM_ImageDB_DeleteImage
  51.   NAME
  52.     MUIM_ImageDB_DeleteImage
  53.  
  54.   SYNOPSIS
  55.     (struct GLImage *) DoMethod(obj,MUIM_ImageDB_DeleteImage,id)
  56.  
  57.     //--- Delete an image
  58.     struct MUIP_ImageDB_DeleteImage {
  59.         ULONG MethodID;
  60.         char *id;
  61.     };
  62.  
  63.     id  Identification name (key) of the image to delete
  64.  
  65.   FUNCTION
  66.     Deletes (remove from memory and from database) the specified image.
  67.  
  68.   BUGS
  69.     No known bugs.
  70.  
  71.   SEE ALSO
  72.  
  73. ImageDB.mcc/MUIM_ImageDB_GetImage
  74.   NAME
  75.     MUIM_ImageDB_GetImage
  76.  
  77.   SYNOPSIS
  78.     (struct GLImage *) DoMethod(obj,MUIM_ImageDB_GetImage,id)
  79.  
  80.     //--- GetImage
  81.     struct MUIP_ImageDB_GetImage {
  82.         ULONG MethodID;
  83.         char *id;
  84.     };
  85.  
  86.     id  Identification name (key) of the image
  87.  
  88.   FUNCTION
  89.     returns the struct GLImage of the searched image or null when not found.
  90.  
  91.   BUGS
  92.     No known bugs.
  93.  
  94.   SEE ALSO
  95. ImageDB.mcc/MUIM_ImageDB_GetName
  96.   NAME
  97.     MUIM_ImageDB_GetName
  98.  
  99.   SYNOPSIS
  100.     (char *) DoMethod(obj,MUIM_ImageDB_GetName, source)
  101.  
  102.     //--- GetName
  103.     struct MUIP_ImageDB_GetName {
  104.         ULONG MethodID;
  105.         struct GLImage *source;
  106.     };
  107.  
  108.     source  GLImage struct to find name
  109.  
  110.   FUNCTION
  111.     Returns the name of the searched element.
  112.     WARNING, the returned string is for READ ONLY access !!!
  113.  
  114.   BUGS
  115.     No known bugs.
  116.  
  117.   SEE ALSO
  118.  
  119. ImageDB.mcc/MUIM_ImageDB_InitImage
  120.  
  121.   NAME
  122.     MUIM_ImageDB_InitImage  NOT YET IMPLEMENTED
  123.  
  124.   SYNOPSIS
  125.  
  126.   FUNCTION
  127.  
  128.   BUGS
  129.     No known bugs.
  130.  
  131.   SEE ALSO
  132.  
  133. ImageDB.mcc/MUIM_ImageDB_LoadImage
  134.  
  135.   NAME
  136.     MUIM_ImageDB_LoadImage
  137.  
  138.   SYSNOPSIS
  139.     (struct GLImage *) DoMethod(obj,MUIM_ImageDB_LoadImage, filename, id, width, height, flipxy);
  140.  
  141.     //--- LoadImage
  142.     struct MUIP_ImageDB_LoadImage {
  143.         ULONG MethodID;
  144.         char *filename;
  145.         char *id;
  146.         int width;
  147.         int height;
  148.         int flipxy;
  149.     };
  150.  
  151.     filename    filename path to the image
  152.  
  153.     id          Associative id (key) for this image
  154.  
  155.                 If the id already exist, the old image will be deleted and the new
  156.                 one will be inserted.
  157.  
  158.     width       The width wanted for the image
  159.                 Special values:
  160.                     MUIV_ImageDB_Scale_Default for the default image width
  161.  
  162.     height      The height wanted for the image
  163.                 Special values:
  164.                     MUIV_ImageDB_Scale_Default for the default image height
  165.  
  166.     flipxy      If you want to flip the image
  167.                     MUIF_ImageDB_FlipX
  168.                     MUIF_ImageDB_FlipY
  169.                 OpenGL (StormMesa) needs the imageformat with the origin at the bottom left
  170.                 (and not top left), so it's necessary to flip it in Y if you want to use
  171.                 this image for texture mapping.
  172.  
  173.  
  174.   FUNCTION
  175.     Load a picture via guigfx.library and decode it to obtain a format used by StormMesa.
  176.     The returned value is a pointer to a struct GLImage.
  177.  
  178.     struct GLImage {
  179.         int width;
  180.         int height;
  181.         int format;
  182.         UBYTE *image;   // width * height * 3
  183.         APTR picture;   // guigfx picture pointer
  184.     };
  185.  
  186.     The image data is in format GL_RGB and type GL_UNSIGNED_BYTE
  187.  
  188.   BUGS
  189.     Actually (V 0.9) the image is composed of three component (RGB).
  190.  
  191.   SEE ALSO
  192. ImageDB.mcc/MUIM_ImageDB_RemoveImage
  193.   NAME
  194.     MUIM_ImageDB_RemoveImage
  195.  
  196.   SYNOPSIS
  197.     (struct GLImage *) DoMethod(obj,MUIM_ImageDB_RemoveImage, source);
  198.  
  199.     //--- RemoveImage ---
  200.     struct MUIP_ImageDB_RemoveImage {
  201.         ULONG MethodID;
  202.         char *source;
  203.     };
  204.  
  205.     source  Key of the image to be removed
  206.  
  207.   FUNCTION
  208.     Remove the image from database (without removing it from memory) so you could use
  209.     it as you want. You have to free the memory allocation yourself.
  210.  
  211.     The image was allocated with AllocVec, so you have to use FreeVec to release it.
  212.     The picture as to be released with guigfx.library/DeletePicture
  213.  
  214. ImageDB.mcc/MUIM_ImageDB_ScaleImage
  215.   NAME
  216.     MUIM_ImageDB_ScaleImage
  217.  
  218.   SYNOPSIS
  219.     (struct GLImage *) DoMethod(obj,MUIM_ImageDB_ScaleImage, source, newid, width, height, flipxy);
  220.  
  221.     //--- ScaleImage
  222.     struct MUIP_ImageDB_ScaleImage {
  223.         ULONG MethodID;
  224.         char *source;
  225.         char *newid;
  226.         int width;
  227.         int height;
  228.         int flipxy;
  229.     };
  230.  
  231.   source    source image name
  232.  
  233.   newid     id (key) of the new Images
  234.  
  235.             if the id already exist, the old image will be overwritten
  236.  
  237.   width,height  Width an height of the scaled images
  238.  
  239.   flipxy    Flip the scaled image
  240.             MUIF_ImageDB_FlipX
  241.             MUIF_ImageDB_FlipY
  242.  
  243.   FUNCTION
  244.     Rescale an image to the defined size.
  245.  
  246.  
  247.  
  248.