Class: Clutter::BrightnessContrastEffect

Inherits:
OffscreenEffect show all
Defined in:
lib/clutter/brightness-contrast-effect.rb

Instance Method Summary collapse

Methods inherited from OffscreenEffect

#create_texture, #get_target_rect, #get_target_size, #paint_target, #target, #texture

Methods inherited from Effect

#queue_repaint

Methods inherited from ActorMeta

#actor, #actor=, #enabled, #enabled=, #enabled?, #name, #name=

Constructor Details

#initializeClutter::Effect

Creates a new Clutter::BrightnessContrastEffect to be used with clutter_actor_add_effect()

Instance Method Details

#brightnessClutter::Color

The brightness change to apply to the effect.

This property uses a Clutter::Color to represent the changes to each color channel. The range is [ 0, 255 ], with 127 as the value used to indicate no change; values smaller than 127 indicate a decrease in brightness, and values larger than 127 indicate an increase in brightness.

Returns:

#brightness=(brightness) ⇒ Clutter::Color

The brightness change to apply to the effect.

This property uses a Clutter::Color to represent the changes to each color channel. The range is [ 0, 255 ], with 127 as the value used to indicate no change; values smaller than 127 indicate a decrease in brightness, and values larger than 127 indicate an increase in brightness.

Parameters:

Returns:

#contrastClutter::Color

The contrast change to apply to the effect.

This property uses a Clutter::Color to represent the changes to each color channel. The range is [ 0, 255 ], with 127 as the value used to indicate no change; values smaller than 127 indicate a decrease in contrast, and values larger than 127 indicate an increase in contrast.

Returns:

#contrast=(contrast) ⇒ Clutter::Color

The contrast change to apply to the effect.

This property uses a Clutter::Color to represent the changes to each color channel. The range is [ 0, 255 ], with 127 as the value used to indicate no change; values smaller than 127 indicate a decrease in contrast, and values larger than 127 indicate an increase in contrast.

Parameters:

Returns:

#get_brightness(red, green, blue) ⇒ nil

Retrieves the change in brightness used by effect.

Parameters:

  • red (Clutter::gfloat)

    return location for red component of the change in brightness

  • green (Clutter::gfloat)

    return location for green component of the change in brightness

  • blue (Clutter::gfloat)

    return location for blue component of the change in brightness

Returns:

  • (nil)

#get_contrast(red, green, blue) ⇒ nil

Retrieves the contrast value used by effect.

Parameters:

  • red (Clutter::gfloat)

    return location for red component of the change in contrast

  • green (Clutter::gfloat)

    return location for green component of the change in contrast

  • blue (Clutter::gfloat)

    return location for blue component of the change in contrast

Returns:

  • (nil)

#set_brightness(brightness_all_or_red, brightness_green = nil, brightness_blue = nil) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/clutter/brightness-contrast-effect.rb', line 32

def set_brightness(brightness_all_or_red, brightness_green=nil,
                   brightness_blue=nil)
  if brightness_green.nil? && brightness_blue.nil?
    brightness_all = brightness_all_or_red
    set_brightness_raw(brightness_all)
  else
    brightness_red = brightness_all_or_red
    set_brightness_full(brightness_red, brightness_green,
                        brightness_blue)
  end
end

#set_brightness_full(red, green, blue) ⇒ nil

The range for each component is [-1.0, 1.0] where 0.0 designates no change, values below 0.0 mean a decrease in brightness, and values above indicate an increase.

Parameters:

  • red (Clutter::gfloat)

    red component of the change in brightness

  • green (Clutter::gfloat)

    green component of the change in brightness

  • blue (Clutter::gfloat)

    blue component of the change in brightness

Returns:

  • (nil)

#set_brightness_rawObject



31
# File 'lib/clutter/brightness-contrast-effect.rb', line 31

alias_method :set_brightness_raw, :set_brightness

#set_contrast(contrast_all_or_red, contrast_green = nil, contrast_blue = nil) ⇒ Object



20
21
22
23
24
25
26
27
28
29
# File 'lib/clutter/brightness-contrast-effect.rb', line 20

def set_contrast(contrast_all_or_red, contrast_green=nil, contrast_blue=nil)
  if contrast_green.nil? && contrast_blue.nil?
    contrast_all = contrast_all_or_red
    set_contrast_raw(contrast_all)
  else
    contrast_red = contrast_all_or_red
    set_contrast_full(contrast_red, contrast_green,
                      contrast_blue)
  end
end

#set_contrast_full(red, green, blue) ⇒ nil

The range for each component is [-1.0, 1.0] where 0.0 designates no change, values below 0.0 mean a decrease in contrast, and values above indicate an increase.

Parameters:

  • red (Clutter::gfloat)

    red component of the change in contrast

  • green (Clutter::gfloat)

    green component of the change in contrast

  • blue (Clutter::gfloat)

    blue component of the change in contrast

Returns:

  • (nil)

#set_contrast_rawObject



19
# File 'lib/clutter/brightness-contrast-effect.rb', line 19

alias_method :set_contrast_raw, :set_contrast