Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenlib/intern/math_color_blend_inline.c
| Show First 20 Lines • Show All 600 Lines • ▼ Show 20 Lines | MINLINE void blend_color_interpolate_byte(uchar dst[4], | ||||
| if (tmp > 0) { | if (tmp > 0) { | ||||
| dst[0] = (uchar)divide_round_i(mt * src1[0] * src1[3] + t * src2[0] * src2[3], tmp); | dst[0] = (uchar)divide_round_i(mt * src1[0] * src1[3] + t * src2[0] * src2[3], tmp); | ||||
| dst[1] = (uchar)divide_round_i(mt * src1[1] * src1[3] + t * src2[1] * src2[3], tmp); | dst[1] = (uchar)divide_round_i(mt * src1[1] * src1[3] + t * src2[1] * src2[3], tmp); | ||||
| dst[2] = (uchar)divide_round_i(mt * src1[2] * src1[3] + t * src2[2] * src2[3], tmp); | dst[2] = (uchar)divide_round_i(mt * src1[2] * src1[3] + t * src2[2] * src2[3], tmp); | ||||
| dst[3] = (uchar)divide_round_i(tmp, 255); | dst[3] = (uchar)divide_round_i(tmp, 255); | ||||
| } | } | ||||
| else { | else { | ||||
| copy_v4_v4_uchar(dst, src1); | copy_v4_v4_uchar(dst, src1); | ||||
| dst[3] = 0; | |||||
| } | } | ||||
| } | } | ||||
| /* premultiplied alpha float blending modes */ | /* premultiplied alpha float blending modes */ | ||||
| MINLINE void blend_color_mix_float(float dst[4], const float src1[4], const float src2[4]) | MINLINE void blend_color_mix_float(float dst[4], const float src1[4], const float src2[4]) | ||||
| { | { | ||||
| if (src2[3] != 0.0f) { | if (src2[3] != 0.0f) { | ||||
| ▲ Show 20 Lines • Show All 538 Lines • Show Last 20 Lines | |||||