class Blend2D::Rendering::Context

Defined in:

blend2d/rendering/context.cr

Constructors

Instance Method Summary

Instance methods inherited from class Blend2D::BLStructure

finalize finalize, pointer : Pointer pointer

Constructor Detail

def self.new(image : Image) #

Initialize the context using the given Image.


[View source]

Instance Method Detail

def blit(image : Image, point : PointI, area : RectI | Nil = nil) #

Blit an image onto the canvas.


[View source]
def blit(image : Image, point : Point, area : RectI | Nil = nil) #

Blit an image onto the canvas.


[View source]
def blit(image : Image, rect : RectI, area : RectI | Nil = nil) #

Blit an image onto the canvas.


[View source]
def blit(image : Image, rect : Rect, area : RectI | Nil = nil) #

Blit an image onto the canvas.


[View source]
def clear_all #

Clear the context.


[View source]
def clear_rect(rect : RectI) #

Clear an area of the context defined by a RectI.


[View source]
def clear_rect(rect : Rect) #

Clear an area of the context defined by a Rect.


[View source]
def clip_to_rect(rect : RectI) #

Clip the context to a RectI.


[View source]
def clip_to_rect(rect : Rect) #

Clip the context to a Rect.


[View source]
def composition_operator=(operator : CompositionOperator) #

Set the composition operator of this context using CompositionOperator.


[View source]
def end #

Ends this context.


[View source]
def fill_all #

Fill the entire context.


[View source]
def fill_alpha=(alpha) #

Set the fill alpha of this context.


[View source]
def fill_geometry(geometry : GeometryType) #

Fill some geometry given a GeometryType, an abstract class that can not be initialized. Instead, pass a deriving class, like RoundRect or Ellipse.


[View source]
def fill_glyph_run(point : PointI, font : Font, run : GlyphRun) #

Fill some text given a PointI, Font, and GlyphRun.


[View source]
def fill_glyph_run(point : Point, font : Font, run : GlyphRun) #

Fill some text given a Point, Font, and GlyphRun.


[View source]
def fill_path(path : Path) #

Fill a Path.


[View source]
def fill_rect(rect : RectI) #

Fill a RectI.


[View source]
def fill_rect(rect : Rect) #

Fill a Rect.


[View source]
def fill_style=(color : RGBA32) #

Set the fill color of this context using a color of RGBA32.


[View source]
def fill_style=(color : RGBA64) #

Set the fill color of this context using a color of RGBA64.


[View source]
def fill_style=(gradient : Gradient) #

Set the fill style of this context to a Gradient.


[View source]
def fill_style=(pattern : Pattern) #

Set the fill style of this context to a Pattern.


[View source]
def fill_text(point : PointI, font : Font, text : String, encoding : TextEncoding = TextEncoding::UTF8) #

Fill some text given a PointI, Font, and String.


[View source]
def fill_text(point : Point, font : Font, text : String, encoding : TextEncoding = TextEncoding::UTF8) #

Fill some text given a Point, Font, and String.


[View source]
def finalize #
Description copied from class Blend2D::BLStructure

Called when Crystal's garbage collector collects this instance.


[View source]
def global_alpha=(alpha) #

Set the global alpha of this context.


[View source]
def matrix_operation(operation : MatrixOperation, data : Array(Float64)) #

Apply a matrix operation (one of MatrixOperation), and pass an array of Float64s to specify parameters.


[View source]
def reset_matrix #

Reset the context's matrix.


[View source]
def restore(cookie : ContextCookie) #

Restore this context from a ContextCookie.


[View source]
def restore_clipping #

Restore the clipping on the context.


[View source]
def rotate(angle : Float64, cx : Float64, cy : Float64) #

Rotate the context about a point defined by two doubles.


[View source]
def rotate(angle : Float64, point : PointI) #

Rotate the context about a point.


[View source]
def rotate(angle : Float64, point : Point) #

Rotate the context about a point.


[View source]
def rotate(angle : Float64) #

Rotate the context.


[View source]
def save : ContextCookie #

Save this context into a ContextCookie.


[View source]
def scale(x : Float64, y : Float64) #

Scale the context's matrix by (x, y).


[View source]
def scale(factor : Float64) #

Scale the context's matrix by a factor equivalent for both x and y.


[View source]
def set_stroke_cap(position : StrokeCapPosition, cap : StrokeCap) #

Set one of the context's stroke caps, given a StrokeCapPosition and a StrokeCap.


[View source]
def skew(x : Float64, y : Float64) #

Skew the context's matrix by (x, y).


[View source]
def stroke_alpha=(alpha) #

Set the stroke alpha of this context.


[View source]
def stroke_caps=(cap : StrokeCap) #

Set both of the context's stroke caps given a StrokeCap.


[View source]
def stroke_dash_offset=(dash_offset) #

Set the stroke dash offset.


[View source]
def stroke_end_cap=(cap : StrokeCap) #

Equivalent to #set_stroke_cap, passing StrokeCapPosition::End as the first argument.


[View source]
def stroke_geometry(geometry : GeometryType) #

Stroke some geometry given a GeometryType, an abstract class that can not be initialized. Instead, pass a deriving class, like RoundRect or Ellipse.


[View source]
def stroke_glyph_run(point : PointI, font : Font, run : GlyphRun) #

Stroke some text given a PointI, Font, and GlyphRun.


[View source]
def stroke_glyph_run(point : Point, font : Font, run : GlyphRun) #

Stroke some text given a Point, Font, and GlyphRun.


[View source]
def stroke_join=(join : StrokeJoin) #

Set the stroke join method.


[View source]
def stroke_miter_limit=(miter_limit) #

Set this context's miter limit.


[View source]
def stroke_options #

Fetch the context's stroke options.


[View source]
def stroke_options=(options : StrokeOptions) #

Set the context's stroke options. It must first be fetched using #stroke_options.


[View source]
def stroke_path(path : Path) #

Stroke a Path.


[View source]
def stroke_rect(rect : RectI) #

Stroke a RectI.


[View source]
def stroke_rect(rect : Rect) #

Stroke a Rect.


[View source]
def stroke_start_cap=(cap : StrokeCap) #

Equivalent to #set_stroke_cap, passing StrokeCapPosition::Start as the first argument.


[View source]
def stroke_style=(color : RGBA32) #

Set the stroke color of this context.


[View source]
def stroke_style=(color : RGBA64) #

Set the stroke color of this context.


[View source]
def stroke_style=(gradient : Gradient) #

Set the stroke style of this context to a Gradient.


[View source]
def stroke_style=(pattern : Pattern) #

Set the stroke style of this context to a Pattern.


[View source]
def stroke_text(point : PointI, font : Font, text : String, encoding : TextEncoding = TextEncoding::UTF8) #

Stroke some text given a PointI, Font, and String.


[View source]
def stroke_text(point : Point, font : Font, text : String, encoding : TextEncoding = TextEncoding::UTF8) #

Stroke some text given a Point, Font, and String.


[View source]
def stroke_width=(width) #

Set this context's stroke width.


[View source]
def transform(matrix : Matrix) #

Transform the context using another matrix.


[View source]
def translate(x : Float64, y : Float64) #

Translate the context's matrix by (x, y).


[View source]
def translate(point : PointI) #

Translate the context's matrix by the point's coordinates.


[View source]
def translate(point : Point) #

Translate the context's matrix by the point's coordinates.


[View source]