home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / Blitting Class Library / Buffer Accessors / BufferAccessor.h < prev    next >
Encoding:
Text File  |  1995-11-12  |  1.2 KB  |  52 lines  |  [TEXT/CWIE]

  1. // BufferAccessor.h, the BufferAccessor abstract base class, to be used for direct
  2. //    access to GWorld pixel-maps, window pixel-maps, and video pixel-maps.
  3.  
  4. // copyright © 1995, Macneil Shonle. All rights reserved.
  5.  
  6. #ifndef __BUFFERACCESSOR__
  7. #define __BUFFERACCESSOR__    
  8.  
  9. #ifndef __PIXELTYPES__
  10. #include <PixelTypes.h>
  11. #endif
  12.  
  13. #include <new>
  14.  
  15.         // class QuickRowArray
  16. class QuickRowArray {
  17. private:
  18.     friend class BufferAccessor;
  19.     QuickRowArray();
  20.     ~QuickRowArray();
  21.     void setArray(PixelPtr base, RowBytes rowBytes, PixelCord height) throw(xalloc);
  22.     PixelPtr *array;
  23. };
  24.  
  25.         // class BufferAccessor
  26. class BufferAccessor {
  27. public:
  28.     BufferAccessor();
  29.     virtual ~BufferAccessor();
  30.     BufferAccessor& operator=(const BufferAccessor&) throw(xalloc);
  31.     
  32.     PixelPtr baseAddr() const;
  33.     RowBytes rowBytes() const;
  34.     PixelCord height() const;
  35.     PixelCord width() const;
  36.     PixelPtr pixelAddr(PixelCord h, PixelCord v) const;
  37.     PixelPtr rowAddr(PixelCord) const;
  38.     int use32Bit() const;
  39.     
  40.     void setPixel(PixelCord h, PixelCord v, Pixel);
  41.  
  42. protected:
  43.     PixelCord theHeight;
  44.     PixelCord theWidth;
  45.     RowBytes theRowBytes;
  46.     QuickRowArray rowAddrs;
  47.     int mmuMode;
  48.     
  49.     void setArray(PixelPtr base, RowBytes rb, PixelCord high) throw(xalloc);
  50. };
  51.  
  52. #endif