Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

/ray/src/lib/pixmap/image.h

Go to the documentation of this file.
00001 #ifndef _PIXMAP_IMAGE_H_
00002 #define _PIXMAP_IMAGE_H_ 1
00003 
00011 #include <lib/sconfig.h>    /* MUST be first */
00012 #include <lib/tl/refnode.h>
00013 #include <lib/pixmap/format.h>
00014 
00015 #include <lib/tl/linkedlist.h>
00016 
00017 
00030 class _IPixmapImage : InternalRefNodeBase_ThreadSave
00031 {
00032     public:
00033         // Internally used as tile description. 
00034         // The linked list is held by us for LRU queuing
00035         #error go on
00036         struct Tile : LinkedListBase<Tile>, PixmapImageTile
00037         {
00038             public:
00039                 Tile() : LinkedListBase<Tile>(),PixmapImageTile() {}
00040                 ~Tile() {}
00041         };
00042         
00043     private:
00044         PixmapFormat pfmt;  // image format or None
00045         uint w,h;           // size of the image in pixels
00046     
00047     public:
00048         // Set up an empty image: 
00049         _IPixmapImage();
00050         // Set up an image with passed size and format. 
00051         _IPixmapImage(const PixmapFormat &pf,uint width,uint height);
00052         // Destroy image freeing all data. 
00053         ~_IPixmapImage();
00054         
00055         // Get image size and format: 
00056         inline uint width() const   {  return(width);   }
00057         inline uint height() const  {  return(height);  }
00058         inline const PixmapFormat &format() const  {  return(pfmt);  }
00059         
00060         // Get and set single pixel values. 
00061         // See PixmapImageTile's getpixel and putpixel functions for more 
00062         // information. 
00063         inline void GetPixel8(uint x,uint y,uint8 *p) const
00064         inline void PutPixel8(uint x,uint y,const uint8 *p)
00065         inline void GetPixel16(uint x,uint y,uint16 *p) const
00066         inline void PutPixel16(uint x,uint y,const uint16 *p)
00067         
00068         // Like above but using flt values. 
00069         // If the image is stored as flt values (see FloatBits in 
00070         // PixmapFormat), the raw flt values are returned. 
00071         // If the image is stored as integer values, the values are 
00072         // scaled to the flt range 0..1 (inclusive both "borders"). 
00073         inline void GetPixelF(uint x,uint y,flt *p) const
00074         inline void PutPixelF(uint x,uint y,const flt *p)
00075         
00076 };
00077 
00078 // This class stores a single pixmap. 
00079 // The class is "C++-safe" an uses reference counting. 
00080 // For available member functions, see _IPixmapImage above. 
00081 typedef RefNode<_IPixmapImage> PixmapImage;
00082 
00083 #endif  /* _PIXMAP_IMAGE_H_ */

Generated on Sat Feb 19 22:33:46 2005 for Ray by doxygen 1.3.5