Color Space Funcs (2015)

The color space global returns a structure that contains function pointers to the LightWave color space conversion functions. These functions allow the user to change their color values to those selected in the color space of LightWave.

class lwsdk.LWColorSpaceFuncs(self)

Bases: object

Proxy of C++ PCore::LWColorSpaceFuncs class

 colorSpaceFile(int type) → char

Gets the file of the current color space of the type specified, where it can be one of:

    lwsdk.lwcst_viewer
        Viewer color space.
    lwsdk.lwcst_surface_color
        Surface color space.
    lwsdk.lwcst_palette_files
        Palette files color space.
    lwsdk.lwcst_8bit_files
        8-bit files color space.
    lwsdk.lwcst_float_files
        Float files color space.
    lwsdk.lwcst_alpha_files
        Alpha files color space.
    lwsdk.lwcst_output
        Output files color space.
    lwsdk.lwcst_output_alpha
        Output alpha files color space.
    lwsdk.lwcst_light_color
        Light color space.

 colorSpaceName(int type) → char

Gets the name of the current color space of the type specified.

type can be one of:

    lwsdk.lwcst_viewer
        Viewer color space.
    lwsdk.lwcst_surface_color
        Surface color space.
    lwsdk.lwcst_palette_files
        Palette files color space.
    lwsdk.lwcst_8bit_files
        8-bit files color space.
    lwsdk.lwcst_float_files
        Float files color space.
    lwsdk.lwcst_alpha_files
        Alpha files color space.
    lwsdk.lwcst_output
        Output files color space.
    lwsdk.lwcst_output_alpha
        Output alpha files color space.
    lwsdk.lwcst_light_color
        Light color space.

 colorSpaceToIndex(int layer, int space) → int

layer can be one of:

    lwsdk.lwcsl_RGB
        RGB Channel.
    lwsdk.lwcsl_Alpha
        Alpha Channel.

space can be one of:

    lwsdk.lwcs_linear
        LightWave linear color space.
    lwsdk.lwcs_sRGB
        Standard RGB color space.
    lwsdk.lwcs_rec709
        Recommendation BT.709, HDTV.
    lwsdk.lwcs_cineon
        Eastman Kodak Co.
    lwsdk.lwcs_ciexyz
        CIE XYZ.

 getColorSpace(char type) → int

Returns the color space setting of the specified color space type.

type can be one of:

    lwsdk.LW_COLORSPACE_VIEWER
    lwsdk.LW_COLORSPACE_SURFACE_COLOR
    lwsdk.LW_COLORSPACE_LIGHT_COLOR
    lwsdk.LW_COLORSPACE_PALETTE_FILES
    lwsdk.LW_COLORSPACE_8BIT_FILES
    lwsdk.LW_COLORSPACE_FLOAT_FILES
    lwsdk.LW_COLORSPACE_ALPHA
    lwsdk.LW_COLORSPACE_OUTPUT
    lwsdk.LW_COLORSPACE_OUTPUT_ALPHA
    lwsdk.LW_COLORSPACE_AUTO_SENSE
    lwsdk.LW_COLORSPACE_CORRECT_OPENGL
    lwsdk.LW_COLORSPACE_AFFECT_PICKER
    lwsdk.LW_COLORSPACE_8BIT_TO_FLOAT

 getColorSpaceBoolean(char type) → int

Returns the state of a color space check box.

type can be one of:

    lwsdk.LW_COLORSPACE_VIEWER
    lwsdk.LW_COLORSPACE_SURFACE_COLOR
    lwsdk.LW_COLORSPACE_LIGHT_COLOR
    lwsdk.LW_COLORSPACE_PALETTE_FILES
    lwsdk.LW_COLORSPACE_8BIT_FILES
    lwsdk.LW_COLORSPACE_FLOAT_FILES
    lwsdk.LW_COLORSPACE_ALPHA
    lwsdk.LW_COLORSPACE_OUTPUT
    lwsdk.LW_COLORSPACE_OUTPUT_ALPHA
    lwsdk.LW_COLORSPACE_AUTO_SENSE
    lwsdk.LW_COLORSPACE_CORRECT_OPENGL
    lwsdk.LW_COLORSPACE_AFFECT_PICKER
    lwsdk.LW_COLORSPACE_8BIT_TO_FLOAT

 indexToColorSpace(int layer, int index) → int

Used to convert from indexes of pop-ups to color spaces.

layer can be one of:

    lwsdk.lwcsl_RGB
        RGB Channel.
    lwsdk.lwcsl_Alpha
        Alpha Channel.

 loadPixelLookupTable(char file) → int

File name.

 nameOfColorSpaces(int layer, int index) → char

Gets the name of the color space in the layer.

layer can be one of:

    lwsdk.lwcsl_RGB
        RGB Channel.
    lwsdk.lwcsl_Alpha
        Alpha Channel.

 nameToColorSpace(char name) → int

Returns the color space of the given color space name.

The return value will be one of:

    lwsdk.lwcs_linear
        LightWave linear color space.
    lwsdk.lwcs_sRGB
        Standard RGB color space.
    lwsdk.lwcs_rec709
        Recommendation BT.709, HDTV.
    lwsdk.lwcs_cineon
        Eastman Kodak Co.
    lwsdk.lwcs_ciexyz
        CIE XYZ.

Note that a return value of lwsdk.lwcs_linear indicates there is no conversion.

 numberOfColorSpaces(int layer) → int

Gets the number of loaded color spaces in the layer.

layer can be one of:

    lwsdk.lwcsl_RGB
        RGB Channel.
    lwsdk.lwcsl_Alpha
        Alpha Channel.

 pixelConversionAlpha(int space, int conversion, (float|float[4]) alpha) → (float|float[4])

This function collapses the two-step process of first acquiring the conversion instance and function pointer using the SDK LWColorSpaceFuncs.getPixelConversionAlpha() function to perform the color space conversion.

space can be one of:

    lwsdk.lwcs_linear
        LightWave linear color space.
    lwsdk.lwcs_sRGB
        Standard RGB color space.
    lwsdk.lwcs_rec709
        Recommendation BT.709, HDTV.
    lwsdk.lwcs_cineon
        Eastman Kodak Co.
    lwsdk.lwcs_ciexyz
        CIE XYZ.

conversion can be one of:

    lwsdk.lwcsc_colorspaceToLinear
        Convert from non-linear to linear.
    lwsdk.lwcsc_linearToColorspace
        Convert from linear to non-linear.

Note that the provided alpha value can either be a 4-element sequence, or a single floating-point alpha value. The output value will mirror the input -- i.e., if you provide a sequence, a sequence will be returned, otherwise a single value will be returned.

 pixelConversionRGB(int space, int conversion, (float|float[3]) rgb) → (float|float[3])

This function collapses the two-step process of first acquiring the conversion instance and function pointer using the SDK LWColorSpaceFuncs.getPixelConversionRGB() function to perform the color space conversion.

space can be one of:

    lwsdk.lwcs_linear
        LightWave linear color space.
    lwsdk.lwcs_sRGB
        Standard RGB color space.
    lwsdk.lwcs_rec709
        Recommendation BT.709, HDTV.
    lwsdk.lwcs_cineon
        Eastman Kodak Co.
    lwsdk.lwcs_ciexyz
        CIE XYZ.

conversion can be one of:

    lwsdk.lwcsc_colorspaceToLinear
        Convert from non-linear to linear.
    lwsdk.lwcsc_linearToColorspace
        Convert from linear to non-linear.

Note that the provided rgb value can either be a 3-element sequence, or a single floating-point rgb value in the range 0.0-1.0. If you provide only a single color value, the remaining elements will use the same value (i.e., your RGB will be grey scaled). The output value will mirror the input -- i.e., if you provide a sequence, a sequence will be returned, otherwise a single value will be returned.

 setColorSpace(int type, int space) → int

type can be one of:

    lwsdk.LW_COLORSPACE_VIEWER
    lwsdk.LW_COLORSPACE_SURFACE_COLOR
    lwsdk.LW_COLORSPACE_LIGHT_COLOR
    lwsdk.LW_COLORSPACE_PALETTE_FILES
    lwsdk.LW_COLORSPACE_8BIT_FILES
    lwsdk.LW_COLORSPACE_FLOAT_FILES
    lwsdk.LW_COLORSPACE_ALPHA
    lwsdk.LW_COLORSPACE_OUTPUT
    lwsdk.LW_COLORSPACE_OUTPUT_ALPHA
    lwsdk.LW_COLORSPACE_AUTO_SENSE
    lwsdk.LW_COLORSPACE_CORRECT_OPENGL
    lwsdk.LW_COLORSPACE_AFFECT_PICKER
    lwsdk.LW_COLORSPACE_8BIT_TO_FLOAT

space can be one of:

    lwsdk.lwcs_linear
        LightWave linear color space.
    lwsdk.lwcs_sRGB
        Standard RGB color space.
    lwsdk.lwcs_rec709
        Recommendation BT.709, HDTV.
    lwsdk.lwcs_cineon
        Eastman Kodak Co.
    lwsdk.lwcs_ciexyz
        CIE XYZ.

 setColorSpaceBoolean(char type, int space) → int

Sets the state of a color space check box.

type can be one of:

    lwsdk.LW_COLORSPACE_VIEWER
    lwsdk.LW_COLORSPACE_SURFACE_COLOR
    lwsdk.LW_COLORSPACE_LIGHT_COLOR
    lwsdk.LW_COLORSPACE_PALETTE_FILES
    lwsdk.LW_COLORSPACE_8BIT_FILES
    lwsdk.LW_COLORSPACE_FLOAT_FILES
    lwsdk.LW_COLORSPACE_ALPHA
    lwsdk.LW_COLORSPACE_OUTPUT
    lwsdk.LW_COLORSPACE_OUTPUT_ALPHA
    lwsdk.LW_COLORSPACE_AUTO_SENSE
    lwsdk.LW_COLORSPACE_CORRECT_OPENGL
    lwsdk.LW_COLORSPACE_AFFECT_PICKER
    lwsdk.LW_COLORSPACE_8BIT_TO_FLOAT

space can be one of:

    lwsdk.lwcs_linear
        LightWave linear color space.
    lwsdk.lwcs_sRGB
        Standard RGB color space.
    lwsdk.lwcs_rec709
        Recommendation BT.709, HDTV.
    lwsdk.lwcs_cineon
        Eastman Kodak Co.
    lwsdk.lwcs_ciexyz
        CIE XYZ.

Previous topic

Texture Editor Funcs (2015)

Next topic

Spatial Query Funcs (2015)

This Page