SetColorComponent (inline)

...

Syntax

//
//   Linux, MacOS and non-Visual Studio Windows solutions (pure C++11 / C++98)
//

static  inline  void    SetColorComponent(
                                int64_t             owlInstanceColorComponent,
                                int32_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
            );
    }
}


//
//   Visual Studio for Windows
//

static  inline  void    SetColorComponent(
                                __int64             owlInstanceColorComponent,
                                __int32             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.