JX Application Framework
|
#include <JXColorManager.h>
Public Member Functions | |
~JXColorManager () override | |
operator Colormap () const | |
JXDisplay * | GetDisplay () const |
Colormap | GetXColormap () const |
XVisualInfo | GetXVisualInfo () const |
Visual * | GetVisual () const |
int | GetVisualClass () const |
bool | GetColorID (const JString &name, JColorID *id) const override |
JColorID | GetColorID (const unsigned long systemColor) const |
unsigned long | GetXColor (const JColorID id) const |
![]() | |
JColorManager () | |
virtual | ~JColorManager () |
![]() | |
JBroadcaster () | |
virtual | ~JBroadcaster () |
JBroadcaster & | operator= (const JBroadcaster &source) |
bool | HasSenders () const |
JSize | GetSenderCount () const |
bool | HasRecipients () const |
JSize | GetRecipientCount () const |
virtual JString | ToString () const |
template<class T > | |
void | ListenTo (const JBroadcaster *sender, const std::function< void(const T &)> &f) |
Friends | |
class | JXDisplay |
Encapsulates the default X Colormap.
|
override |
Returns true if it was able to allocate the requested read-only color. Accepts both names from the color database and hex specifications. (i.e. "red" or "#FFFF00000000")
Implements JColorManager.
JColorID JXColorManager::GetColorID | ( | const unsigned long | systemColor | ) | const |
Converts a system color value into a ColorID
|
inline |
|
inline |
|
inline |
unsigned long JXColorManager::GetXColor | ( | const JColorID | id | ) | const |
We scale each component to fit inside the number of bits in its mask. This means multiplying by (2^(mask length)-1)/(2^16-1). By ignoring the -1's, it becomes a bit shift. The bit shift produces cleaner levels of gray with 16-bit color and negligible difference on 24-bit color. Both produce inaccurate results when writing GIFs on 16-bit color.
|
inline |
|
inline |
Nobody wants a "const XVisualInfo*", but it is too dangerous to return a non-const pointer to our data.
|
inline |
|
friend |