From 5d142d7fe97d1b30ee87b1c76bcfe93b7e73ac96 Mon Sep 17 00:00:00 2001 From: Troy Sornson Date: Fri, 7 Jul 2023 21:39:55 -0600 Subject: [PATCH] Add TODOs, fix documentation image links --- src/cr-image/operation/bilinear_resize.cr | 1 + src/cr-image/operation/pad.cr | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cr-image/operation/bilinear_resize.cr b/src/cr-image/operation/bilinear_resize.cr index 7271441..f711510 100644 --- a/src/cr-image/operation/bilinear_resize.cr +++ b/src/cr-image/operation/bilinear_resize.cr @@ -22,6 +22,7 @@ module CrImage::Operation::BilinearResize x_ratio = width > 1 ? (@width - 1) / (width - 1) : 0 y_ratio = height > 1 ? (@height - 1) / (height - 1) : 0 + # TODO: resize alpha channel each_color_channel do |channel, channel_type| resized_channel = Array.new(width * height) { 0u8 } diff --git a/src/cr-image/operation/pad.cr b/src/cr-image/operation/pad.cr index ec63716..0a7a1e1 100644 --- a/src/cr-image/operation/pad.cr +++ b/src/cr-image/operation/pad.cr @@ -8,7 +8,6 @@ # image.pad(left: 50, right: 50) # image.pad(left: 50, right: 50, pad_type: CrImage::EdgePolicy::Repeat) # ``` -# ``` # Picture with black padding on left and right # Picture with repeated padding on left and right module CrImage::Operation::Pad @@ -21,6 +20,7 @@ module CrImage::Operation::Pad new_width = width new_height = height # puts "Memory start: #{GC.stats.total_bytes - mem_start}" + # TODO: resize alpha channel each_color_channel do |channel, channel_type| padded = UInt8Map.new(width, channel).pad(all, top: top, bottom: bottom, left: left, right: right, pad_type: pad_type) self[channel_type] = padded.raw