[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/koffice/1.6/koffice/krita/kritacolor/colorspaces
From: Bart Coppens <kde () bartcoppens ! be>
Date: 2006-08-27 23:25:23
Message-ID: 1156721123.106688.9969.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 577953 by coppens:
Fix the alpha darken for the alpha colorspace, now paint indirectly also works \
perfectly with adjustment layers (barring the fact that the selection drawing doesn't \
quite get that yet; but that'll get disabled for the release anyway). Thanks again to \
Ilmari Heikkinen (kig) for the suggestion.
M +11 -34 kis_alpha_colorspace.cc
--- branches/koffice/1.6/koffice/krita/kritacolor/colorspaces/kis_alpha_colorspace.cc \
#577952:577953 @@ -195,43 +195,20 @@
}
return;
case COMPOSITE_ALPHA_DARKEN:
- /* XXX ### FIXME
- while (rows > 0) {
- const Q_UINT8 *mask = srcAlphaMask;
- Q_INT32 columns = cols;
-
- while (columns > 0) {
- Q_UINT8 srcAlpha = *src;
- Q_UINT8 dstAlpha = *dst;
-
- // apply the alphamask
- if(mask != 0)
- {
- if(*mask != OPACITY_OPAQUE)
- srcAlpha = UINT8_MULT(srcAlpha, *mask);
- mask++;
- }
-
- if (opacity != OPACITY_OPAQUE) {
- srcAlpha = UINT8_MULT(srcAlpha, opacity);
- }
-
- if (srcAlpha != OPACITY_TRANSPARENT && srcAlpha >= dstAlpha) {
- *dst = srcAlpha;
- }
-
- columns--;
- src++;
- dst++;
+ while (rows-- > 0) {
+ d = dst;
+ s = src;
+ for (i = cols; i > 0; i--, d++, s++) {
+ if (s[PIXEL_MASK] == OPACITY_TRANSPARENT)
+ continue;
+ int srcAlpha = (s[PIXEL_MASK] * opacity + UINT8_MAX / 2) / \
UINT8_MAX; + if (srcAlpha > d[PIXEL_MASK])
+ d[PIXEL_MASK] = srcAlpha;
}
-
- rows--;
- src += srcRowStride;
dst += dststride;
- if(srcAlphaMask)
- srcAlphaMask += maskRowStride;
+ src += srcRowStride;
}
- return;*/
+ return;
case COMPOSITE_OVER:
default:
if (opacity == OPACITY_TRANSPARENT)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic