class FreeImage::RGBQuad

  1. lib/free-image/types/rgb_quad.rb
Superclass: FreeImage::FFI::Struct

Used to specify a color for a :bitmap image type.

Methods

Public Class

  1. create

Public Instance

  1. eql?
  2. to_s

Constants

ALPHA = 3  
ALPHA_MASK = 0xFF000000  
ALPHA_SHIFT = 24  
BLUE = 0  
BLUE_MASK = 0x000000FF  
BLUE_SHIFT = 0  
GREEN = 1  
GREEN_MASK = 0x0000FF00  
GREEN_SHIFT = 8  
RED = 2  

Little Endian (x86 / MS Windows, Linux) : BGR(A) order

RED_MASK = 0x00FF0000  
RED_SHIFT = 16  
RGB_MASK = (RED_MASK | GREEN_MASK | BLUE_MASK)  

Public Instance Aliases

== -> eql?

Public Class methods

create (red, green, blue, reserved = 0)

Creates a new RGBQuad color

Parameters

red

Value for red, should be between 0 and 255

green

Value for green, should be between 0 and 255

blue

Value for blue, should be between 0 and 255

reserved

Reserved value, by default is 0

[show source]
# File lib/free-image/types/rgb_quad.rb, line 59
def self.create(red, green, blue, reserved = 0)
  result = self.new
  result[:red] = red
  result[:green] = green
  result[:blue] = blue
  result[:reserved] = reserved
  result
end

Public Instance methods

eql? (other)
[show source]
# File lib/free-image/types/rgb_quad.rb, line 68
def eql?(other)
  other.instance_of?(RGBQuad) and
  self[:red]   == other[:red] and
  self[:green] == other[:green] and
  self[:blue]  == other[:blue] and
  self[:reserved]  == other[:reserved]
end
to_s ()
[show source]
# File lib/free-image/types/rgb_quad.rb, line 77
def to_s
  "RGBQuad - Red: #{self[:red]}, Green: #{self[:green]}, Blue: #{self[:blue]}, Alpha: #{self[:reserved]}"
end