class PPixels1: public PPixelBase

A 1 bit per pixel image.

Inheritance:


Public Methods

[more]virtual Comparison Compare ( const PObject & obj ) const
Determine if the two picture images are the same.
[more]virtual BOOL Write ( PFile & dwg )
Save the picture drawing into the specified file in platform specific format.
[more] PPixelImage (PPixelBase * obj = NULL)
Create a pixel image container.
[more] PPixelImage ( PDIMENSION dx, PDIMENSION dy, BYTE depth )
Create a new, blank pixmap or the specified dimensions.
[more] PPixelImage ( PRESOURCE_ID resID )
Create a pixel image, reading it from the applications resources.
[more] PPixelImage ( istream & stream )
Create a pixel image, reading the picture from the file in standard platform specific format.
[more] ~PPixelBase ()
Delete the pixel bitmap and its internal memory storage.
[more]virtual Comparison Compare ( const PObject & obj ) const
Determine if the two pixel images are the same.
[more]virtual BOOL Write ( PFile & dwg )
Write the picture drawing into the specified file in platform specific format.
[more]PPixelDataPtr GetPixelDataPtr () const
Get the memory storage pointer for the raw pixel data.
[more]PPixelDataPtr GetRasterDataPtr (PORDINATE y) const
Get a pointer to the raw pixel data for the raster line.
[more]BOOL IsFullColour () const
Determine if the pixel image can display full RGB colours.
[more]BYTE GetDepth () const
Determine the depth (number of bits per pixel) of the bitmap image.
[more]PPalette GetPalette () const
Get the palette associated with the pixel image.
[more]void SetPalette ( const PPalette & pal )
Set the palette associated with the pixel map.
[more]virtual void SetPixelColour ( PORDINATE x, PORDINATE y, const PColour& colour )
Set the pixel at the location specified to the particular colour.
[more]virtual PColour GetPixelColour ( PORDINATE x, PORDINATE y ) const
Get the colour of the pixel at the specified location.
[more]virtual void SetPixel ( PORDINATE x, PORDINATE y, BYTE value )
Set the pixel at the location to the specified value.
[more]virtual BYTE GetPixel ( PORDINATE x, PORDINATE y ) const
Get the pixel at the location.
[more]void SetRaster ( PORDINATE y, const PColourArray & rasterColours, PDIMENSION width = P_MAX_INDEX )
Set the pixels for the whole or part of the raster line.
[more]void GetRaster ( PORDINATE y, PColourArray & rasterColours, PDIMENSION width = P_MAX_INDEX ) const
Get the pixels for the whole or part of the raster line.
[more]PPixelImage ExtractPixels ( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height ) const
Extract a section of pixels out of the image.
[more]const PRect& GetDirtyArea () const
Get the dirty area for the pixel image.
[more]void SetDirtyArea ( PORDINATE x, PORDINATE y, PDIMENSION width = 1 )
Expand the dirty area to include the specified pixels.
[more] PPixels1 ( PDIMENSION dx, PDIMENSION dy )
Create a 1 bit per pixel image.
[more]virtual void SetPixel ( PORDINATE x, PORDINATE y, BYTE value )
Set the pixel at the location to the specified value.
[more]virtual BYTE GetPixel ( PORDINATE x, PORDINATE y ) const
Get the pixel at the location.

Public

[more] Overrides from class PObject
[more] Overrides from class PImage
[more] Overrides from class PObject
[more] Overrides from class PImage
[more] New functions for class
[more] Overrides from class PPixelBase

Protected Fields

[more]PPalette palette
Colour look up table
[more]PPixelDataPtr pixels
Memory block for pixel data
[more]PINDEX pixelLineBytes
Width of a scan line in pixel data in bytes
[more]PRect dirtyArea
Area of pix map that was changed

Protected Methods

[more]PPixelDataPtr CalculateRaster ( PORDINATE x, PORDINATE y, PDIMENSION & widthToLastX ) const
Calculate the address of the byte that contains the specified pixel in the raster line in the pixel image.
[more]virtual void SetRasterColours ( PORDINATE x, PORDINATE y, const PColourArray & rasterColours, PDIMENSION width )
Set the colours of a raster line in the pixel image.
[more]virtual void GetRasterColours ( PORDINATE x, PORDINATE y, PColourArray & rasterColours, PDIMENSION width ) const
Get the colours of a raster line in the pixel image.
[more]virtual void SetRasterValues ( PORDINATE x, PORDINATE y, const BYTE * raster, PDIMENSION width )
Set the colours of a raster line in the pixel image.
[more]virtual void GetRasterValues ( PORDINATE x, PORDINATE y, BYTE * raster, PDIMENSION width ) const
Get the colours of a raster line in the pixel image.
[more]virtual void SetRasterValues ( PORDINATE x, PORDINATE y, const BYTE * raster, PDIMENSION width )
Set the colours of a raster line in the pixel image.
[more]virtual void GetRasterValues ( PORDINATE x, PORDINATE y, BYTE * raster, PDIMENSION width ) const
Get the colours of a raster line in the pixel image.

Protected

[more] Clear the dirty area for the pixel image.


Documentation

A 1 bit per pixel image. This is a non true colour rendition of the image with 1 bit ber pixel allowing 2 colours to be represented. The palette is mandatory with pixel images of this class.
o Overrides from class PObject

ovirtual Comparison Compare( const PObject & obj ) const
Determine if the two picture images are the same. Note that this is different from having two picture images that merely look the same. They must be references to the same picture image file or if loaded from resources, the same resource ID.

Returns:
EqualTo if reference the same picture image, GreaterThan if different.
Parameters:
obj - Another picture image to compare against.

o Overrides from class PImage

ovirtual BOOL Write( PFile & dwg )
Save the picture drawing into the specified file in platform specific format. For example, under MS-Windows this would write a ".WMF" file format.
Parameters:
dwg - File to write the picture image to.

o PPixelImage(PPixelBase * obj = NULL)
Create a pixel image container.

Access to this image will assert.

o PPixelImage( PDIMENSION dx, PDIMENSION dy, BYTE depth )
Create a new, blank pixmap or the specified dimensions. The pixel image may then be drawn into via a PMemoryCanvas instance.
Parameters:
dx - Width of image in pixels.
dy - Height of image in pixels.
depth - Depth of image in bits per pixel.

o PPixelImage( PRESOURCE_ID resID )
Create a pixel image, reading it from the applications resources. This would typically be created by the PWRC program IMAGE keyword.
Parameters:
resID - Unique identifier for pixel image resource.

o PPixelImage( istream & stream )
Create a pixel image, reading the picture from the file in standard platform specific format. For example under MS-Windows this would read a ".BMP" file.
Parameters:
stream - Stream to read pixel image from.

o ~PPixelBase()
Delete the pixel bitmap and its internal memory storage.

o Overrides from class PObject

ovirtual Comparison Compare( const PObject & obj ) const
Determine if the two pixel images are the same. Note that this is different from having two pixel images that merely look the same. They must be references to the same pixel image file or if loaded from resources, the same resource ID.

Returns:
EqualTo if reference the same pixel image, GreaterThan if different.
Parameters:
obj - Another pixel image to compare against.

o Overrides from class PImage

ovirtual BOOL Write( PFile & dwg )
Write the picture drawing into the specified file in platform specific format. For example under MS-Windows this would read a ".BMP" file.
Parameters:
dwg - File to write the pixel image to.

o New functions for class

oPPixelDataPtr GetPixelDataPtr() const
Get the memory storage pointer for the raw pixel data. This is not generally useful to a platform independent application as the exact format of the pixels in the memory block is platform specific.

The normal use of this function is to check that a memory block was successfully allocated on systems for which memory is a limited resource.

Returns:
pointer to a memory block.

oPPixelDataPtr GetRasterDataPtr(PORDINATE y) const
Get a pointer to the raw pixel data for the raster line. This is not generally useful to a platform independent application as the exact format of the pixels in the memory block is platform specific.

An application that requires special processing of the data and takes responsibility for all of the pixel depth detection etc could use this function. For example if only 8 bit images are used the pixel packing into the raster is very uniform across platforms and high levels of optimisation could be made.

It is recommended that the GetRaster() and SetRaster() function be used instead of this function.

Note that this function should be used instead of the GetPixelDataPtr() function as the order of the raster lines is platform dependent. That is:

GetRaster(0) != GetPixelDataPtr()

may be TRUE.

Returns:
pointer to memory block at start of raster line.

oBOOL IsFullColour() const
Determine if the pixel image can display full RGB colours. Essentially this means the image has a depth greater than 24 bits per pixel.

Returns TRUE if true colour pixel image.

oBYTE GetDepth() const
Determine the depth (number of bits per pixel) of the bitmap image. The descendent class determines this value even tough it is stored as a member variable. That variable should not be changed.

Returns:
bits per pixel for image.

oPPalette GetPalette() const
Get the palette associated with the pixel image.

For non true colour pixel images, this determines the correspondence between the pixel values and the RGB colours they represent. For true colour images this is only used as a hint to the destination device about the best colours to use, assuming the destination device is not a true colour display itself.

Returns:
palette used for image.

ovoid SetPalette( const PPalette & pal )
Set the palette associated with the pixel map.

For non true colour pixel images, this determines the correspondence between the pixel values and the RGB colours they represent. For true colour images this is only used as a hint to the destination device about the best colours to use, assuming the destination device is not a true colour display itself.

Note changing the palette for an existing image can have very strange effects as the pixel values themselves do not change.

Parameters:
pal - New palette for pixel image.

ovirtual void SetPixelColour( PORDINATE x, PORDINATE y, const PColour& colour )
Set the pixel at the location specified to the particular colour. For true colour images the pixel is set to that colour. For non true colour images the pixel is set to the nearest colour contained in the palette.
Parameters:
x - Horizontal position of pixel in raster.
y - Vertical raster line.
colour - Colour to set pixel to.

ovirtual PColour GetPixelColour( PORDINATE x, PORDINATE y ) const
Get the colour of the pixel at the specified location. For non true colour images this is the colour in the palette at the index determined by the pixel value.

Returns:
colour for the pixel.
Parameters:
x - Horizontal position of pixel in raster.
y - Vertical raster line.

ovirtual void SetPixel( PORDINATE x, PORDINATE y, BYTE value )
Set the pixel at the location to the specified value. If the image is true colour then the it will set a grey scale value for the pixel. For non true colour images this sets the colour of the pixel to that in the palette at the index position.
Parameters:
x - Horizontal position of pixel in raster.
y - Vertical raster line.
value - New value for pixel.

ovirtual BYTE GetPixel( PORDINATE x, PORDINATE y ) const
Get the pixel at the location. If the image is true colour then it returns the luminance for the pixel colour. If a non true colour image then this returns the index into the palette that the pixel value represents.

Returns:
current value of pixel.
Parameters:
x - Horizontal position of pixel in raster.
y - Vertical raster line.

ovoid SetRaster( PORDINATE y, const PColourArray & rasterColours, PDIMENSION width = P_MAX_INDEX )
Set the pixels for the whole or part of the raster line. Note this expects the data to be unpacked (one pixel per byte) and packages it into the correct internal representation used by the platform.

This is functionally equivalent to repeated calls to the SetPixelColour() or SetPixel() functions but is optimised for each image depth and platform.

Parameters:
y - Vertical raster line.
rasterColours - Array of colours for pixels.
width - Number of pixels in raster to set

ovoid GetRaster( PORDINATE y, PColourArray & rasterColours, PDIMENSION width = P_MAX_INDEX ) const
Get the pixels for the whole or part of the raster line. Note this provides the data unpacked (one pixel per byte) from the correct internal representation used by the platform.

This is functionally equivalent to repeated calls to the SetPixelColour() or SetPixel() functions but is optimised for each image depth and platform.

Parameters:
y - Vertical raster line.
rasterColours - Array of colours for pixels.
width - Number of pixels in raster to get.

oPPixelImage ExtractPixels( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height ) const
Extract a section of pixels out of the image. The new image is of the same depth as the current image but has dimensions the size of the section extracted.

Returns:
new pixel image of section of current image.
Parameters:
x - Horizontal position of start pixel in raster.
y - Vertical raster line.
width - Horizontal width of the section of image to extract.
height - Vertical height of the section of image to extract.

oconst PRect& GetDirtyArea() const
Get the dirty area for the pixel image.

The dirty area is set by calls to the SetPixelColour(), SetPixel() and SetRaster() functions. This can be used to optimise processing by easily determining how much of image has been changed. The dirty area continues to increase in size until the ClearDirtyArea() function is called.

o Clear the dirty area for the pixel image.
Clear the dirty area for the pixel image.

The dirty area is set by calls to the SetPixelColour(), SetPixel() and SetRaster() functions. This can be used to optimise processing by easily determining how much of image has been changed. The dirty area continues to increase in size until the ClearDirtyArea() function is called.

ovoid SetDirtyArea( PORDINATE x, PORDINATE y, PDIMENSION width = 1 )
Expand the dirty area to include the specified pixels.
Parameters:
x - Horizontal position of start pixel in raster.
y - Vertical raster line.
width - Number of pixels to set as "dirty".

oPPixelDataPtr CalculateRaster( PORDINATE x, PORDINATE y, PDIMENSION & widthToLastX ) const
Calculate the address of the byte that contains the specified pixel in the raster line in the pixel image.

Returns:
pointer to the position in the raster line.
Parameters:
x - Horizontal position of start pixel in raster.
y - Vertical raster line.
widthToLastX - Width value to convert to a last X value. This is a number of pixels provided by the calling function that is altered to a horizontal pixel number. This is assured to be within the bounds of raster line.

ovirtual void SetRasterColours( PORDINATE x, PORDINATE y, const PColourArray & rasterColours, PDIMENSION width )
Set the colours of a raster line in the pixel image. This is the polymorphic form of the SetRaster() functions.
Parameters:
x - Horizontal position of start pixel in raster.
y - Vertical raster line.
rasterColours - Array of colours for pixels.
width - Number of pixels in raster to set

ovirtual void GetRasterColours( PORDINATE x, PORDINATE y, PColourArray & rasterColours, PDIMENSION width ) const
Get the colours of a raster line in the pixel image. This is the polymorphic form of the GetRaster() functions.
Parameters:
x - Horizontal position of start pixel in raster.
y - Vertical raster line.
rasterColours - Array of colours for pixels.
width - Number of pixels in raster to get.

ovirtual void SetRasterValues( PORDINATE x, PORDINATE y, const BYTE * raster, PDIMENSION width )
Set the colours of a raster line in the pixel image. This is the polymorphic form of the SetRaster() functions.
Parameters:
x - Horizontal position of start pixel in raster.
y - Vertical raster line.
raster - Pointer to array of values for pixels.
width - Number of pixels in raster to set.

ovirtual void GetRasterValues( PORDINATE x, PORDINATE y, BYTE * raster, PDIMENSION width ) const
Get the colours of a raster line in the pixel image. This is the polymorphic form of the GetRaster() functions.
Parameters:
x - Horizontal position of start pixel in raster.
y - Vertical raster line.
raster - Pointer to array of values for pixels.
width - Number of pixels in raster to get.

oPPalette palette
Colour look up table

oPPixelDataPtr pixels
Memory block for pixel data

oPINDEX pixelLineBytes
Width of a scan line in pixel data in bytes

oPRect dirtyArea
Area of pix map that was changed

o PPixels1( PDIMENSION dx, PDIMENSION dy )
Create a 1 bit per pixel image.
Parameters:
dx - Width of image in pixels.
dy - Height of image in pixels.

o Overrides from class PPixelBase

ovirtual void SetPixel( PORDINATE x, PORDINATE y, BYTE value )
Set the pixel at the location to the specified value. This sets the colour of the pixel to that in the palette at the index position.
Parameters:
x - Horizontal position of pixel in raster.
y - Vertical raster line.
value - New value for pixel.

ovirtual BYTE GetPixel( PORDINATE x, PORDINATE y ) const
Get the pixel at the location. This returns the index into the palette that the pixel value represents.

Returns:
current value of pixel.
Parameters:
x - Horizontal position of pixel in raster.
y - Vertical raster line.

ovirtual void SetRasterValues( PORDINATE x, PORDINATE y, const BYTE * raster, PDIMENSION width )
Set the colours of a raster line in the pixel image. This is the polymorphic form of the SetRaster() functions.
Parameters:
x - Horizontal position of start pixel in raster.
y - Vertical raster line.
raster - Pointer to array of values for pixels.
width - Number of pixels in raster to set.

ovirtual void GetRasterValues( PORDINATE x, PORDINATE y, BYTE * raster, PDIMENSION width ) const
Get the colours of a raster line in the pixel image. This is the polymorphic form of the GetRaster() functions.
Parameters:
x - Horizontal position of start pixel in raster.
y - Vertical raster line.
raster - Pointer to array of values for pixels.
width - Number of pixels in raster to get.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.