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

From Reallusion Wiki!
Jump to: navigation, search
m
m
Line 12: Line 12:
 
!Example
 
!Example
 
|-
 
|-
! scope="row"|__add__
+
! scope="row" | __add__
|Addition
+
| Addition
|a + b
+
| a + b
|Adds values on either side of the operator.
+
| Adds values on either side of the operator.
|a + b = 30
+
| a + b = 30
 
|-
 
|-
! scope="row"|__sub__
+
! scope="row" | __sub__
|Subtraction
+
| Subtraction
|a - b
+
| a - b
|Subtracts right hand operand from left hand operand.
+
| Subtracts right hand operand from left hand operand.
|a – b = -10
+
| a – b = -10
 
|-
 
|-
! scope="row"|__mul__
+
! scope="row" | __mul__
|Multiplication
+
| Multiplication
|a * b
+
| a * b
|Multiplies values on either side of the operator.
+
| Multiplies values on either side of the operator.
|a * b = 200
+
| a * b = 200
 
|-
 
|-
! scope="row"|__truediv__
+
! scope="row" | __truediv__
|Division
+
| Division
|a / b
+
| a / b
|Divides left hand operand by right hand operand.
+
| Divides left hand operand by right hand operand.
|b / a = 2
+
| b / a = 2
 
|-
 
|-
! scope="row"|__neg__
+
! scope="row" | __neg__
|Negation
+
| Negation
 
| -a
 
| -a
|Return the value negated.
+
| Return the value negated.
 
| a = -b
 
| a = -b
 
|-
 
|-
! scope="row"|__pos__
+
! scope="row" | __pos__
|Positive
+
| Positive
|+a
+
| +a
|Return value positive.
+
| Return value positive.
|a = +b
+
| a = +b
 
|-
 
|-
! scope="row"|__eq__
+
! scope="row" | __eq__
|Equality
+
| Equality
|a == b
+
| a == b
|If the values of two operands are equal, then the condition becomes true.
+
| If the values of two operands are equal, then the condition becomes true.
|(a == b) is not true.
+
| (a == b) is not true.
 
|-
 
|-
! scope="row"|__ne__
+
! scope="row" | __ne__
|Difference
+
| Difference
|a != b
+
| a != b
|If values of two operands are not equal, then condition becomes true.
+
| If values of two operands are not equal, then condition becomes true.
|(a != b) is true.
+
| (a != b) is true.
 
|-
 
|-
! scope="row"|__lt__
+
! scope="row" | __lt__
|Less Than
+
| Less Than
|a < b
+
| a < b
|If the value of left operand is less than the value of right operand, then condition becomes true.
+
| If the value of left operand is less than the value of right operand, then condition becomes true.
|(a < b) is true.
+
| (a < b) is true.
 
|-
 
|-
! scope="row"|__iadd__
+
! scope="row" | __iadd__
|Addition (Inplace)
+
| Addition (Inplace)
|a += b
+
| a += b
|It adds right operand to the left operand and assign the result to left operand.
+
| It adds right operand to the left operand and assign the result to left operand.
|c += a is equivalent to c = c + a
+
| c += a is equivalent to c = c + a
 
|-
 
|-
! scope="row"|__isub__
+
! scope="row" | __isub__
|Subtraction (Inplace)
+
| Subtraction (Inplace)
|a -= b
+
| a -= b
|It subtracts right operand from the left operand and assign the result to left operand.
+
| It subtracts right operand from the left operand and assign the result to left operand.
|c -= a is equivalent to c = c - a
+
| c -= a is equivalent to c = c - a
 
|-
 
|-
! scope="row"|__imul__
+
! scope="row" | __imul__
|Multiply (Inplace)
+
| Multiply (Inplace)
|a *= b
+
| a *= b
|It multiplies right operand with the left operand and assign the result to left operand.
+
| It multiplies right operand with the left operand and assign the result to left operand.
|c *= a is equivalent to c = c * a
+
| c *= a is equivalent to c = c * a
 
|-
 
|-
! scope="row"|__itruediv__
+
! scope="row" | __itruediv__
|Divide (Inplace)
+
| Divide (Inplace)
|a /= b
+
| a /= b
|It divides left operand with the right operand and assign the result to left operand.
+
| 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
+
| c /= a is equivalent to c = c / ac /= a is equivalent to c = c / a
 
|}
 
|}
 
==Member Functions==
 
==Member Functions==

Revision as of 02:57, 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