merging all related stuff here

This commit is contained in:
2026-02-22 01:06:02 +03:00
parent cc5c9c6d1a
commit 352631e071
11 changed files with 110 additions and 71 deletions

48
http/blank/blank.go Normal file
View File

@@ -0,0 +1,48 @@
package blank
import (
"image"
"image/color"
"image/draw"
"git.nkpl.cc/twocookedfaggots/imageutils"
)
type blank struct {
image.Image
color.Color
imageutils.Side
}
func (b blank) ColorModel() color.Model { return b.Image.ColorModel() }
func (b blank) Bounds() image.Rectangle {
rect := image.Rectangle{}
switch b.Side {
case imageutils.Left:
fallthrough
case imageutils.Right:
rect = image.Rectangle{
image.ZP,
image.Point{
1, b.Image.Bounds().Dy(),
},
}
case imageutils.Up:
fallthrough
case imageutils.Down:
rect = image.Rectangle{
image.ZP,
image.Point{
b.Image.Bounds().Dx(), 1,
},
}
}
return rect
}
func (b blank) At(x, y int) color.Color { return b.Color }
func Blank(img image.Image, clr color.Color, side imageutils.Side) image.Image {
return imageutils.Concat(img, blank{img, clr, side}, side)
}