class BMP
- BMP
- Reference
- Object
Overview
TODO handle signed width/height for moving origin/pixel order
Defined in:
bmp.crbuild.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
- .fill8bpp(width : UInt32, height : UInt32, & : UInt32, UInt32 -> UInt8) : BMP
- .new(width : UInt32, height : UInt32, bit_per_pixel : BMP::BitPerPixel)
- .new(io : IO)
Class Method Summary
Instance Method Summary
- #color(x, y, color)
- #color(x, y) : Color
- #color_table : Array(Color)
- #color_table=(color_table : Array(Color))
- #data(x, y, d : Bytes)
- #data(x, y) : Bytes
- #data_offset : UInt32
- #data_offset=(data_offset : UInt32)
- #decoder
- #file_size : UInt32
- #file_size=(file_size : UInt32)
- #header : Header
- #header=(header : Header)
-
#header_type : HeaderType
DIB header, there are multiple kind of headers.
-
#header_type=(header_type : HeaderType)
DIB header, there are multiple kind of headers.
- #height
-
#padding
Amount of padding bit at end of each scan lines.
- #pixel_data : Bytes
- #pixel_data=(pixel_data : Bytes)
- #reserved : UInt32
- #reserved=(reserved : UInt32)
-
#signature : UInt16
Bitmap file header
-
#signature=(signature : UInt16)
Bitmap file header
- #to_file(path)
- #width
- #write(io : IO)