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 +}