home *** CD-ROM | disk | FTP | other *** search
- TABLE OF CONTENTS
-
- ImageDB.mcc/---Overview---
- ImageDB.mcc/---guigfx.library---
- ImageDB.mcc/MUIA_ImageDB_GuiGFXBase
- ImageDB.mcc/MUIM_ImageDB_DeleteImage
- ImageDB.mcc/MUIM_ImageDB_GetImage
- ImageDB.mcc/MUIM_ImageDB_GetName
- ImageDB.mcc/MUIM_ImageDB_InitImage
- ImageDB.mcc/MUIM_ImageDB_LoadImage
- ImageDB.mcc/MUIM_ImageDB_RemoveImage
- ImageDB.mcc/MUIM_ImageDB_ScaleImage
- ImageDB.mcc/---Overview---
-
- The goal of this class was to implement some kind of "textures" manager
- for StormMesa, so it could be easy to load a texture from a file and use it in the
- StormMesa context. Some kind of Images database is included in ImageDB objects
- for this purpose.
-
- The "textures" will be loaded with the help of an external library: guigfx.library
- from Timm S.Mueller. Guigfx uses datatypes if necessary, so your installed Datatypes
- will be used as an alternative. GuiGFX library could be find on the nearest Aminet.
-
- The ImageDB object will take care of all initialisation and memory allocation for
- the textures/images. The image is then accessible in a way StormMesa could use it.
-
- Warning: ImageDB is not a MUI_Area subclass, you can't use it in GUIs, but better
- as a stand alone MUI object.
-
- ImageDB.mcc/---guigfx.library---
-
- All the texture/images handling uses guigfx.library written by Timm S. Mueller.
- You have ton install this library to use ImageDB.mcc.
-
- For more information look at guigfx doumentation.
-
- ImageDB.mcc/MUIA_ImageDB_GuiGFXBase
-
- NAME
- MUIA_ImageDB_GuiGFXBase -- [..G], BOOL
-
- FUNCTION
- Returns the global base pointer to the guigfx.library.
-
- BUGS
-
- SEE ALSO
-
-
- ImageDB.mcc/MUIM_ImageDB_DeleteImage
- NAME
- MUIM_ImageDB_DeleteImage
-
- SYNOPSIS
- (struct GLImage *) DoMethod(obj,MUIM_ImageDB_DeleteImage,id)
-
- //--- Delete an image
- struct MUIP_ImageDB_DeleteImage {
- ULONG MethodID;
- char *id;
- };
-
- id Identification name (key) of the image to delete
-
- FUNCTION
- Deletes (remove from memory and from database) the specified image.
-
- BUGS
- No known bugs.
-
- SEE ALSO
-
- ImageDB.mcc/MUIM_ImageDB_GetImage
- NAME
- MUIM_ImageDB_GetImage
-
- SYNOPSIS
- (struct GLImage *) DoMethod(obj,MUIM_ImageDB_GetImage,id)
-
- //--- GetImage
- struct MUIP_ImageDB_GetImage {
- ULONG MethodID;
- char *id;
- };
-
- id Identification name (key) of the image
-
- FUNCTION
- returns the struct GLImage of the searched image or null when not found.
-
- BUGS
- No known bugs.
-
- SEE ALSO
- ImageDB.mcc/MUIM_ImageDB_GetName
- NAME
- MUIM_ImageDB_GetName
-
- SYNOPSIS
- (char *) DoMethod(obj,MUIM_ImageDB_GetName, source)
-
- //--- GetName
- struct MUIP_ImageDB_GetName {
- ULONG MethodID;
- struct GLImage *source;
- };
-
- source GLImage struct to find name
-
- FUNCTION
- Returns the name of the searched element.
- WARNING, the returned string is for READ ONLY access !!!
-
- BUGS
- No known bugs.
-
- SEE ALSO
-
- ImageDB.mcc/MUIM_ImageDB_InitImage
-
- NAME
- MUIM_ImageDB_InitImage NOT YET IMPLEMENTED
-
- SYNOPSIS
-
- FUNCTION
-
- BUGS
- No known bugs.
-
- SEE ALSO
-
- ImageDB.mcc/MUIM_ImageDB_LoadImage
-
- NAME
- MUIM_ImageDB_LoadImage
-
- SYSNOPSIS
- (struct GLImage *) DoMethod(obj,MUIM_ImageDB_LoadImage, filename, id, width, height, flipxy);
-
- //--- LoadImage
- struct MUIP_ImageDB_LoadImage {
- ULONG MethodID;
- char *filename;
- char *id;
- int width;
- int height;
- int flipxy;
- };
-
- filename filename path to the image
-
- id Associative id (key) for this image
-
- If the id already exist, the old image will be deleted and the new
- one will be inserted.
-
- width The width wanted for the image
- Special values:
- MUIV_ImageDB_Scale_Default for the default image width
-
- height The height wanted for the image
- Special values:
- MUIV_ImageDB_Scale_Default for the default image height
-
- flipxy If you want to flip the image
- MUIF_ImageDB_FlipX
- MUIF_ImageDB_FlipY
- OpenGL (StormMesa) needs the imageformat with the origin at the bottom left
- (and not top left), so it's necessary to flip it in Y if you want to use
- this image for texture mapping.
-
-
- FUNCTION
- Load a picture via guigfx.library and decode it to obtain a format used by StormMesa.
- The returned value is a pointer to a struct GLImage.
-
- struct GLImage {
- int width;
- int height;
- int format;
- UBYTE *image; // width * height * 3
- APTR picture; // guigfx picture pointer
- };
-
- The image data is in format GL_RGB and type GL_UNSIGNED_BYTE
-
- BUGS
- Actually (V 0.9) the image is composed of three component (RGB).
-
- SEE ALSO
- ImageDB.mcc/MUIM_ImageDB_RemoveImage
- NAME
- MUIM_ImageDB_RemoveImage
-
- SYNOPSIS
- (struct GLImage *) DoMethod(obj,MUIM_ImageDB_RemoveImage, source);
-
- //--- RemoveImage ---
- struct MUIP_ImageDB_RemoveImage {
- ULONG MethodID;
- char *source;
- };
-
- source Key of the image to be removed
-
- FUNCTION
- Remove the image from database (without removing it from memory) so you could use
- it as you want. You have to free the memory allocation yourself.
-
- The image was allocated with AllocVec, so you have to use FreeVec to release it.
- The picture as to be released with guigfx.library/DeletePicture
-
- ImageDB.mcc/MUIM_ImageDB_ScaleImage
- NAME
- MUIM_ImageDB_ScaleImage
-
- SYNOPSIS
- (struct GLImage *) DoMethod(obj,MUIM_ImageDB_ScaleImage, source, newid, width, height, flipxy);
-
- //--- ScaleImage
- struct MUIP_ImageDB_ScaleImage {
- ULONG MethodID;
- char *source;
- char *newid;
- int width;
- int height;
- int flipxy;
- };
-
- source source image name
-
- newid id (key) of the new Images
-
- if the id already exist, the old image will be overwritten
-
- width,height Width an height of the scaled images
-
- flipxy Flip the scaled image
- MUIF_ImageDB_FlipX
- MUIF_ImageDB_FlipY
-
- FUNCTION
- Rescale an image to the defined size.
-
-
-
-