代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/ImageMagick 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 83cd04f580ccf4cc194813777c1fcfba78e602aa Mon Sep 17 00:00:00 2001
From: Cristy <urban-warrior@imagemagick.org>
Date: Fri, 4 Oct 2019 18:04:09 -0400
Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/1717
---
magick/enhance.c | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/magick/enhance.c b/magick/enhance.c
index a100cf8b7..614269e3a 100644
--- a/magick/enhance.c
+++ b/magick/enhance.c
@@ -2207,7 +2207,8 @@ MagickExport MagickBooleanType GammaImageChannel(Image *image,
if (gamma != 0.0)
for (i=0; i <= (ssize_t) MaxMap; i++)
gamma_map[i]=ClampToQuantum((MagickRealType) ScaleMapToQuantum((
- MagickRealType) (MaxMap*pow((double) i/MaxMap,1.0/gamma))));
+ MagickRealType) (MaxMap*pow((double) i/MaxMap,
+ PerceptibleReciprocal(gamma)))));
if (image->storage_class == PseudoClass)
{
/*
@@ -2238,18 +2239,18 @@ MagickExport MagickBooleanType GammaImageChannel(Image *image,
#else
if ((channel & RedChannel) != 0)
image->colormap[i].red=QuantumRange*gamma_pow(QuantumScale*
- image->colormap[i].red,1.0/gamma);
+ image->colormap[i].red,PerceptibleReciprocal(gamma));
if ((channel & GreenChannel) != 0)
image->colormap[i].green=QuantumRange*gamma_pow(QuantumScale*
- image->colormap[i].green,1.0/gamma);
+ image->colormap[i].green,PerceptibleReciprocal(gamma));
if ((channel & BlueChannel) != 0)
image->colormap[i].blue=QuantumRange*gamma_pow(QuantumScale*
- image->colormap[i].blue,1.0/gamma);
+ image->colormap[i].blue,PerceptibleReciprocal(gamma));
if ((channel & OpacityChannel) != 0)
{
if (image->matte == MagickFalse)
image->colormap[i].opacity=QuantumRange*gamma_pow(QuantumScale*
- image->colormap[i].opacity,1.0/gamma);
+ image->colormap[i].opacity,PerceptibleReciprocal(gamma));
else
image->colormap[i].opacity=QuantumRange-QuantumRange*gamma_pow(
QuantumScale*(QuantumRange-image->colormap[i].opacity),1.0/
@@ -2319,31 +2320,31 @@ MagickExport MagickBooleanType GammaImageChannel(Image *image,
if ((channel & SyncChannels) != 0)
{
SetPixelRed(q,QuantumRange*gamma_pow(QuantumScale*GetPixelRed(q),
- 1.0/gamma));
+ PerceptibleReciprocal(gamma)));
SetPixelGreen(q,QuantumRange*gamma_pow(QuantumScale*GetPixelGreen(q),
- 1.0/gamma));
+ PerceptibleReciprocal(gamma)));
SetPixelBlue(q,QuantumRange*gamma_pow(QuantumScale*GetPixelBlue(q),
- 1.0/gamma));
+ PerceptibleReciprocal(gamma)));
}
else
{
if ((channel & RedChannel) != 0)
SetPixelRed(q,QuantumRange*gamma_pow(QuantumScale*GetPixelRed(q),
- 1.0/gamma));
+ PerceptibleReciprocal(gamma)));
if ((channel & GreenChannel) != 0)
SetPixelGreen(q,QuantumRange*gamma_pow(QuantumScale*
- GetPixelGreen(q),1.0/gamma));
+ GetPixelGreen(q),PerceptibleReciprocal(gamma)));
if ((channel & BlueChannel) != 0)
SetPixelBlue(q,QuantumRange*gamma_pow(QuantumScale*GetPixelBlue(q),
- 1.0/gamma));
+ PerceptibleReciprocal(gamma)));
if ((channel & OpacityChannel) != 0)
{
if (image->matte == MagickFalse)
SetPixelOpacity(q,QuantumRange*gamma_pow(QuantumScale*
- GetPixelOpacity(q),1.0/gamma));
+ GetPixelOpacity(q),PerceptibleReciprocal(gamma)));
else
SetPixelAlpha(q,QuantumRange*gamma_pow(QuantumScale*
- GetPixelAlpha(q),1.0/gamma));
+ GetPixelAlpha(q),PerceptibleReciprocal(gamma)));
}
}
#endif
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。