class Freetype::Bitmap

Overview

Wrapper for LibFreetype::FT_Bitmap

Defined in:

freetype/bitmap.cr

Constructors

Instance Method Summary

Macro Summary

Constructor Detail

def self.new(bitmap : LibFreetype::FT_Bitmap) #

[View source]

Instance Method Detail

def bitmap : LibFreetype::FT_Bitmap #

[View source]
def buffer #

A typeless pointer to the bitmap buffer. This value should be aligned on 32-bit boundaries in most cases.


[View source]
def num_grays #

This field is only used with FT_PIXEL_MODE_GRAY; it gives the number of gray levels used in the bitmap.


[View source]
def palette #

A typeless pointer to the bitmap palette; this field is intended for paletted pixel modes. Not used currently.


[View source]
def palette_mode #

This field is intended for paletted pixel modes; it indicates how the palette is stored. Not used currently.


[View source]
def pitch #

The pitch's absolute value is the number of bytes taken by one bitmap row, including padding. However, the pitch is positive when the bitmap has a ‘down’ flow, and negative when it has an ‘up’ flow. In all cases, the pitch is an offset to add to a bitmap pointer in order to go down one row.

Note that ‘padding’ means the alignment of a bitmap to a byte border, and FreeType functions normally align to the smallest possible integer value.

For the B/W rasterizer, pitch is always an even number.

To change the pitch of a bitmap (say, to make it a multiple of 4), use FT_Bitmap_Convert. Alternatively, you might use callback functions to directly render to the application's surface; see the file example2.cpp in the tutorial for a demonstration.


[View source]
def pixel_mode #

The pixel mode, i.e., how pixel bits are stored. See FT_Pixel_Mode for possible values.


[View source]
def rows #

The number of bitmap rows.


[View source]
def width #

The number of pixels in each bitmap row.


[View source]

Macro Detail

macro method_missing(call) #

[View source]