IMAGE.TXT 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. The new versions of CImage and CPal are now on the server and a tlib.cfg file is available.
  2. \\narnia\projects\source\green\image
  3. We have done away with the CPalImage and instead gone with a CImage that may or may not have a CPal. The new CImage as it stands now has several 8, 16, 24, and 32 bit standards but all are 128-bit memory aligned, uncompressed, and stored right side up. Jon mentioned that he will work on making the Blu Display format a standard right-side-up format to finally eliminate the confusion and conversions. Currently the CImage can load from BMP8 or BMP24 files and then be converted from those formats to one of the standard image types. In the future we will probably add CImage::Save and CImage:Load functions that will deal with images in a native format.
  4. Currently there are several standard conversion functions that convert from BMP8 to other 8-bit palette formats as well as 16, 24, and 32 bit buffer formats, and from BMP24 to 16, 24 and 32 bit buffer formats. If you wish to create your own type of image, you may. You can then supply your own conversion function and support the formats that make the most sense. For example, we didn't feel it necessary to be able to convert from BMP24 to an 8-bit palette format because it would be more reasonable for you to load a BMP8 file if you were going to use paletized image formats. There is an array of function pointers to conversion functions that is indexed by the image type, so in order to add support for your new image type, choose a name for your type and add it to the enumerated types, then add a pointer to your conversion function to the array, and add your implementation to imagecon.cpp or to your own file.
  5. Here is a description of the image files
  6. image.h Header file for the CImage class
  7. image.cpp Implementation for CImage class
  8. pal.h Header file for the CPal class Added 10/30/96; broke out of image.h
  9. pal.cpp Implementation for CPal class Added 10/30/96; broke out of image.cpp
  10. imagetyp.h Enumerated types of images Obsoleted 10/30/96; now in image.h,pal.h,image.cpp,pal.cpp
  11. imageafp.h Array of conversion function pointers
  12. imagecon.h Header file with prototypes of conversion functions
  13. imagecon.cpp Implementation of standard image types
  14. Jeff will soon be modifying his blit routines to use the new image format, and I will be modifying the sprite and animation libraries to use both the new image format and the new blit routines.
  15. WARNING: The new image.cpp and image.h have been updated in the source\green\image tlib so if you have old projects that depend on the CPalImage, do not extract the new image library.
  16. --------------------------------------------------------------------------------------
  17. NEW WARNING 5/16/96
  18. --------------------------------------------------------------------------------------
  19. Upon Jeff's request for some additional fields in the standard image, we have
  20. added lBufferWidth, lBufferHeight, lXPos, lYPos so that an image can be positioned
  21. within a larger buffer. I also added a ulDestination type so that an image can
  22. be saved in one format and converted to the desired format on load. This may be
  23. handy if you want to save the file in a compressed format to save disk space, but
  24. when loaded, you want to decompress it into a sprite or background format.
  25. The warning is that since the header information of the CImage has changed, any
  26. files that were saved using CImage::Save will not load. The load function will
  27. tell you that it cannot load this version of the file. Also, any libraries such
  28. as that use CImage should be updated wiht the new image to avoid conflicts between
  29. the two different headers. This was the problem I ran into when I was using the
  30. new CImage and a version of the Blit library that was compiled using the old CImage.
  31. Bill