Class: Vissen::Output::Pixel
Overview
The ‘Pixel` object is used by the `PixelBuffer` to store the colors of its points.
TODO: How do we want the pixel to saturate? When written or when read?
Instance Attribute Summary
Attributes inherited from Color
Instance Method Summary collapse
-
#clear! ⇒ self
Reset the pixel color to black (0, 0, 0).
-
#inspect ⇒ String
A string representation of the pixel.
Methods inherited from Color
#==, from, #initialize, #mix_with, #mix_with!, #to_a
Constructor Details
This class inherits a constructor from Vissen::Output::Color
Instance Method Details
#clear! ⇒ self
Reset the pixel color to black (0, 0, 0).
13 14 15 16 17 18 |
# File 'lib/vissen/output/pixel.rb', line 13 def clear! self.r = 0 self.g = 0 self.b = 0 self end |
#inspect ⇒ String
Returns a string representation of the pixel.
21 22 23 |
# File 'lib/vissen/output/pixel.rb', line 21 def inspect format '(%.1f, %.1f, %.1f)', r, g, b end |