Laxkit  0.0.7.1
Public Member Functions | Public Attributes
Laxkit::Color Class Reference

A base color, one value in range 0..1.0 for each channel of a ColorSystem. More...

Inheritance diagram for Laxkit::Color:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Color (const Color &l)
Coloroperator= (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 charwhattype ()
 Returns the type of anObject.
virtual anObjectduplicate (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 Attributedump_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
charname
double alpha
ColorSystemsystem
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
charobject_idstr

Additional Inherited Members

- Protected Attributes inherited from Laxkit::anObject
int _count
 The reference count of the object.

Detailed Description

A base color, one value in range 0..1.0 for each channel of a ColorSystem.


Member Function Documentation

double Laxkit::Color::Alpha ( )
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.

double Laxkit::Color::ChannelValue ( int  channel)
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.

int Laxkit::Color::ChannelValueInt ( int  channel,
int error_ret = NULL 
)
virtual

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.


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

Mon Feb 17 2014 11:52:59, Laxkit