From c6582e9f51926a374144f2dadabbf5ff74d32b6a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 9 Oct 2025 09:25:47 +0530 Subject: [PATCH] ... --- tools/utils/images/to_rgb.go | 12 ------------ tools/utils/images/to_rgba.go | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tools/utils/images/to_rgb.go b/tools/utils/images/to_rgb.go index ce78db7f3..649506e27 100644 --- a/tools/utils/images/to_rgb.go +++ b/tools/utils/images/to_rgb.go @@ -438,15 +438,3 @@ func NewNRGBWithContiguousRGBPixels(p []byte, width, height int) (*NRGB, error) Rect: image.Rectangle{image.Point{}, image.Point{width, height}}, }, nil } - -func NewNRGBAWithContiguousRGBAPixels(p []byte, width, height int) (*image.NRGBA, error) { - const bpp = 4 - if expected := bpp * width * height; expected != len(p) { - return nil, fmt.Errorf("the image width and height dont match the size of the specified pixel data: width=%d height=%d sz=%d != %d", width, height, len(p), expected) - } - return &image.NRGBA{ - Pix: p, - Stride: bpp * width, - Rect: image.Rectangle{image.Point{}, image.Point{width, height}}, - }, nil -} diff --git a/tools/utils/images/to_rgba.go b/tools/utils/images/to_rgba.go index 77606a629..b12e11984 100644 --- a/tools/utils/images/to_rgba.go +++ b/tools/utils/images/to_rgba.go @@ -405,3 +405,15 @@ func FitImage(width, height, pwidth, pheight int) (final_width int, final_height return width, height } + +func NewNRGBAWithContiguousRGBAPixels(p []byte, width, height int) (*image.NRGBA, error) { + const bpp = 4 + if expected := bpp * width * height; expected != len(p) { + return nil, fmt.Errorf("the image width and height dont match the size of the specified pixel data: width=%d height=%d sz=%d != %d", width, height, len(p), expected) + } + return &image.NRGBA{ + Pix: p, + Stride: bpp * width, + Rect: image.Rectangle{image.Point{}, image.Point{width, height}}, + }, nil +}