class FreeImage::RGBTriple

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

Methods

Public Class

  1. create

Public Instance

  1. eql?
  2. to_s

Public Instance Aliases

== -> eql?

Public Class methods

create (red, green, blue)

Creates a new RGBTriple 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

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

Public Instance methods

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