001package com.hfg.svg.filtereffect;
002
003import com.hfg.svg.AbstractSvgNode;
004import com.hfg.svg.SVG;
005import com.hfg.svg.SvgAttr;
006import com.hfg.xml.XMLTag;
007
008//------------------------------------------------------------------------------
009/**
010 Object representation of an SVG (Scalable Vector Graphics) 'feComponentTransfer' filter effect tag.
011 <div>
012 From <a href='http://www.w3.org/TR/2003/REC-SVG11-20030114/filters.html#feComponentTransfer'>
013 http://www.w3.org/TR/2003/REC-SVG11-20030114/filters.html#feComponentTransfer</a>:
014 </div>
015 <div style='font-style:italic'>
016 "This filter primitive performs component-wise remapping of data as follows:
017 <pre>
018  R' = feFuncR( R )
019  G' = feFuncG( G )
020  B' = feFuncB( B )
021  A' = feFuncA( A )
022 </pre>
023 <p>
024 for every pixel. It allows operations like brightness adjustment, contrast adjustment,
025 color balance or thresholding.
026 </p>
027 <p>
028 The calculations are performed on non-premultiplied color values. If the input graphics consists
029 of premultiplied color values, those values are automatically converted into non-premultiplied
030 color values for this operation. (Note that the undoing and redoing of the premultiplication
031 can be avoided if feFuncA is the identity transform and all alpha values on the source graphic are set to 1.)"
032 </p>
033 </div>
034 @author J. Alex Taylor, hairyfatguy.com
035 */
036//------------------------------------------------------------------------------
037// com.hfg XML/HTML Coding Library
038//
039// This library is free software; you can redistribute it and/or
040// modify it under the terms of the GNU Lesser General Public
041// License as published by the Free Software Foundation; either
042// version 2.1 of the License, or (at your option) any later version.
043//
044// This library is distributed in the hope that it will be useful,
045// but WITHOUT ANY WARRANTY; without even the implied warranty of
046// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
047// Lesser General Public License for more details.
048//
049// You should have received a copy of the GNU Lesser General Public
050// License along with this library; if not, write to the Free Software
051// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
052//
053// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com
054// jataylor@hairyfatguy.com
055//------------------------------------------------------------------------------
056
057public class SvgFeComponentTransfer extends AbstractSvgNode
058{
059   //###########################################################################
060   // CONSTRUCTORS
061   //###########################################################################
062
063   //---------------------------------------------------------------------------
064   public SvgFeComponentTransfer()
065   {
066      super(SVG.feComponentTransfer);
067   }
068
069   //---------------------------------------------------------------------------
070   public SvgFeComponentTransfer(XMLTag inXMLTag)
071   {
072      this();
073      initFromXMLTag(inXMLTag);
074   }
075
076   //###########################################################################
077   // PUBLIC METHODS
078   //###########################################################################
079
080
081   //---------------------------------------------------------------------------
082   public SvgFeComponentTransfer setIn(FeInput inValue)
083   {
084      setAttribute(SvgAttr.in, inValue);
085      return this;
086   }
087
088   //---------------------------------------------------------------------------
089   public SvgFeComponentTransfer setColorInterpolationFilters(ColorInterpolationFilters inValue)
090   {
091      setAttribute(SvgAttr.colorInterpolationFilters, inValue);
092      return this;
093   }
094
095   //---------------------------------------------------------------------------
096   public SvgFeComponentTransfer setHeight(int inValue)
097   {
098      setAttribute(SvgAttr.height, inValue);
099      return this;
100   }
101
102   //---------------------------------------------------------------------------
103   public SvgFeComponentTransfer setHeight(String inValue)
104   {
105      setAttribute(SvgAttr.height, inValue);
106      return this;
107   }
108
109   //---------------------------------------------------------------------------
110   public SvgFeComponentTransfer setResult(String inValue)
111   {
112      setAttribute(SvgAttr.result, inValue);
113      return this;
114   }
115
116   //---------------------------------------------------------------------------
117   public SvgFeComponentTransfer setWidth(int inValue)
118   {
119      setAttribute(SvgAttr.width, inValue);
120      return this;
121   }
122
123   //---------------------------------------------------------------------------
124   public SvgFeComponentTransfer setWidth(String inValue)
125   {
126      setAttribute(SvgAttr.width, inValue);
127      return this;
128   }
129
130   //---------------------------------------------------------------------------
131   public SvgFeComponentTransfer setX(int inValue)
132   {
133      setAttribute(SvgAttr.x, inValue);
134      return this;
135   }
136
137   //---------------------------------------------------------------------------
138   public SvgFeComponentTransfer setX(String inValue)
139   {
140      setAttribute(SvgAttr.x, inValue);
141      return this;
142   }
143
144
145   //---------------------------------------------------------------------------
146   public SvgFeComponentTransfer setY(int inValue)
147   {
148      setAttribute(SvgAttr.y, inValue);
149      return this;
150   }
151
152   //---------------------------------------------------------------------------
153   public SvgFeComponentTransfer setY(String inValue)
154   {
155      setAttribute(SvgAttr.y, inValue);
156      return this;
157   }
158
159
160   //---------------------------------------------------------------------------
161   public SvgFeFuncR addFeFuncR()
162   {
163      SvgFeFuncR feFunc = new SvgFeFuncR();
164      addSubtag(feFunc);
165      return feFunc;
166   }
167
168   //---------------------------------------------------------------------------
169   public SvgFeFuncG addFeFuncG()
170   {
171      SvgFeFuncG feFunc = new SvgFeFuncG();
172      addSubtag(feFunc);
173      return feFunc;
174   }
175
176   //---------------------------------------------------------------------------
177   public SvgFeFuncB addFeFuncB()
178   {
179      SvgFeFuncB feFunc = new SvgFeFuncB();
180      addSubtag(feFunc);
181      return feFunc;
182   }
183
184   //---------------------------------------------------------------------------
185   public SvgFeFuncA addFeFuncA()
186   {
187      SvgFeFuncA feFunc = new SvgFeFuncA();
188      addSubtag(feFunc);
189      return feFunc;
190   }
191
192}