A class representing a colour specification that is representable on a specific PCanvas.
![]() | PRealColour ( PCanvas & canvas, const PColour & colour ) Create a colour as close to the specified colour that is representable on the specified canvas. |
![]() | Clone () const Create a new copy of the real colour. |
![]() | SetRed (BYTE r) Set the red component of the colour. |
![]() | SetGreen (BYTE g) Set the green component of the colour. |
![]() | SetBlue (BYTE b) Set the blue component of the colour. |
![]() | SetAlpha (BYTE a) Set the alpha channel component of the colour. |
![]() | Overrides from class PObject |
![]() | Overrides from class PColour |
New functions for class
Run Time Type functions
Comparison functions
I/O functions
Miscellaneous functions
A class representing a colour specification that is representable on a specific PCanvas.A canvas is always associated with a particular
device . This may be the screen as in PInteractorCanvas or a printer as in PPrinterCanvas. A particular device will only be able to render certain colours, eg a screen device may be able to display full 32 bit colours or only 8 bit palettised colours. A printer would typically only be able to render 2 colours, black and white.Thus when a user wishes to render a light shade of pastel pink, as defined by the RGB values in the PColour object, the device, eg a dot matrix colour printer, may only be able to render solid red. The creation of a PRealColour from the canvas and PColour will yield the RGB values 255, 0, and 0 respectively.
A further purpose of a realised colour is to reserve a particular RGB value for use in a palettised device. For example, if an 8 bit screen is used which provides 256 simultaneous colours, the realisation of a colour that is not currently in the palette for the screen, will add a new colour to the palette. If the colour was alreadyt in the palette then a reference count for it is incremented. That specific RGB colour is then reserved until all the relised colours that reference it are destroyed.
Note that the above reservation does not occur if an explicit palette is provided by the user, ie an instance of PPalette is created and attached to the device via the PCanvas::SetPalette() function.
This is not allowed on a real colour and always asserts.
This is not allowed on a real colour and always asserts.
This is not allowed on a real colour and always asserts.
This is not allowed on a real colour and always asserts.
Overrides from class PObject
virtual PObject* Clone() const
Overrides from class PColour
virtual void SetRed(BYTE r)
virtual void SetGreen(BYTE g)
virtual void SetBlue(BYTE b)
virtual void SetAlpha(BYTE a)
Alphabetic index HTML hierarchy of classes or Java