mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Merge pull request #6 from radarhere/bc6h_gamma
Removed gamma correction
This commit is contained in:
commit
00d59a9867
Binary file not shown.
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 25 KiB |
Binary file not shown.
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 25 KiB |
|
@ -688,11 +688,6 @@ bc6_clamp(float value) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static float
|
|
||||||
bc6_gamma_correct(float value, float gamma) {
|
|
||||||
return powf(1.0f - expf(-value), 1.0f / gamma);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
bc6_lerp(rgba *col, int *e0, int *e1, int s, int sign) {
|
bc6_lerp(rgba *col, int *e0, int *e1, int s, int sign) {
|
||||||
int r, g, b;
|
int r, g, b;
|
||||||
|
@ -700,9 +695,9 @@ bc6_lerp(rgba *col, int *e0, int *e1, int s, int sign) {
|
||||||
r = (e0[0] * t + e1[0] * s) >> 6;
|
r = (e0[0] * t + e1[0] * s) >> 6;
|
||||||
g = (e0[1] * t + e1[1] * s) >> 6;
|
g = (e0[1] * t + e1[1] * s) >> 6;
|
||||||
b = (e0[2] * t + e1[2] * s) >> 6;
|
b = (e0[2] * t + e1[2] * s) >> 6;
|
||||||
col->r = bc6_clamp(bc6_gamma_correct(bc6_finalize(r, sign), 2.2f));
|
col->r = bc6_clamp(bc6_finalize(r, sign));
|
||||||
col->g = bc6_clamp(bc6_gamma_correct(bc6_finalize(g, sign), 2.2f));
|
col->g = bc6_clamp(bc6_finalize(g, sign));
|
||||||
col->b = bc6_clamp(bc6_gamma_correct(bc6_finalize(b, sign), 2.2f));
|
col->b = bc6_clamp(bc6_finalize(b, sign));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue
Block a user