class Prism::Bitmap

Overview

Provides a resource wrapper around the image loading library. This keeps the image loading abstracted from the engine thus enabling it to be easily changed in the future.

Defined in:

prism/texture/bitmap.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(file_name : String) #

[View source]

Instance Method Detail

def alpha? #

Checks if the bitmap has an alpha channel


[View source]
def flip_x #

Flips the x-axis


[View source]
def flip_y #

flips the y-axis


[View source]
def height : Int32 #

[View source]
def multiply_alpha! : Bitmap #

Pre-multiplies the RGB values with the alpha


[View source]
def pixel(x : Int32, y : Int32) : ColorUInt8 #

Retrieves a pixel's color value Gives the pixel color found at x and y, (horizontal axis, vertical axis)


[View source]
def pixels : Array(UInt8) #

Return all the pixels


[View source]
def set_pixel(x : Int32, y : Int32, color : ColorUInt8) #

Sets a pixel value


[View source]
def width : Int32 #

[View source]