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) 'feTile' filter effect tag.
011 <div>
012 From <a href='http://www.w3.org/TR/2003/REC-SVG11-20030114/filters.html#feTile'>
013 http://www.w3.org/TR/2003/REC-SVG11-20030114/filters.html#feTile</a>:
014 </div>
015 <div style='font-style:italic'>
016 <p>
017 "This filter primitive fills a target rectangle with a repeated, tiled pattern of an
018 input image. The target rectangle is as large as the filter primitive subregion
019 established by the x, y, width and height attributes on the 'feTile' element.
020 </p>
021 <p>
022 Typically, the input image has been defined with its own filter primitive subregion
023 in order to define a reference tile. 'feTile' replicates the reference tile in both
024 X and Y to completely fill the target rectangle. The top/left corner of each given
025 tile is at location (x+i*width,y+j*height), where (x,y) represents the top/left of
026 the input image's filter primitive subregion, width and height represent the width
027 and height of the input image's filter primitive subregion, and i and j can be any
028 integer value. In most cases, the input image will have a smaller filter primitive
029 subregion than the 'feTile' in order to achieve a repeated pattern effect.
030 </p>
031 <p>
032 Implementers must take appropriate measures in constructing the tiled image to avoid
033 artifacts between tiles, particularly in situations where the user to device transform
034 includes shear and/or rotation. Unless care is taken, interpolation can lead to edge
035 pixels in the tile having opacity values lower or higher than expected due to the
036 interaction of painting adjacent tiles which each have partial overlap with particular pixels."
037 </p>
038 </div>
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 class SvgFeTile extends AbstractSvgNode
063{
064   //###########################################################################
065   // CONSTRUCTORS
066   //###########################################################################
067
068   //---------------------------------------------------------------------------
069   public SvgFeTile()
070   {
071      super(SVG.feTile);
072   }
073
074   //---------------------------------------------------------------------------
075   public SvgFeTile(XMLTag inXMLTag)
076   {
077      this();
078      initFromXMLTag(inXMLTag);
079   }
080
081   //###########################################################################
082   // PUBLIC METHODS
083   //###########################################################################
084
085   //---------------------------------------------------------------------------
086   public SvgFeTile setColorInterpolationFilters(ColorInterpolationFilters inValue)
087   {
088      setAttribute(SvgAttr.colorInterpolationFilters, inValue);
089      return this;
090   }
091
092   //---------------------------------------------------------------------------
093   public SvgFeTile setIn(FeInput inValue)
094   {
095      setAttribute(SvgAttr.in, inValue);
096      return this;
097   }
098
099   //---------------------------------------------------------------------------
100   public SvgFeTile setHeight(int inValue)
101   {
102      setAttribute(SvgAttr.height, inValue);
103      return this;
104   }
105
106   //---------------------------------------------------------------------------
107   public SvgFeTile setHeight(String inValue)
108   {
109      setAttribute(SvgAttr.height, inValue);
110      return this;
111   }
112
113   //---------------------------------------------------------------------------
114   public SvgFeTile setResult(String inValue)
115   {
116      setAttribute(SvgAttr.result, inValue);
117      return this;
118   }
119
120   //---------------------------------------------------------------------------
121   public SvgFeTile setWidth(int inValue)
122   {
123      setAttribute(SvgAttr.width, inValue);
124      return this;
125   }
126
127   //---------------------------------------------------------------------------
128   public SvgFeTile setWidth(String inValue)
129   {
130      setAttribute(SvgAttr.width, inValue);
131      return this;
132   }
133
134   //---------------------------------------------------------------------------
135   public SvgFeTile setX(int inValue)
136   {
137      setAttribute(SvgAttr.x, inValue);
138      return this;
139   }
140
141   //---------------------------------------------------------------------------
142   public SvgFeTile setX(String inValue)
143   {
144      setAttribute(SvgAttr.x, inValue);
145      return this;
146   }
147
148
149   //---------------------------------------------------------------------------
150   public SvgFeTile setY(int inValue)
151   {
152      setAttribute(SvgAttr.y, inValue);
153      return this;
154   }
155
156   //---------------------------------------------------------------------------
157   public SvgFeTile setY(String inValue)
158   {
159      setAttribute(SvgAttr.y, inValue);
160      return this;
161   }
162
163
164}