imagecodec

package
v0.3.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package imagecodec 提供生成图片输出的 PNG 编码与 CatmullRom 缩放,热点循环由 amd64 AVX2 与 arm64 NEON 汇编实现,PNG 的过滤与解压后数据和 image/png 逐字节相同,缩放与 x/image/draw 逐像素相同

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodePNG

func EncodePNG(w io.Writer, m image.Image) error

EncodePNG 把 m 编码为 PNG,各行过滤与解压后的数据与 png.Encode 逐字节相同,压缩分段并行;没有 SIMD 内核时与快速路径之外的图片类型由 png.Encode 编码

func Scale

func Scale(src image.Image, sr image.Rectangle, size image.Point) *image.RGBA

Scale 以 CatmullRom 把 src 的 sr 区域缩放为 size 大小的 RGBA 图片,结果与 draw.CatmullRom.Scale(dst, dst.Bounds(), src, sr, draw.Src, nil) 逐像素相同;没有 SIMD 内核时与其余源图类型由该函数缩放

func YCbCrToRGBA

func YCbCrToRGBA(m *image.YCbCr) *image.RGBA

YCbCrToRGBA 把 m 转为不透明的 *image.RGBA,与 draw.Draw 以 draw.Src 画到 *image.RGBA 的结果逐字节相同;没有 SIMD 内核、子采样比不受支持或起点不在原点时由 draw.Draw 转换

Types

This section is empty.

Directories

Path Synopsis
Package jpeg 是 Go 1.27 image/jpeg 解码器的分支:输入为内存中的整段数据,顺序扫描的熵解码改为 64 位位缓冲与查表,IDCT 由 amd64 AVX2 与 arm64 NEON 汇编实现,输出与 image/jpeg 逐像素相同
Package jpeg 是 Go 1.27 image/jpeg 解码器的分支:输入为内存中的整段数据,顺序扫描的熵解码改为 64 位位缓冲与查表,IDCT 由 amd64 AVX2 与 arm64 NEON 汇编实现,输出与 image/jpeg 逐像素相同
Package libwebp 经 cgo 调用 libwebp 编码有损 WebP
Package libwebp 经 cgo 调用 libwebp 编码有损 WebP

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL