class Cairo::GlyphArray

Included Modules

Defined in:

cairo/glyph_array.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(glyphs : LibCairo::PGlyphT, num_glyphs : Int32) #

[View source]
def self.new(num_glyphs : Int32) #

Allocates an array of Glyph's.

###Parameters

  • *num_glyphs number of glyphs to allocate

###Returns The newly allocated array of glyphs that should be freed using GlyphArray#finalize


[View source]

Instance Method Detail

def []=(index : Int, glyph : Glyph) #

[View source]
def finalize #

[View source]
def size : Int32 #

Returns the number of elements in this container.


[View source]
def to_unsafe : LibCairo::PGlyphT #

[View source]
def unsafe_fetch(index : Int) #

Returns the element at the given index, without doing any bounds check.

Indexable makes sure to invoke this method with index in 0...size, so converting negative indices to positive ones is not needed here.

Clients never invoke this method directly. Instead, they access elements with #[](index) and #[]?(index).

This method should only be directly invoked if you are absolutely sure the index is in bounds, to avoid a bounds check for a small boost of performance.


[View source]