OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::TIdentityPalette Class Reference

An identity palette is a palette where the colors and order of those colors match the physical palette. More...

#include <owl/dibitmap.h>

Inheritance diagram for owl::TIdentityPalette:
owl::TPalette owl::TGdiObject owl::TGdiBase

Public Member Functions

 TIdentityPalette (const TPalette &palette)
 Implementation of Identity Palette object, TIdentityPalette.
 
- Public Member Functions inherited from owl::TPalette
 TPalette (HPALETTE handle, TAutoDelete autoDelete=NoAutoDelete)
 Alias an existing palette handle. Assume ownership if autoDelete says so.
 
 TPalette (const TClipboard &)
 Creates a TPalette object with values taken from the given clipboard.
 
 TPalette (const TPalette &src)
 Deep copy whole palette.
 
 TPalette (const LOGPALETTE &logPalette)
 Creates a TPalette object from the given LOGPALETTE.
 
 TPalette (const PALETTEENTRY *entries, int count)
 Creates a TPalette object with count entries from the given entries array.
 
 TPalette (const BITMAPINFO &info, uint flags=0)
 Win 3.0 DIB hdr.
 
 TPalette (const TDib &dib, uint flags=0)
 DIB object.
 
 TPalette (const tchar *fileName)
 read from file: *.dib,*.bmp,*.pal,*.aco,*.act
 
template<size_t N>
 TPalette (const PALETTEENTRY(&entries)[N])
 Creates a TPalette object with the entries from the given array.
 
HPALETTE GetHandle () const
 Returns the handle of the palette.
 
 operator HPALETTE () const
 Typecasting operator.
 
bool ResizePalette (uint numEntries)
 Changes the size of this logical palette to the number given by numEntries.
 
void AnimatePalette (uint start, uint count, const PALETTEENTRY *entries)
 Animate palette from entry 'start' for 'count' entries.
 
uint SetPaletteEntries (uint16 start, uint16 count, const PALETTEENTRY *entries)
 Sets the RGB color values in this palette from the entries array of PALETTEENTRY structures.
 
uint SetPaletteEntry (uint16 index, const PALETTEENTRY &entry)
 Sets the RGB color value at index in this palette from the entry argument.
 
uint GetPaletteEntries (uint16 start, uint16 count, PALETTEENTRY *entries) const
 Retrieves a range of entries in this logical palette and places them in the entries array.
 
uint GetPaletteEntry (uint16 index, PALETTEENTRY &entry) const
 Retrieves the entry in this logical palette at index and places it in the entries array.
 
uint GetNearestPaletteIndex (const TColor &color) const
 Returns the index of the color entry that represents the closest color in this palette to the given color.
 
bool GetObject (uint16 &numEntries) const
 Finds the number of entries in this logical palette and sets the value in the numEntries argument.
 
uint16 GetNumEntries () const
 Returns the number of entries in this palette, or 0 if the call fails.
 
void ToClipboard (TClipboard &Clipboard)
 Moves this palette to the target Clipboard argument.
 
bool UnrealizeObject ()
 Directs the GDI to completely remap the logical palette to the system palette on the next RealizePalette(HDC) or TDC::RealizePalette call.
 
bool Write (const tchar *fileName)
 Write this palette into file: *.dib,*.bmp,*.pal,*.aco,*.act.
 
- Public Member Functions inherited from owl::TGdiObject
 ~TGdiObject ()
 Decrement the reference count on this object.
 
HGDIOBJ GetGdiHandle () const
 Returns the handle of the GDI object.
 
 operator HGDIOBJ () const
 Typecasting operator that converts this GDI object handle to type HGDIOBJ.
 
int GetObject (int count, void *object) const
 Retrieve the object's attributes into a buffer.
 
bool operator== (const TGdiObject &other) const
 Returns true if the handles are equal. This is a binary compare.
 
bool operator< (const TGdiObject &other) const
 not implemented just to make happy STL
 
bool IsGDIObject () const
 Returns true if this represents a real GDI object.
 
uint32 GetObjectType () const
 Returns the type of the GDI object.
 
auto IsHandleOwner () const -> bool
 Returns true if handle lifetime is managed.
 

Additional Inherited Members

- Public Types inherited from owl::TPalette
typedef HPALETTE THandle
 TPalette encapsulates an HPALETTE.
 
- Public Types inherited from owl::TGdiObject
enum  TType { None , Pen , Brush , Font , Palette , Bitmap , TextBrush }
 This enumeration is used to store the object type in the struct TObjInfo. More...
 
typedef HGDIOBJ THandle
 TGdiObject encapsulates an HGDIOBJ.
 
- Static Public Member Functions inherited from owl::TGdiObject
static TObjInfo * RefFind (HANDLE object)
 Searches for the given object handle.
 
static void RefAdd (HANDLE handle, TType type)
 RefAdd adds a reference entry for the object with the given handle and type.
 
static void RefRemove (HANDLE handle)
 Removes the reference entry to the object with the given handle.
 
static void RefInc (HANDLE handle)
 Increments by 1 the reference count of the object associated with the given handle.
 
static void RefDec (HANDLE handle, bool wantDelete)
 Decrements this object's reference count by 1 and deletes the object when the reference count reaches zero.
 
static int RefCount (HANDLE handle)
 Returns this object's current reference count or -1 if the object is not found.
 
- Protected Member Functions inherited from owl::TPalette
void Create (const BITMAPINFO *info, uint flags)
 Accept a pointer to a BITMAPINFO structure and create a GDI logical palette from the color table which follows it, for 2, 16 and 256 color bitmaps.
 
bool Read (const tchar *fileName)
 Read palette from file.
 
bool Read_PAL (TRiffFile &file)
 Read Microsoft palette from file.
 
bool Write_PAL (TRiffFile &file)
 Write Microsoft palette to file.
 
bool Read_ACO (TRiffFile &file)
 Read Adobe palette from file.
 
bool Write_ACO (TRiffFile &file)
 Write Adobe palette to file.
 
bool Read_ACT (TRiffFile &file)
 Read Adobe palette from file.
 
bool Write_ACT (TRiffFile &file)
 Write Adobe palette to file.
 
bool Read_BMP (TRiffFile &file)
 Read palette from BMP file.
 
bool Write_BMP (TRiffFile &file)
 Write palette to BMP 1x1 file.
 
- Protected Member Functions inherited from owl::TGdiObject
 TGdiObject ()
 This default constructor sets Handle to 0 and ShouldDelete to true.
 
 TGdiObject (HANDLE handle, TAutoDelete autoDelete=NoAutoDelete)
 Create a wrapper for a given GDI object.
 
void CheckValid (uint resId=IDS_GDIFAILURE)
 
- Static Protected Member Functions inherited from owl::TGdiObject
static void _CheckValid (HANDLE handle, uint resId=IDS_GDIFAILURE)
 
- Protected Attributes inherited from owl::TGdiObject
HANDLE Handle
 GDI handle of this object.
 
bool ShouldDelete
 Should object delete GDI handle in dtor?
 

Detailed Description

An identity palette is a palette where the colors and order of those colors match the physical palette.

Use the identity palette whenever possible, because if the system does not have to map colors, it can speed bitmap drawing.

Definition at line 77 of file dibitmap.h.

Constructor & Destructor Documentation

◆ TIdentityPalette()

owl::TIdentityPalette::TIdentityPalette ( const TPalette & palette)

Implementation of Identity Palette object, TIdentityPalette.

Use of an identity palette allows objects to be blitted without having the color mapper come into play. The overall effect is faster graphics. Return an identity palette to be used by bitmaps. This ensures speed and color accuracy.

TH The passed color table should be indexed from the start not from

Definition at line 180 of file dibitmap.cpp.

References owl::TGdiObject::CheckValid(), owl::TGdiObject::Handle, owl::TGdiObject::Palette, owl::TGdiObject::RefAdd(), and owl::TGdiObject::ShouldDelete.


The documentation for this class was generated from the following files: