Fixed crash in heavily loaded multi-threaded systems using simultaneous sorted
[pwlib.git] / include / pwlib / pixels2.h
blob722a8c8122cee5ec1f45e2fb117063b739b37ca8
1 /*
2 * pixels2.h
4 * 2 bit pixel image.
6 * Portable Windows Library
8 * Copyright (c) 1993-1998 Equivalence Pty. Ltd.
10 * The contents of this file are subject to the Mozilla Public License
11 * Version 1.0 (the "License"); you may not use this file except in
12 * compliance with the License. You may obtain a copy of the License at
13 * http://www.mozilla.org/MPL/
15 * Software distributed under the License is distributed on an "AS IS"
16 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17 * the License for the specific language governing rights and limitations
18 * under the License.
20 * The Original Code is Portable Windows Library.
22 * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
24 * Portions are Copyright (C) 1993 Free Software Foundation, Inc.
25 * All Rights Reserved.
27 * Contributor(s): ______________________________________.
29 * $Log$
30 * Revision 1.10 2001/05/22 12:49:33 robertj
31 * Did some seriously wierd rewrite of platform headers to eliminate the
32 * stupid GNU compiler warning about braces not matching.
34 * Revision 1.9 1999/03/10 03:49:52 robertj
35 * More documentation adjustments.
37 * Revision 1.8 1999/03/09 08:01:49 robertj
38 * Changed comments for doc++ support (more to come).
40 * Revision 1.7 1999/02/16 08:08:46 robertj
41 * MSVC 6.0 compatibility changes.
43 * Revision 1.6 1998/09/23 06:28:03 robertj
44 * Added open source copyright license.
46 * Revision 1.5 1995/03/14 12:42:06 robertj
47 * Updated documentation to use HTML codes.
49 * Revision 1.4 1995/01/09 12:39:06 robertj
50 * Documentation.
52 * Revision 1.3 1994/12/12 10:07:09 robertj
53 * Made depth member of PPixels and removed virtual function.
55 * Revision 1.2 1994/12/05 11:34:15 robertj
56 * Major rewrite of images, pictures and pixmaps.
57 * Renamed PPict, PPixels and PImage to make sure all uses are found.
59 * Revision 1.1 1994/10/23 04:52:09 robertj
60 * Initial revision
65 #define _PPIXELS2
67 #ifdef __GNUC__
68 #pragma interface
69 #endif
72 ///////////////////////////////////////////////////////////////////////////////
73 // PPixels2
75 /**A 2 bit per pixel image. This is a non true colour rendition of the image
76 with 2 bits ber pixel allowing 4 colours to be represented. The palette
77 is mandatory with pixel images of this class.
79 class PPixels2 : public PPixelBase
81 PCLASSINFO(PPixels2, PPixelBase);
83 public:
84 /** Create a 2 bit per pixel image. */
85 PPixels2(
86 PDIMENSION dx, /// Width of image in pixels.
87 PDIMENSION dy /// Height of image in pixels.
91 /**@name Overrides from class PPixelBase */
92 /**Set the pixel at the location to the specified value. This sets the
93 colour of the pixel to that in the palette at the index position.
95 virtual void SetPixel(
96 PORDINATE x, /// Horizontal position of pixel in raster.
97 PORDINATE y, /// Vertical raster line.
98 BYTE value /// New value for pixel.
101 /**Get the pixel at the location. This returns the index into the palette
102 that the pixel value represents.
104 @return
105 current value of pixel.
107 virtual BYTE GetPixel(
108 PORDINATE x, /// Horizontal position of pixel in raster.
109 PORDINATE y /// Vertical raster line.
110 ) const;
113 protected:
114 /**Set the colours of a raster line in the pixel image. This is the
115 polymorphic form of the $B$SetRaster()$B$ functions.
117 virtual void SetRasterValues(
118 PORDINATE x, /// Horizontal position of start pixel in raster.
119 PORDINATE y, /// Vertical raster line.
120 const BYTE * raster, /// Pointer to array of values for pixels.
121 PDIMENSION width /// Number of pixels in raster to set.
124 /**Get the colours of a raster line in the pixel image. This is the
125 polymorphic form of the $B$GetRaster()$B$ functions.
127 virtual void GetRasterValues(
128 PORDINATE x, /// Horizontal position of start pixel in raster.
129 PORDINATE y, /// Vertical raster line.
130 BYTE * raster, /// Pointer to array of values for pixels.
131 PDIMENSION width /// Number of pixels in raster to get.
132 ) const;
135 // Include platform dependent part of class
136 #include <pwlib/pixels2.h>
140 // End Of File ///////////////////////////////////////////////////////////////