module CrImage::Operation::Rotate

Overview

Rotates an image

Taking sample image:

Woman with black turtleneck and white background
image.rotate(45)
image.rotate(45, pad: true)
Rotated image by 45 degrees Rotated image by 45 degrees, padded to show corners

Direct including types

Defined in:

cr-image/operation/rotate.cr

Instance Method Summary

Instance Method Detail

def rotate(degrees : Float64, *, center_x : Int32 = width // 2, center_y : Int32 = height // 2, radius : Int32 = -1, pad : Bool = false, pad_type : EdgePolicy = EdgePolicy::Black) : self #

Rotates an image by degrees

center_x and center_y represents the point in the image that will be rotated around. Defaults to image center. radius can be used to only rotate a smaller circular region in the image. Can't be used with pad pad can be used to pad out the image so that corners that would normally be occluded, are visible. pad_type behaves the same as pad_type in Pad


[View source]
def rotate!(degrees : Float64, *, center_x : Int32 = width // 2, center_y : Int32 = height // 2, radius : Int32 = -1, pad : Bool = false, pad_type : EdgePolicy = EdgePolicy::Black) : self #

Rotates an image by degrees. Modifies self

center_x and center_y represents the point in the image that will be rotated around. Defaults to image center. radius can be used to only rotate a smaller circular region in the image. Can't be used with pad pad can be used to pad out the image so that corners that would normally be occluded, are visible. pad_type behaves the same as pad_type in Pad


[View source]