浏览代码

Do not touch alpha values when modifying brightness or contrast.

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@3544 92316355-f0b4-4df1-b90c-862c8a59935f
master
sam 15 年前
父节点
当前提交
b473f55d2f
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. +4
    -4
      pipi/filter/color.c

+ 4
- 4
pipi/filter/color.c 查看文件

@@ -70,7 +70,7 @@ pipi_image_t *pipi_brightness(pipi_image_t *src, double val)
p = srcdata[d + 2];
dstdata[d + 2] = p < 1. - val ? p + val : 1.;
p = srcdata[d + 3];
dstdata[d + 3] = p < 1. - val ? p + val : 1.;
dstdata[d + 3] = p;
}
}
}
@@ -98,7 +98,7 @@ pipi_image_t *pipi_brightness(pipi_image_t *src, double val)
p = srcdata[d + 2];
dstdata[d + 2] = p > -val ? p + val : 0.;
p = srcdata[d + 3];
dstdata[d + 3] = p > -val ? p + val : 0.;
dstdata[d + 3] = p;
}
}
}
@@ -156,7 +156,7 @@ pipi_image_t *pipi_contrast(pipi_image_t *src, double val)
p = (srcdata[d + 2] - 0.5) * val + 0.5;
dstdata[d + 2] = p < 0. ? 0. : p > 1. ? 1. : p;
p = (srcdata[d + 3] - 0.5) * val + 0.5;
dstdata[d + 3] = p < 0. ? 0. : p > 1. ? 1. : p;
dstdata[d + 3] = p;
}
}
}
@@ -189,7 +189,7 @@ pipi_image_t *pipi_contrast(pipi_image_t *src, double val)
p = srcdata[d + 2];
dstdata[d + 2] = (p - 0.5) * val + 0.5;
p = srcdata[d + 3];
dstdata[d + 3] = (p - 0.5) * val + 0.5;
dstdata[d + 3] = p;
}
}
}


正在加载...
取消
保存