pixels32.h
上传用户:hzhsqp
上传日期:2007-01-06
资源大小:1600k
文件大小:6k
- /*
- * pixels32.h
- *
- * 32 bit pixel image.
- *
- * Portable Windows Library
- *
- * Copyright (c) 1993-1998 Equivalence Pty. Ltd.
- *
- * The contents of this file are subject to the Mozilla Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- *
- * The Original Code is Portable Windows Library.
- *
- * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
- *
- * Portions are Copyright (C) 1993 Free Software Foundation, Inc.
- * All Rights Reserved.
- *
- * Contributor(s): ______________________________________.
- *
- * $Log: pixels32.h,v $
- * Revision 1.10 1999/03/10 03:49:52 robertj
- * More documentation adjustments.
- *
- * Revision 1.9 1999/03/09 08:01:49 robertj
- * Changed comments for doc++ support (more to come).
- *
- * Revision 1.8 1999/02/16 08:08:46 robertj
- * MSVC 6.0 compatibility changes.
- *
- * Revision 1.7 1998/09/23 06:28:05 robertj
- * Added open source copyright license.
- *
- * Revision 1.6 1995/06/17 11:12:58 robertj
- * Documentation update.
- *
- * Revision 1.5 1995/03/14 12:42:08 robertj
- * Updated documentation to use HTML codes.
- *
- * Revision 1.4 1995/01/09 12:39:11 robertj
- * Documentation.
- *
- * Revision 1.3 1994/12/12 10:07:11 robertj
- * Made depth member of PPixels and removed virtual function.
- *
- * Revision 1.2 1994/12/05 11:34:17 robertj
- * Major rewrite of images, pictures and pixmaps.
- * Renamed PPict, PPixels and PImage to make sure all uses are found.
- *
- * Revision 1.1 1994/10/23 04:52:14 robertj
- * Initial revision
- *
- */
- #define _PPIXELS32
- #ifdef __GNUC__
- #pragma interface
- #endif
- ///////////////////////////////////////////////////////////////////////////////
- // PPixels32
- /**A 32 bit per pixel image. This is a true colour rendition of the image with
- 8 bits ber red, green, blue and transparency components.
- */
- class PPixels32 : public PPixelBase
- {
- PCLASSINFO(PPixels32, PPixelBase);
- public:
- /** Create a 32 bit per pixel image. */
- PPixels32(
- PDIMENSION dx, /// Width of image in pixels.
- PDIMENSION dy /// Height of image in pixels.
- );
- /**@name Overrides from class PPixelBase */
- /**Set the pixel at the location specified to the particular colour.
- */
- virtual void SetPixelColour(
- PORDINATE x, /// Horizontal position of pixel in raster.
- PORDINATE y, /// Vertical raster line.
- const PColour& colour /// Colour to set pixel to.
- );
- /**Get the colour of the pixel at the specified location.
- @return
- colour for the pixel.
- */
- virtual PColour GetPixelColour(
- PORDINATE x, /// Horizontal position of pixel in raster.
- PORDINATE y /// Vertical raster line.
- ) const;
- /**Set the pixel at the location to the specified value. This will set a
- grey scale value for the pixel.
- */
- virtual void SetPixel(
- PORDINATE x, /// Horizontal position of pixel in raster.
- PORDINATE y, /// Vertical raster line.
- BYTE value /// New value for pixel.
- );
- /**Get the pixel at the location. This returns the luminance for the pixel
- colour.
-
- @return
- current value of pixel.
- */
- virtual BYTE GetPixel(
- PORDINATE x, /// Horizontal position of pixel in raster.
- PORDINATE y /// Vertical raster line.
- ) const;
- protected:
- /**Set the colours of a raster line in the pixel image. This is the
- polymorphic form of the Ref{SetRaster()} functions.
- */
- virtual void SetRasterColours(
- PORDINATE x, /// Horizontal position of start pixel in raster.
- PORDINATE y, /// Vertical raster line.
- const PColourArray & rasterColours, /// Array of colours for pixels.
- PDIMENSION width /// Number of pixels in raster to set
- );
- /**Get the colours of a raster line in the pixel image. This is the
- polymorphic form of the Ref{GetRaster()} functions.
- */
- virtual void GetRasterColours(
- PORDINATE x, /// Horizontal position of start pixel in raster.
- PORDINATE y, /// Vertical raster line.
- PColourArray & rasterColours, /// Array of colours for pixels.
- PDIMENSION width /// Number of pixels in raster to get.
- ) const;
- /**Set the colours of a raster line in the pixel image. This is the
- polymorphic form of the Ref{SetRaster()} functions.
- */
- virtual void SetRasterValues(
- PORDINATE x, /// Horizontal position of start pixel in raster.
- PORDINATE y, /// Vertical raster line.
- const BYTE * raster, /// Pointer to array of values for pixels.
- PDIMENSION width /// Number of pixels in raster to set.
- );
- /**Get the colours of a raster line in the pixel image. This is the
- polymorphic form of the Ref{GetRaster()} functions.
- */
- virtual void GetRasterValues(
- PORDINATE x, /// Horizontal position of start pixel in raster.
- PORDINATE y, /// Vertical raster line.
- BYTE * raster, /// Pointer to array of values for pixels.
- PDIMENSION width /// Number of pixels in raster to get.
- ) const;
- #ifdef DOC_PLUS_PLUS
- };
- #endif
- // Class declaration continued in platform specific header file ///////////////