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