SetColorOfComponent (inline)

...

Syntax

//
//   Strong typing definition
//

static  inline  void    SetColorOfComponent(
                                OwlInstance             owlInstanceColorComponent,
                                uint32_t                color
                            )
{
    assert(IsInstanceOfClass(owlInstanceColorComponent, "ColorComponent"));

    int64_t model = GetModel(owlInstanceColorComponent);

    const char  * rgbwNames[4] = { "R", "G", "B", "W" };
    double      rgbwValues[4];

    COLOR_GET_COMPONENTS(rgbwValues, color);

    for (size_t i = 0; i < 4; i++) {
        SetDatatypeProperty(
                owlInstanceColorComponent,
                GetPropertyByName(
                        model,
                        rgbwNames[i]
                    ),
                &rgbwValues[i],
                1
            );
    }
}


//
//   Weak typing definition
//

static  inline  void    SetColorOfComponent(
                                int64_t                 owlInstanceColorComponent,
                                uint32_t                color
                            )
{
    assert(IsInstanceOfClass(owlInstanceColorComponent, "ColorComponent"));

    int64_t model = GetModel(owlInstanceColorComponent);

    const char  * rgbwNames[4] = { "R", "G", "B", "W" };
    double      rgbwValues[4];

    COLOR_GET_COMPONENTS(rgbwValues, color);

    for (size_t i = 0; i < 4; i++) {
        SetDatatypeProperty(
                owlInstanceColorComponent,
                GetPropertyByName(
                        model,
                        rgbwNames[i]
                    ),
                &rgbwValues[i],
                1
            );
    }
}
    

Property owlInstanceColorComponent

Size: 64 bit / 8 byte (value)
The handle of the Color Component instance.

Property color

Size: 32 bit / 4 byte (value)
The color as 32 bit integer representing R, G, B, W values per 8 bits.