001package com.hfg.svg.filtereffect; 002 003 004//------------------------------------------------------------------------------ 005/** 006 Enumeration of SVG (Scalable Vector Graphics) filter effect image blending modes. 007 008 009 From <a href='http://www.w3.org/TR/2003/REC-SVG11-20030114/filters.html#feBlend'> 010 http://www.w3.org/TR/2003/REC-SVG11-20030114/filters.html#feBlend</a>: 011 <p> 012 For all feBlend modes, the result opacity is computed as follows: 013 014 <code> 015 qr = 1 - (1-qa)*(1-qb) 016 </code> 017 018 For the compositing formulas below, the following definitions apply: 019 020 <code> 021 cr = Result color (RGB) - premultiplied 022 qa = Opacity value at a given pixel for image A 023 qb = Opacity value at a given pixel for image B 024 ca = Color (RGB) at a given pixel for image A - premultiplied 025 cb = Color (RGB) at a given pixel for image B - premultiplied 026 The following table provides the list of available image blending modes: 027 </code> 028 029 Image Blending Mode Formula for computing result color 030 <table> 031 <caption>Image Blending Mode Formula for computing result color</caption> 032 <tr><td>normal</td><td>cr = (1 - qa) * cb + ca</td></tr> 033 <tr><td>multiply</td><td>cr = (1-qa)*cb + (1-qb)*ca + ca*cb</td></tr> 034 <tr><td>screen</td><td>cr = cb + ca - ca * cb</td></tr> 035 <tr><td>darken</td><td>cr = Min ((1 - qa) * cb + ca, (1 - qb) * ca + cb)</td></tr> 036 <tr><td>lighten</td><td>cr = Max ((1 - qa) * cb + ca, (1 - qb) * ca + cb)</td></tr> 037 </table> 038 039 @author J. Alex Taylor, hairyfatguy.com 040 */ 041//------------------------------------------------------------------------------ 042// com.hfg XML/HTML Coding Library 043// 044// This library is free software; you can redistribute it and/or 045// modify it under the terms of the GNU Lesser General Public 046// License as published by the Free Software Foundation; either 047// version 2.1 of the License, or (at your option) any later version. 048// 049// This library is distributed in the hope that it will be useful, 050// but WITHOUT ANY WARRANTY; without even the implied warranty of 051// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 052// Lesser General Public License for more details. 053// 054// You should have received a copy of the GNU Lesser General Public 055// License along with this library; if not, write to the Free Software 056// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 057// 058// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com 059// jataylor@hairyfatguy.com 060//------------------------------------------------------------------------------ 061 062public enum ImageBlendingMode 063{ 064 normal, 065 multiply, 066 screen, 067 darken, 068 lighten 069}