class
Opal::Image::PixelBuffer
- Opal::Image::PixelBuffer
- Reference
- Object
Overview
2D TrueColor pixel buffer supporting direct coordinate access, algorithmic generators, high-fidelity nearest & bilinear interpolation, and file decoders.
Defined in:
opal/image/pixel_buffer.crConstructors
-
.from_bmp(bytes : Bytes) : PixelBuffer
Parses 24-bit or 32-bit uncompressed Windows BMP bytes
-
.from_ppm(content : String) : PixelBuffer
Parses Netpbm PPM (P3 ASCII or P6 Binary) image stream
- .new(width : Int32, height : Int32, default_color : Color = Color.none)
- .new(width : Int32, height : Int32, pixels : Array(Color))
-
.sample_gem(w : Int32 = 48, h : Int32 = 48) : PixelBuffer
Generates a radiant 24-bit TrueColor Opal gemstone with multi-faceted refraction
-
.sample_landscape(w : Int32 = 48, h : Int32 = 36) : PixelBuffer
Generates a retro twilight mountain landscape with sunset gradient and sun
Instance Method Summary
- #clone : PixelBuffer
- #get(x : Int32, y : Int32) : Color
- #height : Int32
- #in_bounds?(x : Int32, y : Int32) : Bool
- #pixels : Array(Color)
-
#resize(target_w : Int32, target_h : Int32, interpolation : Interpolation = Interpolation::Bilinear) : PixelBuffer
Resizes the pixel buffer to the target dimensions using either nearest-neighbor or bilinear filtering.
- #set(x : Int32, y : Int32, color : Color) : Nil
- #width : Int32
Constructor Detail
Parses 24-bit or 32-bit uncompressed Windows BMP bytes
Parses Netpbm PPM (P3 ASCII or P6 Binary) image stream
Generates a radiant 24-bit TrueColor Opal gemstone with multi-faceted refraction
Generates a retro twilight mountain landscape with sunset gradient and sun
Instance Method Detail
Resizes the pixel buffer to the target dimensions using either nearest-neighbor or bilinear filtering.