Difference between revisions of "IC Python API:RLPy RRgb"

From Reallusion Wiki!
Jump to: navigation, search
(Created page with "{{TOC}} {{Parent|IC_Python_API:RL_Python_Modules|Modules}} ==Detailed Description== This class represent the color data RGB. ==Operators== This class supports the following op...")
 
m
Line 41: Line 41:
 
|Return the value negated.
 
|Return the value negated.
 
| a = -b
 
| a = -b
 +
|-
 +
! scope="row"|__pos__
 +
|Positive
 +
|+a
 +
|Return value positive.
 +
|a = +b
 
|-
 
|-
 
! scope="row"|__eq__
 
! scope="row"|__eq__

Revision as of 02:47, 29 March 2019

Main article: Modules.

Detailed Description

This class represent the color data RGB.

Operators

This class supports the following operators:

Member Operation Syntax Description Example
__add__ Addition a + b Adds values on either side of the operator. a + b = 30
__sub__ Subtraction a - b Subtracts right hand operand from left hand operand. a – b = -10
__mul__ Multiplication a * b Multiplies values on either side of the operator. a * b = 200
__truediv__ Division a / b Divides left hand operand by right hand operand. b / a = 2
__neg__ Negation -a Return the value negated. a = -b
__pos__ Positive
a
Return value positive. a = +b
__eq__ Equality a == b If the values of two operands are equal, then the condition becomes true. (a == b) is not true.
__ne__ Difference a != b If values of two operands are not equal, then condition becomes true. (a != b) is true.
__lt__ Less Than a < b If the value of left operand is less than the value of right operand, then condition becomes true. (a < b) is true.
__iadd__ Addition (Inplace) a += b It adds right operand to the left operand and assign the result to left operand. c += a is equivalent to c = c + a
__isub__ Subtraction (Inplace) a -= b It subtracts right operand from the left operand and assign the result to left operand. c -= a is equivalent to c = c - a
__imul__ Multiply (Inplace) a *= b It multiplies right operand with the left operand and assign the result to left operand. c *= a is equivalent to c = c * a
__itruediv__ Divide (Inplace) a /= b It divides left operand with the right operand and assign the result to left operand. c /= a is equivalent to c = c / ac /= a is equivalent to c = c / a

Member Functions

B

RLPy.RRgb.B ( self, args )

Get the value of the color-Blue.

Returns

The value of the color-Blue - float

Blue

RLPy.RRgb.Blue ( self )

Get the value of the color-Blue.

Returns

The value of the color-Blue(value: 0~255) - int

From

RLPy.RRgb.From ( self, r, g, b )

Convert unsigned char rgb data to CRgb.

Parameters

r [IN] the unsigned char value of red - string

g [IN] the unsigned char value of green - string

b [IN] the unsigned char value of blue - string

Returns

The CRgb data - RLPy.RRgb

FromCOLORREF

RLPy.RRgb.FromCOLORREF ( self, arg2 )

Convert COLORREF data to CRgb.

Parameters

[IN] the unsigned long COLORREF value.

Returns

The CRgb data - RLPy.RRgb

FromXRGB

RLPy.RRgb.FromXRGB ( self, arg2 )

Convert XRGB to CRgb.

Parameters

[IN] the unsigned long XRGB value.

Returns

Return the CRgb data - RLPy.RRgb

G

RLPy.RRgb.G ( self, args )

Get the value of the color-Green.

Returns

The value of the color-Green - float

Green

RLPy.RRgb.Green ( self )

Get the value of the color-Green.

Returns

The value of the color-Green(value: 0~255) - int

Normalize

RLPy.RRgb.Normalize ( self )

Normalizes this rgb vector.

Returns

The normalized rgb vector - RLPy.RRgb

R

RLPy.RRgb.R ( self, args )

Get the value of the color-Red.

Returns

The value of the color-Red - float

Red

RLPy.RRgb.Red ( self )

Get the value of the color-Red.

Returns

The value of the color-Red(value: 0~255) - int

Saturate

RLPy.RRgb.Saturate ( self )

Saturates this rgb vector.

Returns

The saturated rgb vector - RLPy.RRgb

ToCOLORREF

RLPy.RRgb.ToCOLORREF ( self )

Convert CRgb to COLORREF.

Returns

The COLORREF data - int

ToVector3f

RLPy.RRgb.ToVector3f ( self )

Returns CRgb to Vector3f.

Returns

Return the Vector3f data - RLPy.RVector3f

ToXRGB

RLPy.RRgb.ToXRGB ( self )

Convert CRgb to XRGB.

Returns

The XRGB data - int