Laxkit
0.0.7.1
|
A base color, one value in range 0..1.0 for each channel of a ColorSystem. More...
Public Member Functions | |
Color (const Color &l) | |
Color & | operator= (Color &l) |
virtual int | ColorSystedId () |
virtual double | ChannelValue (int channel) |
Return the value of channel. | |
virtual int | ChannelValueInt (int channel, int *error_ret=NULL) |
Return the value of channel as an int in the range of the primary of the ColorSystem. | |
virtual double | Alpha () |
Return the alpha of the color. 1==totally opaque, 0==totally transparent, -1==no alpha. | |
Public Member Functions inherited from Laxkit::anObject | |
anObject () | |
Set object_id=getUniqueNumber(). | |
virtual | ~anObject () |
Empty virtual destructor. | |
virtual const char * | whattype () |
Returns the type of anObject. | |
virtual anObject * | duplicate (anObject *ref=NULL) |
virtual int | inc_count () |
Increment the data's count by 1. Returns count. | |
virtual int | dec_count () |
Decrement the count of the data, deleting if count is less than or equal to 0. | |
virtual int | the_count () |
Public Member Functions inherited from LaxFiles::DumpUtility | |
virtual void | dump_out (FILE *f, int indent, int what, Laxkit::anObject *savecontext)=0 |
what==0 means write out an Attribute formatted file. | |
virtual Attribute * | dump_out_atts (Attribute *att, int what, Laxkit::anObject *savecontext) |
Default is return NULL. what==0 means write out normal Attribute formatted things. | |
virtual void | dump_in (FILE *f, int indent, int what, Laxkit::anObject *loadcontext, Attribute **att) |
Read in a file segment as an Attribute, and pass parsing duties to dump_in_atts. | |
virtual void | dump_in_atts (Attribute *att, int flag, Laxkit::anObject *loadcontext)=0 |
Read the Attribute and take away what it can. | |
virtual | ~DumpUtility () |
Empty virtual destructor. |
Public Attributes | |
int | id |
char * | name |
double | alpha |
ColorSystem * | system |
int | colorsystemid |
int | n |
double * | values |
Public Attributes inherited from Laxkit::anObject | |
int | suppress_debug |
DeleteRefCountedFunc | deleteMe |
Called when the count is decremented to 0. | |
unsigned long | object_id |
char * | object_idstr |
Additional Inherited Members | |
Protected Attributes inherited from Laxkit::anObject | |
int | _count |
The reference count of the object. |
A base color, one value in range 0..1.0 for each channel of a ColorSystem.
|
virtual |
Return the alpha of the color. 1==totally opaque, 0==totally transparent, -1==no alpha.
If the ColorSystem defines alpha within the primaries, then either that alpha is used in place of this->alpha, but only if this->alpha is not within range 0..1.0. If alpha is in range, then the returned alpha is that multiplied by the system channel. If the system has no built in alpha, then this->alpha is returned.
|
virtual |
Return the value of channel.
This function does no checking against system. It only checks channel against this->n, and returns values[channel].
On error -1 is returned.
Return the value of channel as an int in the range of the primary of the ColorSystem.
On error, -1 is returned, and error_ret set to a nonzero number: 1 means no system specified, 2 means channel out of range, 3 means values[channel] is not in range 0 to 1.0. If channel doesn't exist. This assumes that system exists to be queried about primary limits.