Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib/intern/math_color_blend_inline.c')
-rw-r--r--source/blender/blenlib/intern/math_color_blend_inline.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/source/blender/blenlib/intern/math_color_blend_inline.c b/source/blender/blenlib/intern/math_color_blend_inline.c
index 048ab71c6dc..1af2a0cd6a2 100644
--- a/source/blender/blenlib/intern/math_color_blend_inline.c
+++ b/source/blender/blenlib/intern/math_color_blend_inline.c
@@ -439,12 +439,12 @@ MINLINE void blend_color_vividlight_byte(unsigned char dst[4], unsigned const ch
int temp;
if (src2[i] == 255) {
- temp = 255;
+ temp = (src1[i] == 0) ? 127 : 255;
}
else if (src2[i] == 0) {
- temp = 0;
+ temp = (src1[i] == 255) ? 127 : 0;
}
- else if (src2[i] > 127) {
+ else if (src2[i] > 127) {
temp = min_ii(((src1[i]) * 255) / (2 * (255 - src2[i])), 255);
}
else {
@@ -784,7 +784,7 @@ MINLINE void blend_color_add_alpha_float(float dst[4], const float src1[4], cons
MINLINE void blend_color_overlay_float(float dst[4], const float src1[4], const float src2[4])
{
const float fac = src2[3];
- if (fac != 0.0f && fac < 1.0f) {
+ if (fac != 0.0f) {
const float mfac = 1.0f - fac;
int i = 3;
@@ -810,7 +810,7 @@ MINLINE void blend_color_overlay_float(float dst[4], const float src1[4], const
MINLINE void blend_color_hardlight_float(float dst[4], const float src1[4], const float src2[4])
{
const float fac = src2[3];
- if (fac != 0.0f && fac < 1.0f) {
+ if (fac != 0.0f) {
const float mfac = 1.0f - fac;
int i = 3;
@@ -835,7 +835,7 @@ MINLINE void blend_color_hardlight_float(float dst[4], const float src1[4], cons
MINLINE void blend_color_burn_float(float dst[4], const float src1[4], const float src2[4])
{
const float fac = src2[3];
- if (fac != 0.0f && fac < 1.0f) {
+ if (fac != 0.0f) {
const float mfac = 1.0f - fac;
int i = 3;
@@ -853,7 +853,7 @@ MINLINE void blend_color_burn_float(float dst[4], const float src1[4], const flo
MINLINE void blend_color_linearburn_float(float dst[4], const float src1[4], const float src2[4])
{
const float fac = src2[3];
- if (fac != 0.0f && fac < 1.0f) {
+ if (fac != 0.0f) {
const float mfac = 1.0f - fac;
int i = 3;
@@ -872,7 +872,7 @@ MINLINE void blend_color_linearburn_float(float dst[4], const float src1[4], con
MINLINE void blend_color_dodge_float(float dst[4], const float src1[4], const float src2[4])
{
const float fac = src2[3];
- if (fac != 0.0f && fac < 1.0f) {
+ if (fac != 0.0f) {
const float mfac = 1.0f - fac;
int i = 3;
@@ -890,7 +890,7 @@ MINLINE void blend_color_dodge_float(float dst[4], const float src1[4], const fl
MINLINE void blend_color_screen_float(float dst[4], const float src1[4], const float src2[4])
{
const float fac = src2[3];
- if (fac != 0.0f && fac < 1.0f) {
+ if (fac != 0.0f) {
const float mfac = 1.0f - fac;
int i = 3;
@@ -908,7 +908,7 @@ MINLINE void blend_color_screen_float(float dst[4], const float src1[4], const f
MINLINE void blend_color_softlight_float(float dst[4], const float src1[4], const float src2[4])
{
const float fac = src2[3];
- if (fac != 0.0f && fac < 1.0f) {
+ if (fac != 0.0f) {
const float mfac = 1.0f - fac;
int i = 3;
@@ -933,7 +933,7 @@ MINLINE void blend_color_softlight_float(float dst[4], const float src1[4], cons
MINLINE void blend_color_pinlight_float(float dst[4], const float src1[4], const float src2[4])
{
const float fac = src2[3];
- if (fac != 0.0f && fac < 1.0f) {
+ if (fac != 0.0f) {
const float mfac = 1.0f - fac;
int i = 3;
@@ -959,7 +959,7 @@ MINLINE void blend_color_pinlight_float(float dst[4], const float src1[4], const
MINLINE void blend_color_linearlight_float(float dst[4], const float src1[4], const float src2[4])
{
const float fac = src2[3];
- if (fac != 0.0f && fac < 1.0f) {
+ if (fac != 0.0f) {
const float mfac = 1.0f - fac;
int i = 3;
@@ -985,7 +985,7 @@ MINLINE void blend_color_linearlight_float(float dst[4], const float src1[4], co
MINLINE void blend_color_vividlight_float(float dst[4], const float src1[4], const float src2[4])
{
const float fac = src2[3];
- if (fac != 0.0f && fac < 1.0f) {
+ if (fac != 0.0f) {
const float mfac = 1.0f - fac;
int i = 3;
@@ -993,10 +993,10 @@ MINLINE void blend_color_vividlight_float(float dst[4], const float src1[4], con
float temp;
if (src2[i] == 1.0f) {
- temp = 1.0f;
+ temp = (src1[i] == 0.0f) ? 0.5f : 1.0f;
}
else if (src2[i] == 0.0f) {
- temp = 0.0f;
+ temp = (src1[i] == 1.0f) ? 0.5f : 0.0f;
}
else if (src2[i] > 0.5f) {
temp = min_ff(((src1[i]) * 1.0f) / (2.0f * (1.0f - src2[i])), 1.0f);
@@ -1016,7 +1016,7 @@ MINLINE void blend_color_vividlight_float(float dst[4], const float src1[4], con
MINLINE void blend_color_difference_float(float dst[4], const float src1[4], const float src2[4])
{
const float fac = src2[3];
- if (fac != 0.0f && fac < 1.0f) {
+ if (fac != 0.0f) {
const float mfac = 1.0f - fac;
int i = 3;
@@ -1034,7 +1034,7 @@ MINLINE void blend_color_difference_float(float dst[4], const float src1[4], con
MINLINE void blend_color_exclusion_float(float dst[4], const float src1[4], const float src2[4])
{
const float fac = src2[3];
- if (fac != 0.0f && fac < 1.0f) {
+ if (fac != 0.0f) {
const float mfac = 1.0f - fac;
int i = 3;
@@ -1053,7 +1053,7 @@ MINLINE void blend_color_exclusion_float(float dst[4], const float src1[4], cons
MINLINE void blend_color_color_float(float dst[4], const float src1[4], const float src2[4])
{
const float fac = src2[3];
- if (fac != 0.0f && fac < 1.0f) {
+ if (fac != 0.0f) {
const float mfac = 1.0f - fac;
float h1, s1, v1;
float h2, s2, v2;
@@ -1081,7 +1081,7 @@ MINLINE void blend_color_color_float(float dst[4], const float src1[4], const fl
MINLINE void blend_color_hue_float(float dst[4], const float src1[4], const float src2[4])
{
const float fac = src2[3];
- if (fac != 0.0f && fac < 1.0f) {
+ if (fac != 0.0f) {
const float mfac = 1.0f - fac;
float h1, s1, v1;
float h2, s2, v2;
@@ -1107,7 +1107,7 @@ MINLINE void blend_color_hue_float(float dst[4], const float src1[4], const floa
MINLINE void blend_color_saturation_float(float dst[4], const float src1[4], const float src2[4])
{
const float fac = src2[3];
- if (fac != 0.0f && fac < 1.0f) {
+ if (fac != 0.0f) {
const float mfac = 1.0f - fac;
float h1, s1, v1;
float h2, s2, v2;
@@ -1134,7 +1134,7 @@ MINLINE void blend_color_saturation_float(float dst[4], const float src1[4], con
MINLINE void blend_color_luminosity_float(float dst[4], const float src1[4], const float src2[4])
{
const float fac = src2[3];
- if (fac != 0.0f && fac < 1.0f) {
+ if (fac != 0.0f) {
const float mfac = 1.0f - fac;
float h1, s1, v1;
float h2, s2, v2;