Project

General

Profile

Download (15.7 KB) Statistics
| Branch: | Revision:

library / src / main / java / org / distorted / library / EffectNames.java @ cacc63de

1 d333eb6b Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2016 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Distorted.                                                               //
5
//                                                                                               //
6
// Distorted is free software: you can redistribute it and/or modify                             //
7
// it under the terms of the GNU General Public License as published by                          //
8
// the Free Software Foundation, either version 2 of the License, or                             //
9
// (at your option) any later version.                                                           //
10
//                                                                                               //
11
// Distorted is distributed in the hope that it will be useful,                                  //
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
14
// GNU General Public License for more details.                                                  //
15
//                                                                                               //
16
// You should have received a copy of the GNU General Public License                             //
17
// along with Distorted.  If not, see <http://www.gnu.org/licenses/>.                            //
18
///////////////////////////////////////////////////////////////////////////////////////////////////
19
20 6a06a912 Leszek Koltunski
package org.distorted.library;
21
22
///////////////////////////////////////////////////////////////////////////////////////////////////
23 476bbc81 Leszek Koltunski
/**
24 cacc63de Leszek Koltunski
 * Names of Effects one can add to the DistortedEffects queues.
25 0df17fad Leszek Koltunski
 * <p>
26 b911dc09 Leszek Koltunski
 * Effect's 'Type' is one of the constants defined in {@link EffectTypes}.
27 e25d0dde Leszek Koltunski
 * </p>
28
 * <p>
29 8298e6af Leszek Koltunski
 * Effect's 'Uniforms' are a vector of 7 (matrix effects) 12 (vertex) or 8 (fragment) floats, which
30 e25d0dde Leszek Koltunski
 * together form full information how to compute a given effect.
31
 * Typically, some of those values will be Interpolated in CPU (by one of the 'EffectQueueX.compute()'
32
 * methods) and the effect of such Interpolation sent to the Shaders.
33
 * </p>
34
 * <p>
35
 * Effect's 'Unity' is such a particular vector of its 'interpolated values' which makes the
36
 * effect NULL. For example, if the effect is 'MOVE' by a 3-dimensional vector, then a 'NULL
37
 * MOVE' is a MOVE by vector (0,0,0), thus (0,0,0) is the unity of the MOVE effect.
38
 * This is used by the EffectQueue classes to decide if the final form of the Effect is NULL - and
39
 * thus if it can safely be removed from Effect Queues without affecting the visual in any way.
40
 * </p>
41 476bbc81 Leszek Koltunski
 */
42
public enum EffectNames
43 6a06a912 Leszek Koltunski
  {
44 82ee855a Leszek Koltunski
  // EFFECT NAME /////// EFFECT TYPE ////////////// UNITY /////////////// DIM // REGION // CENTER
45 0df17fad Leszek Koltunski
46
  /////////////////////////////////////////////////////////////////////////////////
47
  // MATRIX EFFECTS.
48
  // Always 7 Uniforms: 4 per-effect interpolated values + 3 dimensional center.
49
 /**
50
   * Rotate the whole Object around a center point (in angle-axis notation).
51
   * <p>
52 e25d0dde Leszek Koltunski
   * Uniforms: (angle,axisX,axisY,axisZ,centerX,centerY,centerZ)
53 3695d6fa Leszek Koltunski
   * <p>
54 0df17fad Leszek Koltunski
   * Unity: angle==0
55
   */
56 fa6c352d Leszek Koltunski
  ROTATE           ( EffectTypes.MATRIX  ,   new float[] {0.0f}           , 4, false, true ),
57 0df17fad Leszek Koltunski
 /**
58
   * Rotate the whole Object around a center point (in quaternion notation).
59
   * <p>
60 e25d0dde Leszek Koltunski
   * Uniforms: (quatX,quatY,quatZ,quatW,centerX,centerY,centerZ)
61 3695d6fa Leszek Koltunski
   * <p>
62 0df17fad Leszek Koltunski
   * Unity: (quatX,quatY,quatZ) = (0,0,0)
63
   */
64 a1c83f28 Leszek Koltunski
  QUATERNION       ( EffectTypes.MATRIX  ,   new float[] {0.0f,0.0f,0.0f} , 4, false, true ),
65 0df17fad Leszek Koltunski
 /**
66
   * Move the whole Object by a vector.
67
   * <p>
68 e25d0dde Leszek Koltunski
   * Uniforms: (vectorX,vectorY,vectorZ,UNUSED,UNUSED,UNUSED,UNUSED)
69 3695d6fa Leszek Koltunski
   * <p>
70 0df17fad Leszek Koltunski
   * Unity: (vectorX,vectorY,vectorZ) = (0,0,0)
71
   */
72 a1c83f28 Leszek Koltunski
  MOVE             ( EffectTypes.MATRIX  ,   new float[] {0.0f,0.0f,0.0f} , 3, false, false ),
73 0df17fad Leszek Koltunski
 /**
74
   * Scale the whole Object independently in all 3 dimensions.
75
   * <p>
76 e25d0dde Leszek Koltunski
   * Uniforms: (scaleX,scaleY,scaleZ,UNUSED,UNUSED,UNUSED,UNUSED)
77 3695d6fa Leszek Koltunski
   * <p>
78 0df17fad Leszek Koltunski
   * Unity: (scaleX,scaleY,scaleZ) = (1,1,1)
79
   */
80 a1c83f28 Leszek Koltunski
  SCALE            ( EffectTypes.MATRIX  ,   new float[] {1.0f,1.0f,1.0f} , 3, false, false ),
81 0df17fad Leszek Koltunski
 /**
82
   * Shear the whole Object in 3 dimensions around a center point.
83
   * <p>
84 e25d0dde Leszek Koltunski
   * Uniforms: (shearX,shearY,shearZ,UNUSED,centerX,centerY,centerZ)
85 3695d6fa Leszek Koltunski
   * <p>
86 0df17fad Leszek Koltunski
   * Unity:  (shearX,shearY,shearZ) = (0,0,0)
87
   */
88 a1c83f28 Leszek Koltunski
  SHEAR            ( EffectTypes.MATRIX  ,   new float[] {0.0f,0.0f,0.0f} , 3, false, true ),
89 1e438fc7 Leszek Koltunski
  // add new Matrix effects here...
90 0df17fad Leszek Koltunski
91
 /////////////////////////////////////////////////////////////////////////////////
92
 // VERTEX EFFECTS
93 8298e6af Leszek Koltunski
 // Always 12 Uniforms: 6 per-effect interpolated values, 2-dimensional center of
94
 // the effect, 4-dimensional Region
95 0df17fad Leszek Koltunski
 /**
96
   * Apply a 3D vector of force to area around a point on the surface of the Object.
97
   * <p>
98 02ef26bc Leszek Koltunski
   * Uniforms: (forceX ,forceY ,forceZ  ,UNUSED  ,
99 82ee855a Leszek Koltunski
   *            UNUSED , centerX ,centerY , centerZ,
100 3695d6fa Leszek Koltunski
   *            regionX,regionY,regionRX,regionRY)
101
   * <p>
102 0df17fad Leszek Koltunski
   * Unity: (forceX,forceY,forceZ) = (0,0,0)
103
   */
104 a1c83f28 Leszek Koltunski
  DISTORT          ( EffectTypes.VERTEX  ,   new float[] {0.0f,0.0f,0.0f} , 3, true, true ),
105 0df17fad Leszek Koltunski
 /**
106
   * Deform the whole Object by applying a 2D vector of force to a center point.
107
   * <p>
108 02ef26bc Leszek Koltunski
   * Uniforms: (forceX,forceY,UNUSED,UNUSED,
109 82ee855a Leszek Koltunski
   *            UNUSED,centerX,centerY,centerZ,
110 02ef26bc Leszek Koltunski
   *            UNUSED,UNUSED,UNUSED,UNUSED)
111 3695d6fa Leszek Koltunski
   * <p>
112 0df17fad Leszek Koltunski
   * Unity: (forceX,forceY) = (0,0)
113
   */
114 6ebdbbf1 Leszek Koltunski
  DEFORM           ( EffectTypes.VERTEX  ,   new float[] {0.0f,0.0f}      , 3, true, true ),
115 0df17fad Leszek Koltunski
 /**
116
   * Pull (or push away) all points around a center point to (from) it.
117
   * <p>
118 02ef26bc Leszek Koltunski
   * Uniforms: (sinkFactor,UNUSED,UNUSED,UNUSED,
119 82ee855a Leszek Koltunski
   *            UNUSED,centerX,centerY,centerZ,
120 02ef26bc Leszek Koltunski
   *            regionX,regionY,regionRX,regionRY)
121 3695d6fa Leszek Koltunski
   * <p>
122 0df17fad Leszek Koltunski
   * Unity: sinkFactor = 1
123
   */
124 a1c83f28 Leszek Koltunski
  SINK             ( EffectTypes.VERTEX  ,   new float[] {1.0f}           , 1, true, true ),
125 82ee855a Leszek Koltunski
  /**
126
   * Pull (or push away) all points around a line to (from) it.
127
   * <p>
128
   * Uniforms: (pinchFactor,lineAngle,UNUSED,UNUSED,
129
   *            UNUSED,centerX,centerY,centerZ,
130
   *            regionX,regionY,regionRX,regionRY)
131
   * <p>
132
   * Unity: sinkFactor = 1
133
   */
134
  PINCH            ( EffectTypes.VERTEX  ,   new float[] {1.0f}           , 2, true, true ),
135 0df17fad Leszek Koltunski
 /**
136
   * Smoothly rotate a limited area around a center point.
137
   * <p>
138 02ef26bc Leszek Koltunski
   * Uniforms: (swirlAngle,UNUSED,UNUSED,UNUSED,
139 82ee855a Leszek Koltunski
   *            UNUSED, centerX,centerY,centerZ,
140 02ef26bc Leszek Koltunski
   *            regionX,regionY,regionRX,regionRY)
141 3695d6fa Leszek Koltunski
   * <p>
142 0df17fad Leszek Koltunski
   * Unity: swirlAngle = 0
143
   */
144 a1c83f28 Leszek Koltunski
  SWIRL            ( EffectTypes.VERTEX  ,   new float[] {0.0f}           , 1, true, true ),
145 4fde55a0 Leszek Koltunski
  /**
146
   * Directional sinusoidal wave effect. The direction of the wave is given by the 'angle'
147 cacc63de Leszek Koltunski
   * parameters. Details: {@link DistortedEffects#wave(org.distorted.library.type.Data5D,org.distorted.library.type.Data3D)}
148 4fde55a0 Leszek Koltunski
   * <p>
149 291705f6 Leszek Koltunski
   * Uniforms: (amplitude,length,phase,angleAlpha,
150 82ee855a Leszek Koltunski
   *            angleBeta, centerX,centerY,centerZ,
151 02ef26bc Leszek Koltunski
   *            regionX,regionY,regionRX,regionRY)
152 3695d6fa Leszek Koltunski
   * <p>
153 4fde55a0 Leszek Koltunski
   * Unity: amplitude  = 0
154
   */
155 a1c83f28 Leszek Koltunski
  WAVE             ( EffectTypes.VERTEX  ,   new float[] {0.0f}           , 5, true, true ),
156 6a06a912 Leszek Koltunski
  // add new Vertex Effects here...
157 0df17fad Leszek Koltunski
158
 /////////////////////////////////////////////////////////////////////////////////
159
 // FRAGMENT EFFECTS
160
 // Always 8 Uniforms: 4-per effect interpolated values, 4 dimensional Region.
161
 /**
162
   * Make a given Region (partially) transparent.
163
   * <p>
164 e25d0dde Leszek Koltunski
   * Uniforms: (transparencyLevel,UNUSED,UNUSED,UNUSED, regionX, regionY, regionRX, regionRY)
165 3695d6fa Leszek Koltunski
   * <p>
166 0df17fad Leszek Koltunski
   * Unity: transparencyLevel = 1
167
   */
168 a1c83f28 Leszek Koltunski
  ALPHA            ( EffectTypes.FRAGMENT,   new float[] {1.0f}           , 1, true, false ),
169 0df17fad Leszek Koltunski
 /**
170
   * Make a given Region (partially) transparent.
171
   * Effect smoothly fades towards the edges of the region.
172
   * <p>
173 e25d0dde Leszek Koltunski
   * Uniforms: (transparencyLevel,UNUSED,UNUSED,UNUSED, regionX, regionY, regionRX, regionRY)
174 0df17fad Leszek Koltunski
   * Unity: transparencyLevel = 1
175
   */
176 a1c83f28 Leszek Koltunski
  SMOOTH_ALPHA     ( EffectTypes.FRAGMENT,   new float[] {1.0f}           , 1, true, false ),
177 0df17fad Leszek Koltunski
 /**
178
   * Blend current color in the texture with a given color.
179
   * <p>
180 e25d0dde Leszek Koltunski
   * Uniforms: (blendLevel,colorR,colorG,colorB, regionX, regionY, regionRX, regionRY)
181 3695d6fa Leszek Koltunski
   * <p>
182 0df17fad Leszek Koltunski
   * Unity: blendLevel = 0
183
   */
184 a1c83f28 Leszek Koltunski
  CHROMA           ( EffectTypes.FRAGMENT,   new float[] {0.0f}           , 4, true, false ),
185 0df17fad Leszek Koltunski
 /**
186
   * Smoothly blend current color in the texture with a given color.
187
   * <p>
188 e25d0dde Leszek Koltunski
   * Uniforms: (blendLevel,colorR,colorG,colorB, regionX, regionY, regionRX, regionRY)
189 0df17fad Leszek Koltunski
   * Unity: blendLevel = 0
190
   */
191 a1c83f28 Leszek Koltunski
  SMOOTH_CHROMA    ( EffectTypes.FRAGMENT,   new float[] {0.0f}           , 4, true, false ),
192 0df17fad Leszek Koltunski
 /**
193
   * Change brightness level of a given Region.
194
   * <p>
195 e25d0dde Leszek Koltunski
   * Uniforms: (brightnessLevel,UNUSED,UNUSED,UNUSED, regionX, regionY, regionRX, regionRY)
196 3695d6fa Leszek Koltunski
   * <p>
197 0df17fad Leszek Koltunski
   * Unity: brightnessLevel = 1
198
   */
199 a1c83f28 Leszek Koltunski
  BRIGHTNESS       ( EffectTypes.FRAGMENT,   new float[] {1.0f}           , 1, true, false ),
200 0df17fad Leszek Koltunski
 /**
201
   * Smoothly change brightness level of a given Region.
202
   * <p>
203 e25d0dde Leszek Koltunski
   * Uniforms: (brightnessLevel,UNUSED,UNUSED,UNUSED, regionX, regionY, regionRX, regionRY)
204 3695d6fa Leszek Koltunski
   * <p>
205 0df17fad Leszek Koltunski
   * Unity: brightnessLevel = 1
206
   */
207 a1c83f28 Leszek Koltunski
  SMOOTH_BRIGHTNESS( EffectTypes.FRAGMENT,   new float[] {1.0f}           , 1, true, false ),
208 0df17fad Leszek Koltunski
 /**
209
   * Change saturation level of a given Region.
210
   * <p>
211 e25d0dde Leszek Koltunski
   * Uniforms: (saturationLevel,UNUSED,UNUSED,UNUSED, regionX, regionY, regionRX, regionRY)
212 3695d6fa Leszek Koltunski
   * <p>
213 0df17fad Leszek Koltunski
   * Unity: saturationLevel = 1
214
   */
215 a1c83f28 Leszek Koltunski
  SATURATION       ( EffectTypes.FRAGMENT,   new float[] {1.0f}           , 1, true, false ),
216 0df17fad Leszek Koltunski
 /**
217
   * Smoothly change saturation level of a given Region.
218
   * <p>
219 e25d0dde Leszek Koltunski
   * Uniforms: (saturationLevel,UNUSED,UNUSED,UNUSED, regionX, regionY, regionRX, regionRY)
220 3695d6fa Leszek Koltunski
   * <p>
221 0df17fad Leszek Koltunski
   * Unity: saturationLevel = 1
222
   */
223 a1c83f28 Leszek Koltunski
  SMOOTH_SATURATION( EffectTypes.FRAGMENT,   new float[] {1.0f}           , 1, true, false ),
224 0df17fad Leszek Koltunski
 /**
225
   * Change contrast level of a given Region.
226
   * <p>
227 e25d0dde Leszek Koltunski
   * Uniforms: (contrastLevel,UNUSED,UNUSED,UNUSED, regionX, regionY, regionRX, regionRY)
228 3695d6fa Leszek Koltunski
   * <p>
229 0df17fad Leszek Koltunski
   * Unity: contrastLevel = 1
230
   */
231 a1c83f28 Leszek Koltunski
  CONTRAST         ( EffectTypes.FRAGMENT,   new float[] {1.0f}           , 1, true, false ),
232 0df17fad Leszek Koltunski
 /**
233
   * Smoothly change contrast level of a given Region.
234
   * <p>
235 e25d0dde Leszek Koltunski
   * Uniforms: (contrastLevel,UNUSED,UNUSED,UNUSED, regionX, regionY, regionRX, regionRY)
236 3695d6fa Leszek Koltunski
   * <p>
237 0df17fad Leszek Koltunski
   * Unity: contrastLevel = 1
238
   */
239 a1c83f28 Leszek Koltunski
  SMOOTH_CONTRAST  ( EffectTypes.FRAGMENT,   new float[] {1.0f}           , 1, true, false );
240 6a06a912 Leszek Koltunski
  // add new Fragment effects here...
241
242
///////////////////////////////////////////////////////////////////////////////////////////////////
243
  
244
  private static final int MAXDIM = 4;  // maximum supported dimension of an effect  
245
  
246 e8c81a8e Leszek Koltunski
  private final EffectTypes type;
247
  private final float[] unity;
248 1beb6f13 Leszek Koltunski
  private final int dimension;
249 a1c83f28 Leszek Koltunski
  private final boolean supportsR;
250
  private final boolean supportsC;
251
252 e8c81a8e Leszek Koltunski
  private static final float[] unities;
253 1beb6f13 Leszek Koltunski
  private static final int[] unityDimensions;
254 e8c81a8e Leszek Koltunski
  private static final int[] dimensions;
255 a1c83f28 Leszek Koltunski
  private static final boolean[] supportsRegion;
256
  private static final boolean[] supportsCenter;
257 e8c81a8e Leszek Koltunski
  private static final EffectNames[] names;
258
259 6a06a912 Leszek Koltunski
  static
260
    {
261
    int len = values().length;
262
    int i=0;
263
    
264 1beb6f13 Leszek Koltunski
    unityDimensions = new int[len];
265
    dimensions      = new int[len];
266 a1c83f28 Leszek Koltunski
    supportsRegion  = new boolean[len];
267
    supportsCenter  = new boolean[len];
268 1beb6f13 Leszek Koltunski
    unities         = new float[MAXDIM*len];
269
    names           = new EffectNames[len];
270 e8c81a8e Leszek Koltunski
271 6a06a912 Leszek Koltunski
    for(EffectNames name: EffectNames.values())
272
      {
273 1beb6f13 Leszek Koltunski
      unityDimensions[i] = (name.unity==null ? 0 : name.unity.length);
274
      dimensions[i]      = name.dimension;
275 a1c83f28 Leszek Koltunski
      supportsRegion[i]  = name.supportsR;
276
      supportsCenter[i]  = name.supportsC;
277 1beb6f13 Leszek Koltunski
      names[i]           = name;
278 e8c81a8e Leszek Koltunski
279 1beb6f13 Leszek Koltunski
      switch(unityDimensions[i])
280 6a06a912 Leszek Koltunski
        {
281
        case 4: unities[MAXDIM*i+3] = name.unity[3];
282
        case 3: unities[MAXDIM*i+2] = name.unity[2];
283
        case 2: unities[MAXDIM*i+1] = name.unity[1];
284 0318e7e3 Leszek Koltunski
        case 1: unities[MAXDIM*i  ] = name.unity[0];
285 6a06a912 Leszek Koltunski
        case 0: break;
286
        }
287
      
288
      i++;  
289
      }
290
    }
291
  
292
///////////////////////////////////////////////////////////////////////////////////////////////////
293
  
294 a1c83f28 Leszek Koltunski
  EffectNames(EffectTypes type, float[] unity, int dimension, boolean supportsR, boolean supportsC)
295 6a06a912 Leszek Koltunski
    {
296 a1c83f28 Leszek Koltunski
    this.type      = type;
297
    this.unity     = unity;
298
    this.dimension = dimension;
299
    this.supportsR = supportsR;
300
    this.supportsC = supportsC;
301 6a06a912 Leszek Koltunski
    }
302
303
///////////////////////////////////////////////////////////////////////////////////////////////////
304 c6e1c219 Leszek Koltunski
305 1e438fc7 Leszek Koltunski
  static EffectTypes getType(int ordinal)
306 6a06a912 Leszek Koltunski
    {
307 e8c81a8e Leszek Koltunski
    return names[ordinal].type;
308
    }
309 b3618cb5 Leszek Koltunski
310 e8c81a8e Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
311
312
  static EffectNames getName(int ordinal)
313
    {
314
    return names[ordinal];
315 6a06a912 Leszek Koltunski
    }
316
317
///////////////////////////////////////////////////////////////////////////////////////////////////
318
319
  static void fillWithUnities(int ordinal, float[] buffer, int index)
320
    {
321 1beb6f13 Leszek Koltunski
    switch(unityDimensions[ordinal])
322 6a06a912 Leszek Koltunski
      {
323
      case 0: break;
324 0318e7e3 Leszek Koltunski
      case 1: buffer[index  ]=unities[MAXDIM*ordinal  ];
325 6a06a912 Leszek Koltunski
              break;
326 0318e7e3 Leszek Koltunski
      case 2: buffer[index  ]=unities[MAXDIM*ordinal  ];
327 6a06a912 Leszek Koltunski
              buffer[index+1]=unities[MAXDIM*ordinal+1];
328
              break;
329 0318e7e3 Leszek Koltunski
      case 3: buffer[index  ]=unities[MAXDIM*ordinal  ];
330 6a06a912 Leszek Koltunski
              buffer[index+1]=unities[MAXDIM*ordinal+1]; 
331
              buffer[index+2]=unities[MAXDIM*ordinal+2];
332
              break;
333 0318e7e3 Leszek Koltunski
      case 4: buffer[index  ]=unities[MAXDIM*ordinal  ];
334 6a06a912 Leszek Koltunski
              buffer[index+1]=unities[MAXDIM*ordinal+1]; 
335
              buffer[index+2]=unities[MAXDIM*ordinal+2];
336
              buffer[index+3]=unities[MAXDIM*ordinal+3];
337
              break;
338
      }  
339
    }
340
  
341
///////////////////////////////////////////////////////////////////////////////////////////////////
342
  
343
  static boolean isUnity(int ordinal, float[] buffer, int index)
344
    {
345 1beb6f13 Leszek Koltunski
    switch(unityDimensions[ordinal])
346 6a06a912 Leszek Koltunski
      {
347
      case 0: return true;
348 0318e7e3 Leszek Koltunski
      case 1: return buffer[index  ]==unities[MAXDIM*ordinal  ];
349
      case 2: return buffer[index  ]==unities[MAXDIM*ordinal  ] &&
350 6a06a912 Leszek Koltunski
                     buffer[index+1]==unities[MAXDIM*ordinal+1];
351 0318e7e3 Leszek Koltunski
      case 3: return buffer[index  ]==unities[MAXDIM*ordinal  ] &&
352 6a06a912 Leszek Koltunski
                     buffer[index+1]==unities[MAXDIM*ordinal+1] && 
353
                     buffer[index+2]==unities[MAXDIM*ordinal+2];
354 0318e7e3 Leszek Koltunski
      case 4: return buffer[index  ]==unities[MAXDIM*ordinal  ] &&
355 6a06a912 Leszek Koltunski
                     buffer[index+1]==unities[MAXDIM*ordinal+1] && 
356
                     buffer[index+2]==unities[MAXDIM*ordinal+2] &&
357
                     buffer[index+3]==unities[MAXDIM*ordinal+3];
358
      }
359
   
360
    return false;
361
    }
362
363
///////////////////////////////////////////////////////////////////////////////////////////////////
364 476bbc81 Leszek Koltunski
// PUBLIC API
365
///////////////////////////////////////////////////////////////////////////////////////////////////
366
/**
367
 * Returns the Type of an individual Effect. For example, EffectNames.ROTATION.getType() will
368
 * return EffectTypes.MATRIX.
369
 * @return type of the effect.
370
 */
371
  public EffectTypes getType()
372
    {
373
    return type;
374
    }
375 ac094579 Leszek Koltunski
376 1beb6f13 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
377
378 ac094579 Leszek Koltunski
/**
379
 * Returns the dimension of an Effect (in other words, the number of interpolated values).
380
 * @return dimension of the Effect.
381
 */
382
  public int getDimension() { return dimensions[ordinal()]; }
383 1beb6f13 Leszek Koltunski
384
///////////////////////////////////////////////////////////////////////////////////////////////////
385
386
/**
387
 * Do we support being masked by a Region?
388
 * @return true if the Effect supports being masked with a Region.
389
 */
390 a1c83f28 Leszek Koltunski
  public boolean supportsRegion() { return supportsRegion[ordinal()]; }
391
392
///////////////////////////////////////////////////////////////////////////////////////////////////
393
394
/**
395
 * Does this Effect have a center?
396
 * @return true if the Effect has a center.
397
 */
398
  public boolean supportsCenter() { return supportsCenter[ordinal()]; }
399 1beb6f13 Leszek Koltunski
400 d333eb6b Leszek Koltunski
  }