1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2005-10-06 14:37:43 +00:00
|
|
|
// Name: wx/msw/palette.h
|
1998-05-20 14:12:05 +00:00
|
|
|
// Purpose: wxPalette class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
1998-08-07 23:52:45 +00:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-08-31 12:38:46 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 23:52:45 +00:00
|
|
|
#ifndef _WX_PALETTE_H_
|
|
|
|
#define _WX_PALETTE_H_
|
1998-05-20 14:12:05 +00:00
|
|
|
|
|
|
|
#include "wx/gdiobj.h"
|
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxPalette : public wxPaletteBase
|
1998-05-20 14:12:05 +00:00
|
|
|
{
|
|
|
|
public:
|
2007-12-15 17:54:20 +00:00
|
|
|
wxPalette() { }
|
|
|
|
wxPalette(int n,
|
2011-12-17 23:52:47 +00:00
|
|
|
const unsigned char *red, const unsigned char *green, const unsigned char *blue)
|
2007-12-15 17:54:20 +00:00
|
|
|
{
|
|
|
|
Create(n, red, green, blue);
|
|
|
|
}
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2007-12-15 17:54:20 +00:00
|
|
|
bool Create(int n,
|
2011-12-17 23:52:47 +00:00
|
|
|
const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2016-09-23 14:59:11 +00:00
|
|
|
virtual int GetColoursCount() const wxOVERRIDE;
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2007-12-15 17:54:20 +00:00
|
|
|
int
|
|
|
|
GetPixel(unsigned char red, unsigned char green, unsigned char blue) const;
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2007-12-15 17:54:20 +00:00
|
|
|
bool
|
|
|
|
GetRGB(int pixel,
|
|
|
|
unsigned char *red, unsigned char *green, unsigned char *blue) const;
|
1998-05-20 14:12:05 +00:00
|
|
|
|
2014-12-05 22:18:38 +00:00
|
|
|
// implementation
|
2007-12-15 17:54:20 +00:00
|
|
|
WXHPALETTE GetHPALETTE() const;
|
2006-09-23 09:35:09 +00:00
|
|
|
void SetHPALETTE(WXHPALETTE pal);
|
2007-12-15 17:54:20 +00:00
|
|
|
|
|
|
|
protected:
|
2016-09-23 14:59:11 +00:00
|
|
|
virtual wxGDIRefData *CreateGDIRefData() const wxOVERRIDE;
|
|
|
|
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const wxOVERRIDE;
|
2007-12-15 17:54:20 +00:00
|
|
|
|
2006-09-23 09:35:09 +00:00
|
|
|
private:
|
2015-04-23 11:49:01 +00:00
|
|
|
wxDECLARE_DYNAMIC_CLASS(wxPalette);
|
1998-05-20 14:12:05 +00:00
|
|
|
};
|
|
|
|
|
2007-12-15 17:54:20 +00:00
|
|
|
#endif // _WX_PALETTE_H_
|