class

CrImage::Pipeline

Inherits Reference / Object

Pipeline provides a fluent API for chaining image operations.

Allows building complex image processing workflows in a readable, chainable manner without intermediate variables.

Example:

result = CrImage::Pipeline.new(img)
  .resize(800, 600)
  .brightness(1.2)
  .contrast(1.1)
  .blur(2)
  .result

Constructors

new(source : Image)
Source

Instance methods

apply

Apply custom operation via block.

Source
blur(radius : Int32 = 3) : self

Apply Gaussian blur.

Source
blur_box(radius : Int32 = 3) : self

Apply box blur.

Source
border(width : Int32, color : Color::Color = Color::WHITE) : self

Add border.

Source
brightness(adjustment : Int32) : self

Adjust brightness (adjustment is added to each channel, -255 to 255).

Source
contrast(factor : Float64) : self

Adjust contrast (factor 0.0 to 2.0, where 1.0 is no change).

Source
crop(x : Int32, y : Int32, width : Int32, height : Int32) : self

Crop the image.

Source
draw_bezier(x1 : Int32, y1 : Int32, cx : Int32, cy : Int32, x2 : Int32, y2 : Int32, color : Color::Color, thickness : Int32 = 1) : self

Draw a bezier curve.

Source
draw_circle(cx : Int32, cy : Int32, radius : Int32, color : Color::Color, fill : Bool = true) : self

Draw a circle.

Source
draw_dashed_line(x1 : Int32, y1 : Int32, x2 : Int32, y2 : Int32, color : Color::Color, dash : Int32 = 5, gap : Int32 = 3) : self

Draw a dashed line.

Source
draw_line(x1 : Int32, y1 : Int32, x2 : Int32, y2 : Int32, color : Color::Color, thickness : Int32 = 1) : self

Draw a line.

Source
draw_polygon(cx : Int32, cy : Int32, radius : Int32, sides : Int32, color : Color::Color, fill : Bool = true) : self

Draw a regular polygon.

Source
draw_rect(x : Int32, y : Int32, width : Int32, height : Int32, color : Color::Color) : self

Draw a filled rectangle.

Source
draw_rounded_rect(x : Int32, y : Int32, width : Int32, height : Int32, color : Color::Color, corner_radius : Int32) : self

Draw a rounded rectangle.

Source
edge_detect(method : Symbol = :sobel) : self

Apply edge detection.

Source
emboss(angle : Float64 = 135.0, depth : Float64 = 1.0) : self

Apply emboss effect.

Source
flip_horizontal

Flip horizontally.

Source
flip_vertical

Flip vertically.

Source
grayscale

Convert to grayscale.

Source
invert

Invert colors.

Source
resize(width : Int32, height : Int32, method : Symbol = :bilinear) : self

Resize the image.

Source
result

Returns the final processed image.

Source
rotate(degrees : Int32) : self

Rotate the image by 90 degree increments.

Source
round_corners(radius : Int32) : self

Round corners.

Source
saturate(factor : Float64) : self

Adjust saturation.

Source
save(path : String, quality : Int32 = 90) : self

Save to file.

Source
scale(factor : Float64, method : Symbol = :bilinear) : self

Scale the image by a factor.

Source
sepia

Apply sepia effect.

Source
sharpen(amount : Float64 = 1.0) : self

Apply sharpening.

Source
temperature(adjustment : Int32) : self

Adjust color temperature.

Source
to_image

Alias for result

Source
vignette(strength : Float64 = 0.5) : self

Apply vignette effect.

Source