class BMP

Overview

TODO handle signed width/height for moving origin/pixel order

Defined in:

bmp.cr
build.cr
decode.cr
fill.cr
parse.cr
write.cr

Constant Summary

GRAYSCALE_8BPP = (0_u8...256).map do |i| Color.new(i, i, i) end
SIGNATURE = 19778_u16
UNSUPPORTED_COMPRESSION = [Compression::BI_BITFIELDS, Compression::BI_ALPHABITFIELDS, Compression::BI_RLE4, Compression::BI_RLE8, Compression::BI_JPEG, Compression::BI_PNG, Compression::BI_CMYK, Compression::BI_CMYKRLE8, Compression::BI_CMYKRLE4]

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.fill8bpp(width : UInt32, height : UInt32, & : UInt32, UInt32 -> UInt8) : BMP #

[View source]
def self.new(width : UInt32, height : UInt32, bit_per_pixel : BMP::BitPerPixel) #

[View source]
def self.new(io : IO) #

[View source]

Class Method Detail

def self.from_file(path) #

[View source]

Instance Method Detail

def color(x, y, color) #

[View source]
def color(x, y) : Color #

[View source]
def color_table : Array(Color) #

[View source]
def color_table=(color_table : Array(Color)) #

[View source]
def data(x, y, d : Bytes) #

[View source]
def data(x, y) : Bytes #

[View source]
def data_offset : UInt32 #

[View source]
def data_offset=(data_offset : UInt32) #

[View source]
def decoder #

[View source]
def file_size : UInt32 #

[View source]
def file_size=(file_size : UInt32) #

[View source]
def header : Header #

[View source]
def header=(header : Header) #

[View source]
def header_type : HeaderType #

DIB header, there are multiple kind of headers.


[View source]
def header_type=(header_type : HeaderType) #

DIB header, there are multiple kind of headers.


[View source]
def height #

[View source]
def padding #

Amount of padding bit at end of each scan lines.


[View source]
def pixel_data : Bytes #

[View source]
def pixel_data=(pixel_data : Bytes) #

[View source]
def reserved : UInt32 #

[View source]
def reserved=(reserved : UInt32) #

[View source]
def signature : UInt16 #

Bitmap file header


[View source]
def signature=(signature : UInt16) #

Bitmap file header


[View source]
def to_file(path) #

[View source]
def width #

[View source]
def write(io : IO) #

[View source]