Added <vector> and <string>
[pwlib.git] / include / pwlib / pixels24.h
blobe77e09c93288a3afd69ada5abb73e24070ca5e2f
1 /*
2 * pixels24.h
4 * 24 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.11 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.10 1999/03/10 03:49:52 robertj
35 * More documentation adjustments.
37 * Revision 1.9 1999/03/09 08:01:49 robertj
38 * Changed comments for doc++ support (more to come).
40 * Revision 1.8 1999/02/16 08:08:46 robertj
41 * MSVC 6.0 compatibility changes.
43 * Revision 1.7 1998/09/23 06:28:04 robertj
44 * Added open source copyright license.
46 * Revision 1.6 1995/06/17 11:12:57 robertj
47 * Documentation update.
49 * Revision 1.5 1995/03/14 12:42:07 robertj
50 * Updated documentation to use HTML codes.
52 * Revision 1.4 1995/01/09 12:39:09 robertj
53 * Documentation.
55 * Revision 1.3 1994/12/12 10:07:10 robertj
56 * Made depth member of PPixels and removed virtual function.
58 * Revision 1.2 1994/12/05 11:34:16 robertj
59 * Major rewrite of images, pictures and pixmaps.
60 * Renamed PPict, PPixels and PImage to make sure all uses are found.
62 * Revision 1.1 1994/10/23 04:52:11 robertj
63 * Initial revision
68 #define _PPIXELS24
70 #ifdef __GNUC__
71 #pragma interface
72 #endif
75 ///////////////////////////////////////////////////////////////////////////////
76 // PPixels24
78 /**A 24 bit per pixel image. This is a true colour rendition of the image with
79 8 bits ber red, green and blue components.
81 class PPixels24 : public PPixelBase
83 PCLASSINFO(PPixels24, PPixelBase);
85 public:
86 /** Create a 24 bit per pixel image. */
87 PPixels24(
88 PDIMENSION dx, /// Width of image in pixels.
89 PDIMENSION dy /// Height of image in pixels.
93 /**@name Overrides from class PPixelBase */
94 /**Set the pixel at the location specified to the particular colour.
96 virtual void SetPixelColour(
97 PORDINATE x, /// Horizontal position of pixel in raster.
98 PORDINATE y, /// Vertical raster line.
99 const PColour& colour /// Colour to set pixel to.
102 /**Get the colour of the pixel at the specified location.
104 @return
105 colour for the pixel.
107 virtual PColour GetPixelColour(
108 PORDINATE x, /// Horizontal position of pixel in raster.
109 PORDINATE y /// Vertical raster line.
110 ) const;
112 /**Set the pixel at the location to the specified value. This will set a
113 grey scale value for the pixel.
115 virtual void SetPixel(
116 PORDINATE x, /// Horizontal position of pixel in raster.
117 PORDINATE y, /// Vertical raster line.
118 BYTE value /// New value for pixel.
121 /**Get the pixel at the location. This returns the luminance for the pixel
122 colour.
124 @return
125 current value of pixel.
127 virtual BYTE GetPixel(
128 PORDINATE x, /// Horizontal position of pixel in raster.
129 PORDINATE y /// Vertical raster line.
130 ) const;
133 protected:
134 /**Set the colours of a raster line in the pixel image. This is the
135 polymorphic form of the \Ref{SetRaster()} functions.
137 virtual void SetRasterColours(
138 PORDINATE x, /// Horizontal position of start pixel in raster.
139 PORDINATE y, /// Vertical raster line.
140 const PColourArray & rasterColours, /// Array of colours for pixels.
141 PDIMENSION width /// Number of pixels in raster to set
144 /**Get the colours of a raster line in the pixel image. This is the
145 polymorphic form of the \Ref{GetRaster()} functions.
147 virtual void GetRasterColours(
148 PORDINATE x, /// Horizontal position of start pixel in raster.
149 PORDINATE y, /// Vertical raster line.
150 PColourArray & rasterColours, /// Array of colours for pixels.
151 PDIMENSION width /// Number of pixels in raster to get.
152 ) const;
154 /**Set the colours of a raster line in the pixel image. This is the
155 polymorphic form of the \Ref{SetRaster()} functions.
157 virtual void SetRasterValues(
158 PORDINATE x, /// Horizontal position of start pixel in raster.
159 PORDINATE y, /// Vertical raster line.
160 const BYTE * raster, /// Pointer to array of values for pixels.
161 PDIMENSION width /// Number of pixels in raster to set.
164 /**Get the colours of a raster line in the pixel image. This is the
165 polymorphic form of the \Ref{GetRaster()} functions.
167 virtual void GetRasterValues(
168 PORDINATE x, /// Horizontal position of start pixel in raster.
169 PORDINATE y, /// Vertical raster line.
170 BYTE * raster, /// Pointer to array of values for pixels.
171 PDIMENSION width /// Number of pixels in raster to get.
172 ) const;
175 // Include platform dependent part of class
176 #include <pwlib/pixels24.h>
180 // End Of File ///////////////////////////////////////////////////////////////