feat(图像颜色): 优化图像颜色转换性能
build.yaml / build (push) Successful in 51s

This commit is contained in:
xiaoqidun committed 2026-10-16 09:25:35 +08:00
1 parent 33ae0b1a98
commit 365f3ba8f9
2 files changed
+17 -4

No files matched your search

+2 -1
View File
@@ -99,6 +99,7 @@ func applyImageColorProfile(ctx context.Context, source image.Image, profile *pd
model := source.ColorModel()
premultiplied := model == color.RGBAModel || model == color.RGBA64Model
table := newTIFFProfileTable(source)
components, intent := profile.Components(), profile.DefaultIntent()
result := image.NewNRGBA64(bounds)
var previous [4]float64
var previousPixel color.NRGBA64
@@ -174,7 +175,7 @@ func applyImageColorProfile(ctx context.Context, source image.Image, profile *pd
}
}
}
rgb, err := profile.SRGB(values[:profile.Components()], profile.DefaultIntent())
rgb, err := profile.SRGB(values[:components], intent)
if err != nil {
return nil, err
}