Skip to content

Commit

Permalink
Add TODOs, fix documentation image links
Browse files Browse the repository at this point in the history
  • Loading branch information
Vici37 committed Jul 8, 2023
1 parent ee8522f commit 5d142d7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/cr-image/operation/bilinear_resize.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand Down
2 changes: 1 addition & 1 deletion src/cr-image/operation/pad.cr
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
# image.pad(left: 50, right: 50)
# image.pad(left: 50, right: 50, pad_type: CrImage::EdgePolicy::Repeat)
# ```
# ```
# <img src="https://raw.githubusercontent.com/Vici37/cr-image/master/docs/images/pad_black.jpg" alt="Picture with black padding on left and right"/>
# <img src="https://raw.githubusercontent.com/Vici37/cr-image/master/docs/images/pad_repeat.jpg" alt="Picture with repeated padding on left and right"/>
module CrImage::Operation::Pad
Expand All @@ -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
Expand Down

0 comments on commit 5d142d7

Please sign in to comment.