Class: Gsk::ColorMatrixNode

Inherits:
RenderNode show all
Defined in:
(unknown)

Overview

A render node controlling the color matrix of its single child node.

Instance Method Summary collapse

Methods inherited from RenderNode

deserialize, #draw, #get_bounds, #node_type, #ref, #serialize, #unref, #write_to_file

Constructor Details

#initialize(child, color_matrix, color_offset) ⇒ Gsk::ColorMatrixNode

Creates a GskRenderNode that will drawn the child with color_matrix.

In particular, the node will transform colors by applying

pixel = transpose(color_matrix) * pixel + color_offset

for every pixel. The transformation operates on unpremultiplied colors, with color components ordered R, G, B, A.

Parameters:

  • child (Gsk::RenderNode)

    The node to draw

  • color_matrix (Graphene::Matrix)

    The matrix to apply

  • color_offset (Graphene::Vec4)

    Values to add to the color

Instance Method Details

#childGsk::RenderNode

Gets the child node that is getting its colors modified by the given node.

Returns:

#color_matrixGraphene::Matrix

Retrieves the color matrix used by the node.

Returns:

  • (Graphene::Matrix)

    a 4x4 color matrix

#color_offsetGraphene::Vec4

Retrieves the color offset used by the node.

Returns:

  • (Graphene::Vec4)

    a color vector