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 |
|
|
import android.graphics.Bitmap;
|
23 |
|
|
import android.opengl.GLES20;
|
24 |
|
|
import android.opengl.GLUtils;
|
25 |
|
|
|
26 |
e458a4ba
|
Leszek Koltunski
|
import org.distorted.library.message.EffectListener;
|
27 |
568b29d8
|
Leszek Koltunski
|
import org.distorted.library.type.Data1D;
|
28 |
|
|
import org.distorted.library.type.Data3D;
|
29 |
|
|
import org.distorted.library.type.Data4D;
|
30 |
|
|
import org.distorted.library.type.Dynamic;
|
31 |
|
|
import org.distorted.library.type.Dynamic1D;
|
32 |
|
|
import org.distorted.library.type.Dynamic2D;
|
33 |
|
|
import org.distorted.library.type.Dynamic3D;
|
34 |
|
|
import org.distorted.library.type.Dynamic4D;
|
35 |
|
|
import org.distorted.library.type.Static1D;
|
36 |
|
|
import org.distorted.library.type.Static2D;
|
37 |
|
|
import org.distorted.library.type.Static3D;
|
38 |
|
|
import org.distorted.library.type.Static4D;
|
39 |
|
|
import org.distorted.library.type.DynamicQuat;
|
40 |
a4835695
|
Leszek Koltunski
|
|
41 |
6a06a912
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
42 |
b329f352
|
Leszek Koltunski
|
/**
|
43 |
437bc43e
|
Leszek Koltunski
|
* All Objects to which Distorted Graphics effects can be applied need to be extended from here.
|
44 |
b329f352
|
Leszek Koltunski
|
*/
|
45 |
6a06a912
|
Leszek Koltunski
|
public abstract class DistortedObject
|
46 |
1e438fc7
|
Leszek Koltunski
|
{
|
47 |
568b29d8
|
Leszek Koltunski
|
private static final Static2D mZero2D = new Static2D(0,0);
|
48 |
|
|
private static final Static3D mZero3D = new Static3D(0,0,0);
|
49 |
e0a16874
|
Leszek Koltunski
|
|
50 |
|
|
private static float[] mViewMatrix = new float[16];
|
51 |
6a06a912
|
Leszek Koltunski
|
|
52 |
d07f2950
|
Leszek Koltunski
|
protected EffectQueueMatrix mM;
|
53 |
|
|
protected EffectQueueFragment mF;
|
54 |
|
|
protected EffectQueueVertex mV;
|
55 |
6a06a912
|
Leszek Koltunski
|
|
56 |
|
|
protected boolean matrixCloned, vertexCloned, fragmentCloned;
|
57 |
|
|
|
58 |
e458a4ba
|
Leszek Koltunski
|
protected DistortedObjectGrid mGrid = null;
|
59 |
6a06a912
|
Leszek Koltunski
|
protected long mID;
|
60 |
|
|
protected int mSizeX, mSizeY, mSizeZ, mSize; // in screen space
|
61 |
|
|
|
62 |
|
|
protected Bitmap[] mBmp= null; //
|
63 |
|
|
int[] mTextureDataH; // have to be shared among all the cloned Objects
|
64 |
|
|
boolean[] mBitmapSet; //
|
65 |
9361b337
|
Leszek Koltunski
|
|
66 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
67 |
|
|
|
68 |
ada90d33
|
Leszek Koltunski
|
protected abstract DistortedObject deepCopy(int flags);
|
69 |
9361b337
|
Leszek Koltunski
|
|
70 |
6a06a912
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
71 |
|
|
|
72 |
|
|
protected void initializeData(int size)
|
73 |
|
|
{
|
74 |
|
|
mID = DistortedObjectList.add(this);
|
75 |
|
|
mSize = size;
|
76 |
|
|
mTextureDataH = new int[1];
|
77 |
|
|
mTextureDataH[0]= 0;
|
78 |
|
|
mBmp = new Bitmap[1];
|
79 |
|
|
mBmp[0] = null;
|
80 |
|
|
mBitmapSet = new boolean[1];
|
81 |
|
|
mBitmapSet[0] = false;
|
82 |
|
|
|
83 |
|
|
initializeEffectLists(this,0);
|
84 |
|
|
|
85 |
|
|
if( Distorted.isInitialized() ) resetTexture();
|
86 |
|
|
}
|
87 |
|
|
|
88 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
89 |
|
|
|
90 |
|
|
protected void initializeEffectLists(DistortedObject d, int flags)
|
91 |
|
|
{
|
92 |
b3618cb5
|
Leszek Koltunski
|
if( (flags & Distorted.CLONE_PRESHADER) != 0 )
|
93 |
6a06a912
|
Leszek Koltunski
|
{
|
94 |
|
|
mM = d.mM;
|
95 |
|
|
matrixCloned = true;
|
96 |
|
|
}
|
97 |
|
|
else
|
98 |
|
|
{
|
99 |
d07f2950
|
Leszek Koltunski
|
mM = new EffectQueueMatrix(d);
|
100 |
6a06a912
|
Leszek Koltunski
|
matrixCloned = false;
|
101 |
|
|
}
|
102 |
|
|
|
103 |
|
|
if( (flags & Distorted.CLONE_VERTEX) != 0 )
|
104 |
|
|
{
|
105 |
|
|
mV = d.mV;
|
106 |
|
|
vertexCloned = true;
|
107 |
|
|
}
|
108 |
|
|
else
|
109 |
|
|
{
|
110 |
d07f2950
|
Leszek Koltunski
|
mV = new EffectQueueVertex(d);
|
111 |
6a06a912
|
Leszek Koltunski
|
vertexCloned = false;
|
112 |
|
|
}
|
113 |
|
|
|
114 |
|
|
if( (flags & Distorted.CLONE_FRAGMENT) != 0 )
|
115 |
|
|
{
|
116 |
|
|
mF = d.mF;
|
117 |
|
|
fragmentCloned = true;
|
118 |
|
|
}
|
119 |
|
|
else
|
120 |
|
|
{
|
121 |
d07f2950
|
Leszek Koltunski
|
mF = new EffectQueueFragment(d);
|
122 |
6a06a912
|
Leszek Koltunski
|
fragmentCloned = false;
|
123 |
|
|
}
|
124 |
|
|
}
|
125 |
|
|
|
126 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
127 |
|
|
// this will be called on startup and every time OpenGL context has been lost
|
128 |
|
|
// also call this from the constructor if the OpenGL context has been created already.
|
129 |
|
|
|
130 |
|
|
void resetTexture()
|
131 |
|
|
{
|
132 |
|
|
if( mTextureDataH!=null )
|
133 |
|
|
{
|
134 |
|
|
if( mTextureDataH[0]==0 ) GLES20.glGenTextures(1, mTextureDataH, 0);
|
135 |
|
|
|
136 |
|
|
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTextureDataH[0]);
|
137 |
|
|
GLES20.glTexParameteri ( GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR );
|
138 |
|
|
GLES20.glTexParameteri ( GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR );
|
139 |
|
|
GLES20.glTexParameteri ( GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE );
|
140 |
|
|
GLES20.glTexParameteri ( GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE );
|
141 |
|
|
|
142 |
|
|
if( mBmp!=null && mBmp[0]!=null)
|
143 |
|
|
{
|
144 |
|
|
GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, mBmp[0], 0);
|
145 |
|
|
mBmp[0] = null;
|
146 |
|
|
}
|
147 |
|
|
}
|
148 |
|
|
}
|
149 |
|
|
|
150 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
151 |
|
|
|
152 |
|
|
void drawPriv(long currTime, DistortedProjection dp)
|
153 |
|
|
{
|
154 |
|
|
GLES20.glViewport(0, 0, dp.width, dp.height);
|
155 |
|
|
|
156 |
|
|
mM.compute(currTime);
|
157 |
|
|
mM.send(mViewMatrix, dp);
|
158 |
|
|
|
159 |
|
|
mV.compute(currTime);
|
160 |
|
|
mV.postprocess();
|
161 |
|
|
mV.send();
|
162 |
|
|
|
163 |
|
|
mF.compute(currTime);
|
164 |
|
|
mF.postprocess(mViewMatrix);
|
165 |
|
|
mF.send();
|
166 |
|
|
|
167 |
|
|
mGrid.draw();
|
168 |
|
|
}
|
169 |
|
|
|
170 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
171 |
|
|
|
172 |
|
|
void drawNoEffectsPriv(DistortedProjection dp)
|
173 |
|
|
{
|
174 |
|
|
GLES20.glViewport(0, 0, dp.width, dp.height);
|
175 |
|
|
mM.sendNoEffects(dp);
|
176 |
|
|
mV.sendZero();
|
177 |
|
|
mF.sendZero();
|
178 |
|
|
mGrid.draw();
|
179 |
|
|
}
|
180 |
|
|
|
181 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
182 |
|
|
|
183 |
|
|
void releasePriv()
|
184 |
|
|
{
|
185 |
|
|
if( matrixCloned ==false) mM.abortAll();
|
186 |
|
|
if( vertexCloned ==false) mV.abortAll();
|
187 |
|
|
if( fragmentCloned==false) mF.abortAll();
|
188 |
|
|
|
189 |
|
|
mBmp = null;
|
190 |
|
|
mGrid = null;
|
191 |
|
|
mM = null;
|
192 |
|
|
mV = null;
|
193 |
|
|
mF = null;
|
194 |
|
|
mTextureDataH = null;
|
195 |
|
|
}
|
196 |
|
|
|
197 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
198 |
|
|
|
199 |
|
|
long getBitmapID()
|
200 |
|
|
{
|
201 |
|
|
return mBmp==null ? 0 : mBmp.hashCode();
|
202 |
|
|
}
|
203 |
|
|
|
204 |
ada90d33
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
205 |
|
|
|
206 |
|
|
/**
|
207 |
|
|
* Default empty constructor so that derived classes can call it
|
208 |
|
|
*/
|
209 |
|
|
public DistortedObject()
|
210 |
|
|
{
|
211 |
|
|
|
212 |
|
|
}
|
213 |
|
|
|
214 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
215 |
|
|
/**
|
216 |
|
|
* Copy constructor used to create a DistortedObject based on various parts of another object.
|
217 |
|
|
* <p>
|
218 |
|
|
* Whatever we do not clone gets created just like in the default constructor.
|
219 |
d07f2950
|
Leszek Koltunski
|
* We only call this from the descendant's classes' constructors where we have to pay attention
|
220 |
|
|
* to give it the appropriate type of a DistortedObject!
|
221 |
ada90d33
|
Leszek Koltunski
|
*
|
222 |
|
|
* @param dc Source object to create our object from
|
223 |
|
|
* @param flags A bitmask of values specifying what to copy.
|
224 |
d07f2950
|
Leszek Koltunski
|
* For example, CLONE_BITMAP | CLONE_MATRIX.
|
225 |
ada90d33
|
Leszek Koltunski
|
*/
|
226 |
|
|
public DistortedObject(DistortedObject dc, int flags)
|
227 |
|
|
{
|
228 |
|
|
initializeEffectLists(dc,flags);
|
229 |
|
|
|
230 |
|
|
mID = DistortedObjectList.add(this);
|
231 |
|
|
|
232 |
|
|
mSizeX = dc.mSizeX;
|
233 |
|
|
mSizeY = dc.mSizeY;
|
234 |
|
|
mSizeZ = dc.mSizeZ;
|
235 |
|
|
mSize = dc.mSize;
|
236 |
|
|
mGrid = dc.mGrid;
|
237 |
|
|
|
238 |
|
|
if( (flags & Distorted.CLONE_BITMAP) != 0 )
|
239 |
|
|
{
|
240 |
|
|
mTextureDataH = dc.mTextureDataH;
|
241 |
|
|
mBmp = dc.mBmp;
|
242 |
|
|
mBitmapSet = dc.mBitmapSet;
|
243 |
|
|
}
|
244 |
|
|
else
|
245 |
|
|
{
|
246 |
|
|
mTextureDataH = new int[1];
|
247 |
|
|
mTextureDataH[0]= 0;
|
248 |
|
|
mBitmapSet = new boolean[1];
|
249 |
|
|
mBitmapSet[0] = false;
|
250 |
|
|
mBmp = new Bitmap[1];
|
251 |
|
|
mBmp[0] = null;
|
252 |
|
|
|
253 |
|
|
if( Distorted.isInitialized() ) resetTexture();
|
254 |
|
|
}
|
255 |
|
|
}
|
256 |
|
|
|
257 |
6a06a912
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
258 |
|
|
/**
|
259 |
|
|
* Draw the DistortedObject to the location specified by current Matrix effects.
|
260 |
|
|
*
|
261 |
|
|
* @param currTime current time, in milliseconds, as returned by System.currentTimeMillis().
|
262 |
|
|
* This gets passed on to Interpolators inside the Effects that are currently applied to the
|
263 |
|
|
* Object.
|
264 |
|
|
*/
|
265 |
|
|
public void draw(long currTime)
|
266 |
|
|
{
|
267 |
|
|
GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
|
268 |
|
|
GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0);
|
269 |
|
|
GLES20.glUniform1i(Distorted.mTextureUniformH, 0);
|
270 |
|
|
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTextureDataH[0]);
|
271 |
|
|
|
272 |
|
|
drawPriv(currTime, Distorted.mProjection);
|
273 |
|
|
}
|
274 |
|
|
|
275 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
276 |
|
|
/**
|
277 |
|
|
* Releases all resources.
|
278 |
|
|
*/
|
279 |
|
|
public synchronized void release()
|
280 |
|
|
{
|
281 |
|
|
releasePriv();
|
282 |
|
|
DistortedObjectList.remove(this);
|
283 |
|
|
}
|
284 |
|
|
|
285 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
286 |
|
|
/**
|
287 |
|
|
* Sets the underlying android.graphics.Bitmap object and uploads it to the GPU.
|
288 |
|
|
* <p>
|
289 |
|
|
* You can only recycle() the passed Bitmap once the OpenGL context gets created (i.e. after call
|
290 |
|
|
* to onSurfaceCreated) because only after this point can the Library upload it to the GPU!
|
291 |
|
|
*
|
292 |
|
|
* @param bmp The android.graphics.Bitmap object to apply effects to and display.
|
293 |
|
|
*/
|
294 |
|
|
|
295 |
|
|
public void setBitmap(Bitmap bmp)
|
296 |
|
|
{
|
297 |
|
|
mBitmapSet[0] = true;
|
298 |
|
|
|
299 |
|
|
if( Distorted.isInitialized() )
|
300 |
|
|
{
|
301 |
|
|
GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
|
302 |
|
|
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTextureDataH[0]);
|
303 |
|
|
GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, bmp, 0);
|
304 |
|
|
}
|
305 |
|
|
else
|
306 |
|
|
{
|
307 |
|
|
mBmp[0] = bmp;
|
308 |
|
|
}
|
309 |
|
|
}
|
310 |
|
|
|
311 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
312 |
|
|
/**
|
313 |
|
|
* Adds the calling class to the list of Listeners that get notified each time some event happens
|
314 |
9351ad55
|
Leszek Koltunski
|
* to one of the Effects that are currently applied to the DistortedObject.
|
315 |
6a06a912
|
Leszek Koltunski
|
*
|
316 |
|
|
* @param el A class implementing the EffectListener interface that wants to get notifications.
|
317 |
|
|
*/
|
318 |
|
|
public void addEventListener(EffectListener el)
|
319 |
|
|
{
|
320 |
|
|
mV.addListener(el);
|
321 |
|
|
mF.addListener(el);
|
322 |
|
|
mM.addListener(el);
|
323 |
|
|
}
|
324 |
|
|
|
325 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
326 |
|
|
/**
|
327 |
|
|
* Removes the calling class from the list of Listeners.
|
328 |
|
|
*
|
329 |
|
|
* @param el A class implementing the EffectListener interface that no longer wants to get notifications.
|
330 |
|
|
*/
|
331 |
|
|
public void removeEventListener(EffectListener el)
|
332 |
|
|
{
|
333 |
|
|
mV.removeListener(el);
|
334 |
|
|
mF.removeListener(el);
|
335 |
|
|
mM.removeListener(el);
|
336 |
|
|
}
|
337 |
|
|
|
338 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
339 |
|
|
/**
|
340 |
|
|
* Returns the height of the DistortedObject.
|
341 |
|
|
*
|
342 |
|
|
* @return height of the object, in pixels.
|
343 |
|
|
*/
|
344 |
|
|
public int getWidth()
|
345 |
|
|
{
|
346 |
|
|
return mSizeX;
|
347 |
|
|
}
|
348 |
|
|
|
349 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
350 |
|
|
/**
|
351 |
|
|
* Returns the width of the DistortedObject.
|
352 |
|
|
*
|
353 |
|
|
* @return width of the Object, in pixels.
|
354 |
|
|
*/
|
355 |
|
|
public int getHeight()
|
356 |
|
|
{
|
357 |
|
|
return mSizeY;
|
358 |
|
|
}
|
359 |
|
|
|
360 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
361 |
|
|
/**
|
362 |
|
|
* Returns the depth of the DistortedObject.
|
363 |
|
|
*
|
364 |
|
|
* @return depth of the Object, in pixels.
|
365 |
|
|
*/
|
366 |
|
|
public int getDepth()
|
367 |
|
|
{
|
368 |
|
|
return mSizeZ;
|
369 |
|
|
}
|
370 |
|
|
|
371 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
372 |
|
|
/**
|
373 |
|
|
* Returns unique ID of this instance.
|
374 |
|
|
*
|
375 |
|
|
* @return ID of the object.
|
376 |
|
|
*/
|
377 |
|
|
public long getID()
|
378 |
|
|
{
|
379 |
|
|
return mID;
|
380 |
|
|
}
|
381 |
|
|
|
382 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
383 |
|
|
/**
|
384 |
d07f2950
|
Leszek Koltunski
|
* Aborts all Effects.
|
385 |
|
|
* @return Number of effects aborted.
|
386 |
6a06a912
|
Leszek Koltunski
|
*/
|
387 |
d07f2950
|
Leszek Koltunski
|
public int abortAllEffects()
|
388 |
6a06a912
|
Leszek Koltunski
|
{
|
389 |
cdd6333d
|
Leszek Koltunski
|
return mM.abortAll() + mV.abortAll() + mF.abortAll();
|
390 |
6a06a912
|
Leszek Koltunski
|
}
|
391 |
|
|
|
392 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
393 |
|
|
/**
|
394 |
d07f2950
|
Leszek Koltunski
|
* Aborts all Effects of a given type, for example all MATRIX Effects.
|
395 |
6a06a912
|
Leszek Koltunski
|
*
|
396 |
d07f2950
|
Leszek Koltunski
|
* @param type one of the constants defined in {@link EffectTypes}
|
397 |
|
|
* @return Number of effects aborted.
|
398 |
6a06a912
|
Leszek Koltunski
|
*/
|
399 |
d07f2950
|
Leszek Koltunski
|
public int abortEffects(EffectTypes type)
|
400 |
6a06a912
|
Leszek Koltunski
|
{
|
401 |
d07f2950
|
Leszek Koltunski
|
switch(type)
|
402 |
|
|
{
|
403 |
|
|
case MATRIX : return mM.abortAll();
|
404 |
|
|
case VERTEX : return mV.abortAll();
|
405 |
|
|
case FRAGMENT: return mF.abortAll();
|
406 |
|
|
default : return 0;
|
407 |
|
|
}
|
408 |
6a06a912
|
Leszek Koltunski
|
}
|
409 |
|
|
|
410 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
411 |
|
|
/**
|
412 |
|
|
* Aborts a single Effect.
|
413 |
|
|
*
|
414 |
|
|
* @param id ID of the Effect we want to abort.
|
415 |
476bbc81
|
Leszek Koltunski
|
* @return number of Effects aborted. Always either 0 or 1.
|
416 |
6a06a912
|
Leszek Koltunski
|
*/
|
417 |
476bbc81
|
Leszek Koltunski
|
public int abortEffect(long id)
|
418 |
6a06a912
|
Leszek Koltunski
|
{
|
419 |
1e438fc7
|
Leszek Koltunski
|
int type = (int)(id&EffectTypes.MASK);
|
420 |
|
|
|
421 |
476bbc81
|
Leszek Koltunski
|
if( type==EffectTypes.MATRIX.type ) return mM.removeByID(id>>EffectTypes.LENGTH);
|
422 |
|
|
if( type==EffectTypes.VERTEX.type ) return mV.removeByID(id>>EffectTypes.LENGTH);
|
423 |
|
|
if( type==EffectTypes.FRAGMENT.type ) return mF.removeByID(id>>EffectTypes.LENGTH);
|
424 |
1e438fc7
|
Leszek Koltunski
|
|
425 |
476bbc81
|
Leszek Koltunski
|
return 0;
|
426 |
6a06a912
|
Leszek Koltunski
|
}
|
427 |
|
|
|
428 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
429 |
|
|
/**
|
430 |
|
|
* Abort all Effects of a given type, for example all rotations.
|
431 |
|
|
*
|
432 |
d07f2950
|
Leszek Koltunski
|
* @param name one of the constants defined in {@link EffectNames}
|
433 |
476bbc81
|
Leszek Koltunski
|
* @return number of Effects aborted.
|
434 |
6a06a912
|
Leszek Koltunski
|
*/
|
435 |
476bbc81
|
Leszek Koltunski
|
public int abortEffects(EffectNames name)
|
436 |
6a06a912
|
Leszek Koltunski
|
{
|
437 |
d07f2950
|
Leszek Koltunski
|
switch(name.getType())
|
438 |
6a06a912
|
Leszek Koltunski
|
{
|
439 |
d07f2950
|
Leszek Koltunski
|
case MATRIX : return mM.removeByType(name);
|
440 |
|
|
case VERTEX : return mV.removeByType(name);
|
441 |
|
|
case FRAGMENT: return mF.removeByType(name);
|
442 |
476bbc81
|
Leszek Koltunski
|
default : return 0;
|
443 |
6a06a912
|
Leszek Koltunski
|
}
|
444 |
|
|
}
|
445 |
|
|
|
446 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
447 |
|
|
/**
|
448 |
|
|
* Print some info about a given Effect to Android's standard out. Used for debugging only.
|
449 |
|
|
*
|
450 |
|
|
* @param id Effect ID we want to print info about
|
451 |
|
|
* @return <code>true</code> if a single Effect of type effectType has been found.
|
452 |
|
|
*/
|
453 |
|
|
|
454 |
|
|
public boolean printEffect(long id)
|
455 |
|
|
{
|
456 |
1e438fc7
|
Leszek Koltunski
|
int type = (int)(id&EffectTypes.MASK);
|
457 |
|
|
|
458 |
|
|
if( type==EffectTypes.MATRIX.type ) return mM.printByID(id>>EffectTypes.LENGTH);
|
459 |
|
|
if( type==EffectTypes.VERTEX.type ) return mV.printByID(id>>EffectTypes.LENGTH);
|
460 |
|
|
if( type==EffectTypes.FRAGMENT.type ) return mF.printByID(id>>EffectTypes.LENGTH);
|
461 |
|
|
|
462 |
|
|
return false;
|
463 |
6a06a912
|
Leszek Koltunski
|
}
|
464 |
|
|
|
465 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
466 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
467 |
|
|
// Individual effect functions.
|
468 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
469 |
|
|
// Matrix-based effects
|
470 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
471 |
|
|
/**
|
472 |
568b29d8
|
Leszek Koltunski
|
* Moves the Object by a vector that changes in time as interpolated by the Dynamic.
|
473 |
6a06a912
|
Leszek Koltunski
|
*
|
474 |
568b29d8
|
Leszek Koltunski
|
* @param vector 3-dimensional Data which at any given time will return a Static3D
|
475 |
e0a16874
|
Leszek Koltunski
|
* representing the current coordinates of the vector we want to move the Object with.
|
476 |
|
|
* @return ID of the effect added, or -1 if we failed to add one.
|
477 |
6a06a912
|
Leszek Koltunski
|
*/
|
478 |
568b29d8
|
Leszek Koltunski
|
public long move(Data3D vector)
|
479 |
6a06a912
|
Leszek Koltunski
|
{
|
480 |
e0a16874
|
Leszek Koltunski
|
return mM.add(EffectNames.MOVE,vector);
|
481 |
6a06a912
|
Leszek Koltunski
|
}
|
482 |
|
|
|
483 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
484 |
|
|
/**
|
485 |
568b29d8
|
Leszek Koltunski
|
* Scales the Object by factors that change in time as returned by the Dynamic.
|
486 |
6a06a912
|
Leszek Koltunski
|
*
|
487 |
568b29d8
|
Leszek Koltunski
|
* @param scale 3-dimensional Dynamic which at any given time returns a Static3D
|
488 |
e0a16874
|
Leszek Koltunski
|
* representing the current x- , y- and z- scale factors.
|
489 |
|
|
* @return ID of the effect added, or -1 if we failed to add one.
|
490 |
6a06a912
|
Leszek Koltunski
|
*/
|
491 |
568b29d8
|
Leszek Koltunski
|
public long scale(Data3D scale)
|
492 |
6a06a912
|
Leszek Koltunski
|
{
|
493 |
e0a16874
|
Leszek Koltunski
|
return mM.add(EffectNames.SCALE,scale);
|
494 |
6a06a912
|
Leszek Koltunski
|
}
|
495 |
|
|
|
496 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
497 |
|
|
/**
|
498 |
568b29d8
|
Leszek Koltunski
|
* Rotates the Object by 'angle' degrees around the center.
|
499 |
|
|
* Static axis of rotation is given by the last parameter.
|
500 |
|
|
*
|
501 |
e0a16874
|
Leszek Koltunski
|
* @param center Coordinates of the Point we are rotating around.
|
502 |
9351ad55
|
Leszek Koltunski
|
* @param angle Angle that we want to rotate the Object to. Unit: degrees
|
503 |
568b29d8
|
Leszek Koltunski
|
* @param axis Axis of rotation
|
504 |
e0a16874
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
505 |
|
|
*/
|
506 |
568b29d8
|
Leszek Koltunski
|
public long rotate(Data3D center, Data1D angle, Static3D axis)
|
507 |
6a06a912
|
Leszek Koltunski
|
{
|
508 |
568b29d8
|
Leszek Koltunski
|
return mM.add(EffectNames.ROTATE, center, angle, axis);
|
509 |
6a06a912
|
Leszek Koltunski
|
}
|
510 |
|
|
|
511 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
512 |
|
|
/**
|
513 |
568b29d8
|
Leszek Koltunski
|
* Rotates the Object by 'angle' degrees around the center.
|
514 |
|
|
* Static axis of rotation is given by the last parameter.
|
515 |
|
|
*
|
516 |
|
|
* @param center Coordinates of the Point we are rotating around.
|
517 |
|
|
* @param angleaxis Combined 4-tuple representing the (angle,axisX,axisY,axisZ).
|
518 |
|
|
* @return ID of the effect added, or -1 if we failed to add one.
|
519 |
e0a16874
|
Leszek Koltunski
|
*/
|
520 |
568b29d8
|
Leszek Koltunski
|
public long rotate(Data3D center, Data4D angleaxis)
|
521 |
|
|
{
|
522 |
|
|
return mM.add(EffectNames.ROTATE, center, angleaxis);
|
523 |
6a06a912
|
Leszek Koltunski
|
}
|
524 |
|
|
|
525 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
526 |
|
|
/**
|
527 |
568b29d8
|
Leszek Koltunski
|
* Rotates the Object by quaternion.
|
528 |
6a06a912
|
Leszek Koltunski
|
*
|
529 |
568b29d8
|
Leszek Koltunski
|
* @param center Coordinates of the Point we are rotating around.
|
530 |
|
|
* @param quaternion The quaternion describing the rotation.
|
531 |
|
|
* @return ID of the effect added, or -1 if we failed to add one.
|
532 |
6a06a912
|
Leszek Koltunski
|
*/
|
533 |
568b29d8
|
Leszek Koltunski
|
public long quaternion(Data3D center, Data4D quaternion)
|
534 |
|
|
{
|
535 |
|
|
return mM.add(EffectNames.QUATERNION,center,quaternion);
|
536 |
6a06a912
|
Leszek Koltunski
|
}
|
537 |
|
|
|
538 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
539 |
|
|
/**
|
540 |
568b29d8
|
Leszek Koltunski
|
* Shears the Object.
|
541 |
6a06a912
|
Leszek Koltunski
|
*
|
542 |
e0a16874
|
Leszek Koltunski
|
* @param center Center of shearing, i.e. the point which stays unmoved.
|
543 |
568b29d8
|
Leszek Koltunski
|
* @param shear The 3-tuple of shear factors.
|
544 |
e0a16874
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
545 |
6a06a912
|
Leszek Koltunski
|
*/
|
546 |
568b29d8
|
Leszek Koltunski
|
public long shear(Data3D center, Data3D shear)
|
547 |
6a06a912
|
Leszek Koltunski
|
{
|
548 |
e0a16874
|
Leszek Koltunski
|
return mM.add(EffectNames.SHEAR, center, shear);
|
549 |
6a06a912
|
Leszek Koltunski
|
}
|
550 |
|
|
|
551 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
552 |
|
|
// Fragment-based effects
|
553 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
554 |
|
|
// MACROBLOCK
|
555 |
|
|
/**
|
556 |
568b29d8
|
Leszek Koltunski
|
* Creates macroblocks at and around point defined by the Dynamic2D and the Region.
|
557 |
|
|
* Size of the macroblocks at any given time is returned by the Dynamic1D.
|
558 |
6a06a912
|
Leszek Koltunski
|
*
|
559 |
568b29d8
|
Leszek Koltunski
|
* @param size 1-dimensional Dynamic which, at any given time, returns the size of the macroblocks.
|
560 |
d7bbef2f
|
Leszek Koltunski
|
* @param region Region this Effect is limited to.
|
561 |
9351ad55
|
Leszek Koltunski
|
* Null here means 'apply the effect to the whole Object'.
|
562 |
568b29d8
|
Leszek Koltunski
|
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D representing the
|
563 |
d7bbef2f
|
Leszek Koltunski
|
* current center of the effect.
|
564 |
|
|
* @return ID of the effect added, or -1 if we failed to add one.
|
565 |
6a06a912
|
Leszek Koltunski
|
*/
|
566 |
568b29d8
|
Leszek Koltunski
|
public long macroblock(Dynamic1D size, Static4D region, Dynamic2D center)
|
567 |
6a06a912
|
Leszek Koltunski
|
{
|
568 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.MACROBLOCK, size, region, center);
|
569 |
6a06a912
|
Leszek Koltunski
|
}
|
570 |
|
|
|
571 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
572 |
|
|
/**
|
573 |
|
|
* Creates macroblocks at and around point defined by the Point2D and the Region.
|
574 |
568b29d8
|
Leszek Koltunski
|
* Size of the macroblocks at any given time is returned by the Dynamic1D.
|
575 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
576 |
|
|
* The difference between this and the previous method is that here the center of the Effect stays constant.
|
577 |
|
|
*
|
578 |
568b29d8
|
Leszek Koltunski
|
* @param size 1-dimensional Dynamic which, at any given time, returns the size of the macroblocks.
|
579 |
d7bbef2f
|
Leszek Koltunski
|
* @param region Region this Effect is limited to.
|
580 |
9351ad55
|
Leszek Koltunski
|
* Null here means 'apply the effect to the whole Object'.
|
581 |
e0a16874
|
Leszek Koltunski
|
* @param center Center of the Effect.
|
582 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
583 |
6a06a912
|
Leszek Koltunski
|
*/
|
584 |
568b29d8
|
Leszek Koltunski
|
public long macroblock(Dynamic1D size, Static4D region, Static2D center)
|
585 |
6a06a912
|
Leszek Koltunski
|
{
|
586 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.MACROBLOCK, size, region, center);
|
587 |
6a06a912
|
Leszek Koltunski
|
}
|
588 |
|
|
|
589 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
590 |
|
|
/**
|
591 |
568b29d8
|
Leszek Koltunski
|
* Creates macroblocks at and around point defined by the Dynamic2D and the Region.
|
592 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
593 |
|
|
* The macroblocks change in size; at time 0 there are none, and after 'duration/2' milliseconds
|
594 |
|
|
* they are of (pixels X pixels) size; after 'duration' milliseconds there are again none (i.e. their
|
595 |
|
|
* size is 1X1, i.e. 1 pixel).
|
596 |
|
|
*
|
597 |
d7bbef2f
|
Leszek Koltunski
|
* @param pixels Maximum size, in pixels, of the Macroblocks we want to see.
|
598 |
|
|
* @param region Region this Effect is limited to.
|
599 |
9351ad55
|
Leszek Koltunski
|
* Null here means 'apply the effect to the whole Object'.
|
600 |
568b29d8
|
Leszek Koltunski
|
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D representing the
|
601 |
d7bbef2f
|
Leszek Koltunski
|
* current center of the effect.
|
602 |
6a06a912
|
Leszek Koltunski
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
603 |
568b29d8
|
Leszek Koltunski
|
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)}
|
604 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
605 |
6a06a912
|
Leszek Koltunski
|
*/
|
606 |
568b29d8
|
Leszek Koltunski
|
public long macroblock(int pixels, Static4D region, Dynamic2D center, int duration, float count)
|
607 |
6a06a912
|
Leszek Koltunski
|
{
|
608 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
609 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
610 |
|
|
di.setDuration(duration);
|
611 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
612 |
|
|
di.add(new Static1D(pixels));
|
613 |
6a06a912
|
Leszek Koltunski
|
|
614 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.MACROBLOCK, di, region, center);
|
615 |
6a06a912
|
Leszek Koltunski
|
}
|
616 |
|
|
|
617 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
618 |
|
|
/**
|
619 |
|
|
* Creates macroblocks at and around point defined by the Point2D and the Region.
|
620 |
|
|
* <p>
|
621 |
|
|
* The macroblocks change in size; at time 0 there are none, and after 'duration/2' milliseconds
|
622 |
|
|
* they are of (pixels X pixels) size; after 'duration' milliseconds there are again none (i.e. their
|
623 |
|
|
* size is 1X1, i.e. 1 pixel).
|
624 |
|
|
* <p>
|
625 |
|
|
* The difference between this and the previous method is that here the center of the Effect stays constant.
|
626 |
|
|
*
|
627 |
d7bbef2f
|
Leszek Koltunski
|
* @param pixels Maximum size, in pixels, of the Macroblocks we want to see.
|
628 |
|
|
* @param region Region this Effect is limited to.
|
629 |
9351ad55
|
Leszek Koltunski
|
* Null here means 'apply the effect to the whole Object'.
|
630 |
e0a16874
|
Leszek Koltunski
|
* @param center Center of the Effect.
|
631 |
6a06a912
|
Leszek Koltunski
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
632 |
568b29d8
|
Leszek Koltunski
|
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)}
|
633 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
634 |
6a06a912
|
Leszek Koltunski
|
*/
|
635 |
568b29d8
|
Leszek Koltunski
|
public long macroblock(int pixels, Static4D region, Static2D center, int duration, float count)
|
636 |
6a06a912
|
Leszek Koltunski
|
{
|
637 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
638 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
639 |
|
|
di.setDuration(duration);
|
640 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
641 |
|
|
di.add(new Static1D(pixels));
|
642 |
6a06a912
|
Leszek Koltunski
|
|
643 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.MACROBLOCK, di, region, center);
|
644 |
6a06a912
|
Leszek Koltunski
|
}
|
645 |
|
|
|
646 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
647 |
|
|
/**
|
648 |
e0a16874
|
Leszek Koltunski
|
* Creates macroblocks on the whole Object.
|
649 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
650 |
|
|
* The macroblocks change in size; at time 0 there are none, and after 'duration/2' milliseconds
|
651 |
|
|
* they are of (pixels X pixels) size; after 'duration' milliseconds there are again none (i.e. their
|
652 |
|
|
* size is 1X1, i.e. 1 pixel).
|
653 |
|
|
* <p>
|
654 |
|
|
* The difference between this and the previous method is that here there is no masking Region; thus
|
655 |
|
|
* there is also no center of the Effect.
|
656 |
|
|
*
|
657 |
d7bbef2f
|
Leszek Koltunski
|
* @param pixels Maximum size, in pixels, of the Macroblocks we want to see.
|
658 |
6a06a912
|
Leszek Koltunski
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
659 |
568b29d8
|
Leszek Koltunski
|
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)}
|
660 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
661 |
6a06a912
|
Leszek Koltunski
|
*/
|
662 |
|
|
public long macroblock(int pixels, int duration, float count)
|
663 |
|
|
{
|
664 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
665 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
666 |
|
|
di.setDuration(duration);
|
667 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
668 |
|
|
di.add(new Static1D(pixels));
|
669 |
6a06a912
|
Leszek Koltunski
|
|
670 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.MACROBLOCK, di, null, mZero2D);
|
671 |
6a06a912
|
Leszek Koltunski
|
}
|
672 |
|
|
|
673 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
674 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
675 |
|
|
// CHROMA
|
676 |
|
|
/**
|
677 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change all three of its RGB components.
|
678 |
6a06a912
|
Leszek Koltunski
|
*
|
679 |
568b29d8
|
Leszek Koltunski
|
* @param blend 1-dimensional Dynamic that returns the level of blend a given pixel will be
|
680 |
d7bbef2f
|
Leszek Koltunski
|
* mixed with the next parameter 'color': pixel = (1-level)*pixel + level*color
|
681 |
b1e91f2c
|
Leszek Koltunski
|
* @param color Color to mix. (1,0,0) is RED.
|
682 |
d7bbef2f
|
Leszek Koltunski
|
* @param region Region this Effect is limited to.
|
683 |
9351ad55
|
Leszek Koltunski
|
* Null here means 'apply the Effect to the whole Object'.
|
684 |
568b29d8
|
Leszek Koltunski
|
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D representing
|
685 |
d7bbef2f
|
Leszek Koltunski
|
* the current center of the effect.
|
686 |
|
|
* @return ID of the effect added, or -1 if we failed to add one.
|
687 |
6a06a912
|
Leszek Koltunski
|
*/
|
688 |
568b29d8
|
Leszek Koltunski
|
public long chroma(Dynamic1D blend, Static3D color, Static4D region, Dynamic2D center)
|
689 |
6a06a912
|
Leszek Koltunski
|
{
|
690 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.CHROMA, blend, color, region, center);
|
691 |
6a06a912
|
Leszek Koltunski
|
}
|
692 |
|
|
|
693 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
694 |
|
|
/**
|
695 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change all three of its RGB components.
|
696 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
697 |
|
|
* Here the center of the Effect stays constant.
|
698 |
|
|
*
|
699 |
568b29d8
|
Leszek Koltunski
|
* @param blend 1-dimensional Dynamic that returns the level of blend a given pixel will be
|
700 |
d7bbef2f
|
Leszek Koltunski
|
* mixed with the next parameter 'color': pixel = (1-level)*pixel + level*color
|
701 |
b1e91f2c
|
Leszek Koltunski
|
* @param color Color to mix. (1,0,0) is RED.
|
702 |
d7bbef2f
|
Leszek Koltunski
|
* @param region Region this Effect is limited to.
|
703 |
9351ad55
|
Leszek Koltunski
|
* Null here means 'apply the Effect to the whole Object'.
|
704 |
e0a16874
|
Leszek Koltunski
|
* @param center Center of the Effect.
|
705 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
706 |
6a06a912
|
Leszek Koltunski
|
*/
|
707 |
568b29d8
|
Leszek Koltunski
|
public long chroma(Dynamic1D blend, Static3D color, Static4D region, Static2D center)
|
708 |
6a06a912
|
Leszek Koltunski
|
{
|
709 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.CHROMA, blend, color, region, center);
|
710 |
6a06a912
|
Leszek Koltunski
|
}
|
711 |
|
|
|
712 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
713 |
|
|
/**
|
714 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change all three of its RGB components.
|
715 |
6a06a912
|
Leszek Koltunski
|
*
|
716 |
e0a16874
|
Leszek Koltunski
|
* @param blend Level of blend a given pixel will be mixed with the next parameter 'color':
|
717 |
d7bbef2f
|
Leszek Koltunski
|
* pixel = (1-t)*pixel + t*color
|
718 |
b1e91f2c
|
Leszek Koltunski
|
* @param color Color to mix. (1,0,0) is RED.
|
719 |
d7bbef2f
|
Leszek Koltunski
|
* @param region Region this Effect is limited to.
|
720 |
9351ad55
|
Leszek Koltunski
|
* Null here means 'apply the Effect to the whole Object'.
|
721 |
568b29d8
|
Leszek Koltunski
|
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D representing the
|
722 |
d7bbef2f
|
Leszek Koltunski
|
* current center of the effect.
|
723 |
|
|
* @return ID of the effect added, or -1 if we failed to add one.
|
724 |
6a06a912
|
Leszek Koltunski
|
*/
|
725 |
568b29d8
|
Leszek Koltunski
|
public long chroma(float blend, Static3D color, Static4D region, Dynamic2D center)
|
726 |
6a06a912
|
Leszek Koltunski
|
{
|
727 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.CHROMA, blend, color, region, center);
|
728 |
6a06a912
|
Leszek Koltunski
|
}
|
729 |
|
|
|
730 |
d7bbef2f
|
Leszek Koltunski
|
///// //////////////////////////////////////////////////////////////////////////////////////////////
|
731 |
6a06a912
|
Leszek Koltunski
|
/**
|
732 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change all three of its RGB components.
|
733 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
734 |
|
|
* Here the center of the Effect stays constant.
|
735 |
|
|
*
|
736 |
e0a16874
|
Leszek Koltunski
|
* @param blend Level of blend a given pixel will be mixed with the next parameter 'color':
|
737 |
d7bbef2f
|
Leszek Koltunski
|
* pixel = (1-t)*pixel + t*color
|
738 |
b1e91f2c
|
Leszek Koltunski
|
* @param color Color to mix. (1,0,0) is RED.
|
739 |
d7bbef2f
|
Leszek Koltunski
|
* @param region The Region this Effect is limited to.
|
740 |
9351ad55
|
Leszek Koltunski
|
* Null here means 'apply the Effect to the whole Object'.
|
741 |
e0a16874
|
Leszek Koltunski
|
* @param center Center of the Effect.
|
742 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
743 |
6a06a912
|
Leszek Koltunski
|
*/
|
744 |
568b29d8
|
Leszek Koltunski
|
public long chroma(float blend, Static3D color, Static4D region, Static2D center)
|
745 |
6a06a912
|
Leszek Koltunski
|
{
|
746 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.CHROMA, blend, color, region, center);
|
747 |
6a06a912
|
Leszek Koltunski
|
}
|
748 |
|
|
|
749 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
750 |
|
|
/**
|
751 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change all three of its RGB components.
|
752 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
753 |
9351ad55
|
Leszek Koltunski
|
* Here the Effect applies to the whole Object.
|
754 |
6a06a912
|
Leszek Koltunski
|
*
|
755 |
e0a16874
|
Leszek Koltunski
|
* @param blend Level of blend a given pixel will be mixed with the next parameter 'color':
|
756 |
d7bbef2f
|
Leszek Koltunski
|
* pixel = (1-t)*pixel + t*color
|
757 |
b1e91f2c
|
Leszek Koltunski
|
* @param color Color to mix. (1,0,0) is RED.
|
758 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
759 |
6a06a912
|
Leszek Koltunski
|
*/
|
760 |
568b29d8
|
Leszek Koltunski
|
public long chroma(float blend, Static3D color)
|
761 |
6a06a912
|
Leszek Koltunski
|
{
|
762 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.CHROMA, blend, color, null, mZero2D);
|
763 |
6a06a912
|
Leszek Koltunski
|
}
|
764 |
|
|
|
765 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
766 |
|
|
/**
|
767 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change all three of its RGB components.
|
768 |
6a06a912
|
Leszek Koltunski
|
*
|
769 |
568b29d8
|
Leszek Koltunski
|
* See {@link #chroma(Dynamic1D, Static3D, Static4D, Dynamic2D)}
|
770 |
6a06a912
|
Leszek Koltunski
|
*/
|
771 |
568b29d8
|
Leszek Koltunski
|
public long smooth_chroma(Dynamic1D blend, Static3D color, Static4D region, Dynamic2D center)
|
772 |
6a06a912
|
Leszek Koltunski
|
{
|
773 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SMOOTH_CHROMA, blend, color, region, center);
|
774 |
6a06a912
|
Leszek Koltunski
|
}
|
775 |
|
|
|
776 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
777 |
|
|
/**
|
778 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change all three of its RGB components.
|
779 |
6a06a912
|
Leszek Koltunski
|
*
|
780 |
568b29d8
|
Leszek Koltunski
|
* See {@link #chroma(Dynamic1D, Static3D, Static4D, Static2D)}
|
781 |
6a06a912
|
Leszek Koltunski
|
*/
|
782 |
568b29d8
|
Leszek Koltunski
|
public long smooth_chroma(Dynamic1D blend, Static3D color, Static4D region, Static2D center)
|
783 |
6a06a912
|
Leszek Koltunski
|
{
|
784 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SMOOTH_CHROMA, blend, color, region, center);
|
785 |
6a06a912
|
Leszek Koltunski
|
}
|
786 |
|
|
|
787 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
788 |
|
|
/**
|
789 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change all three of its RGB components.
|
790 |
6a06a912
|
Leszek Koltunski
|
*
|
791 |
568b29d8
|
Leszek Koltunski
|
* See {@link #chroma(float, Static3D, Static4D, Dynamic2D)}
|
792 |
6a06a912
|
Leszek Koltunski
|
*/
|
793 |
568b29d8
|
Leszek Koltunski
|
public long smooth_chroma(float blend, Static3D color, Static4D region, Dynamic2D center)
|
794 |
6a06a912
|
Leszek Koltunski
|
{
|
795 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SMOOTH_CHROMA, blend, color, region, center);
|
796 |
6a06a912
|
Leszek Koltunski
|
}
|
797 |
|
|
|
798 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
799 |
|
|
/**
|
800 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change all three of its RGB components.
|
801 |
6a06a912
|
Leszek Koltunski
|
*
|
802 |
568b29d8
|
Leszek Koltunski
|
* See {@link #chroma(float, Static3D, Static4D, Static2D)}
|
803 |
6a06a912
|
Leszek Koltunski
|
*/
|
804 |
568b29d8
|
Leszek Koltunski
|
public long smooth_chroma(float blend, Static3D color, Static4D region, Static2D center)
|
805 |
6a06a912
|
Leszek Koltunski
|
{
|
806 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SMOOTH_CHROMA, blend, color, region, center);
|
807 |
6a06a912
|
Leszek Koltunski
|
}
|
808 |
|
|
|
809 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
810 |
|
|
/**
|
811 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change all three of its RGB components.
|
812 |
6a06a912
|
Leszek Koltunski
|
*
|
813 |
568b29d8
|
Leszek Koltunski
|
* See {@link #chroma(float, Static3D)}
|
814 |
6a06a912
|
Leszek Koltunski
|
*/
|
815 |
568b29d8
|
Leszek Koltunski
|
public long smooth_chroma(float blend, Static3D color)
|
816 |
6a06a912
|
Leszek Koltunski
|
{
|
817 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SMOOTH_CHROMA, blend, color, null, mZero2D);
|
818 |
6a06a912
|
Leszek Koltunski
|
}
|
819 |
|
|
|
820 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
821 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
822 |
|
|
// ALPHA
|
823 |
|
|
/**
|
824 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its transparency level.
|
825 |
6a06a912
|
Leszek Koltunski
|
*
|
826 |
568b29d8
|
Leszek Koltunski
|
* @param alpha 1-dimensional Dynamic that returns the level of transparency we want to have at any given
|
827 |
d7bbef2f
|
Leszek Koltunski
|
* moment.
|
828 |
|
|
* @param region Region this Effect is limited to.
|
829 |
e0a16874
|
Leszek Koltunski
|
* Null here means 'apply the Effect to the whole Object'.
|
830 |
568b29d8
|
Leszek Koltunski
|
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D representing the
|
831 |
d7bbef2f
|
Leszek Koltunski
|
* current center of the effect.
|
832 |
|
|
* @return ID of the effect added, or -1 if we failed to add one.
|
833 |
6a06a912
|
Leszek Koltunski
|
*/
|
834 |
568b29d8
|
Leszek Koltunski
|
public long alpha(Dynamic1D alpha, Static4D region, Dynamic2D center)
|
835 |
6a06a912
|
Leszek Koltunski
|
{
|
836 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.ALPHA, alpha, region, center);
|
837 |
6a06a912
|
Leszek Koltunski
|
}
|
838 |
|
|
|
839 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
840 |
|
|
/**
|
841 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its transparency level.
|
842 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
843 |
|
|
* Here the center of the Effect stays constant.
|
844 |
|
|
*
|
845 |
568b29d8
|
Leszek Koltunski
|
* @param alpha 1-dimensional Dynamic that returns the level of transparency we want to have at any given
|
846 |
d7bbef2f
|
Leszek Koltunski
|
* moment.
|
847 |
|
|
* @param region Region this Effect is limited to.
|
848 |
e0a16874
|
Leszek Koltunski
|
* Null here means 'apply the Effect to the whole Object'.
|
849 |
|
|
* @param center Center of the Effect.
|
850 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
851 |
6a06a912
|
Leszek Koltunski
|
*/
|
852 |
568b29d8
|
Leszek Koltunski
|
public long alpha(Dynamic1D alpha, Static4D region, Static2D center)
|
853 |
6a06a912
|
Leszek Koltunski
|
{
|
854 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.ALPHA, alpha, region, center);
|
855 |
6a06a912
|
Leszek Koltunski
|
}
|
856 |
|
|
|
857 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
858 |
|
|
/**
|
859 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its transparency level.
|
860 |
6a06a912
|
Leszek Koltunski
|
*
|
861 |
d7bbef2f
|
Leszek Koltunski
|
* @param alpha Level of Alpha (between 0 and 1) we want to interpolate to.
|
862 |
|
|
* @param region Region this Effect is limited to.
|
863 |
e0a16874
|
Leszek Koltunski
|
* Null here means 'apply the Effect to the whole Object'.
|
864 |
568b29d8
|
Leszek Koltunski
|
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D representing the
|
865 |
d7bbef2f
|
Leszek Koltunski
|
* current center of the effect.
|
866 |
6a06a912
|
Leszek Koltunski
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
867 |
568b29d8
|
Leszek Koltunski
|
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)}
|
868 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
869 |
6a06a912
|
Leszek Koltunski
|
*/
|
870 |
568b29d8
|
Leszek Koltunski
|
public long alpha(float alpha, Static4D region, Dynamic2D center, int duration, float count)
|
871 |
6a06a912
|
Leszek Koltunski
|
{
|
872 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
873 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
874 |
|
|
di.setDuration(duration);
|
875 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
876 |
|
|
di.add(new Static1D(alpha));
|
877 |
6a06a912
|
Leszek Koltunski
|
|
878 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.ALPHA, di, region, center);
|
879 |
6a06a912
|
Leszek Koltunski
|
}
|
880 |
|
|
|
881 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
882 |
|
|
/**
|
883 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its transparency level.
|
884 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
885 |
|
|
* Here the center of the Effect stays constant.
|
886 |
|
|
*
|
887 |
e0a16874
|
Leszek Koltunski
|
* @param alpha Level of Alpha (between 0 and 1) we want to interpolate to.
|
888 |
|
|
* @param region Region this Effect is limited to.
|
889 |
|
|
* Null here means 'apply the Effect to the whole Object'.
|
890 |
|
|
* @param center Center of the Effect.
|
891 |
6a06a912
|
Leszek Koltunski
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
892 |
568b29d8
|
Leszek Koltunski
|
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)}
|
893 |
e0a16874
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
894 |
6a06a912
|
Leszek Koltunski
|
*/
|
895 |
568b29d8
|
Leszek Koltunski
|
public long alpha(float alpha, Static4D region, Static2D center, int duration, float count)
|
896 |
6a06a912
|
Leszek Koltunski
|
{
|
897 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
898 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
899 |
|
|
di.setDuration(duration);
|
900 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
901 |
|
|
di.add(new Static1D(alpha));
|
902 |
6a06a912
|
Leszek Koltunski
|
|
903 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.ALPHA, di, region, center);
|
904 |
6a06a912
|
Leszek Koltunski
|
}
|
905 |
|
|
|
906 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
907 |
|
|
/**
|
908 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its transparency level.
|
909 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
910 |
|
|
* Here the center of the Effect stays constant and the effect for now change in time.
|
911 |
|
|
*
|
912 |
d7bbef2f
|
Leszek Koltunski
|
* @param alpha Level of Alpha (between 0 and 1) we want to interpolate to.
|
913 |
|
|
* @param region Region this Effect is limited to.
|
914 |
e0a16874
|
Leszek Koltunski
|
* Null here means 'apply the Effect to the whole Object'.
|
915 |
|
|
* @param center Center of the Effect.
|
916 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
917 |
6a06a912
|
Leszek Koltunski
|
*/
|
918 |
568b29d8
|
Leszek Koltunski
|
public long alpha(float alpha, Static4D region, Static2D center)
|
919 |
6a06a912
|
Leszek Koltunski
|
{
|
920 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
921 |
6a06a912
|
Leszek Koltunski
|
di.setCount(0.5f);
|
922 |
|
|
di.setDuration(0);
|
923 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
924 |
|
|
di.add(new Static1D(alpha));
|
925 |
6a06a912
|
Leszek Koltunski
|
|
926 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.ALPHA, di, region, center);
|
927 |
6a06a912
|
Leszek Koltunski
|
}
|
928 |
|
|
|
929 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
930 |
|
|
/**
|
931 |
e0a16874
|
Leszek Koltunski
|
* Makes the whole Object change its transparency level.
|
932 |
6a06a912
|
Leszek Koltunski
|
*
|
933 |
d7bbef2f
|
Leszek Koltunski
|
* @param alpha Level of Alpha (between 0 and 1) we want to interpolate to.
|
934 |
6a06a912
|
Leszek Koltunski
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
935 |
568b29d8
|
Leszek Koltunski
|
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)}
|
936 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
937 |
6a06a912
|
Leszek Koltunski
|
*/
|
938 |
|
|
public long alpha(float alpha, int duration, float count)
|
939 |
|
|
{
|
940 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
941 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
942 |
|
|
di.setDuration(duration);
|
943 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
944 |
|
|
di.add(new Static1D(alpha));
|
945 |
6a06a912
|
Leszek Koltunski
|
|
946 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.ALPHA, di,null, mZero2D);
|
947 |
6a06a912
|
Leszek Koltunski
|
}
|
948 |
|
|
|
949 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
950 |
|
|
/**
|
951 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its transparency level.
|
952 |
6a06a912
|
Leszek Koltunski
|
*
|
953 |
568b29d8
|
Leszek Koltunski
|
* See {@link #alpha(Dynamic1D, Static4D, Dynamic2D)}
|
954 |
6a06a912
|
Leszek Koltunski
|
*/
|
955 |
568b29d8
|
Leszek Koltunski
|
public long smooth_alpha(Dynamic1D alpha, Static4D region, Dynamic2D center)
|
956 |
6a06a912
|
Leszek Koltunski
|
{
|
957 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SMOOTH_ALPHA, alpha, region, center);
|
958 |
6a06a912
|
Leszek Koltunski
|
}
|
959 |
|
|
|
960 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
961 |
|
|
/**
|
962 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its transparency level.
|
963 |
6a06a912
|
Leszek Koltunski
|
*
|
964 |
568b29d8
|
Leszek Koltunski
|
* See {@link #alpha(Dynamic1D, Static4D, Static2D)}
|
965 |
6a06a912
|
Leszek Koltunski
|
*/
|
966 |
568b29d8
|
Leszek Koltunski
|
public long smooth_alpha(Dynamic1D alpha, Static4D region, Static2D center)
|
967 |
6a06a912
|
Leszek Koltunski
|
{
|
968 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SMOOTH_ALPHA, alpha, region, center);
|
969 |
6a06a912
|
Leszek Koltunski
|
}
|
970 |
|
|
|
971 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
972 |
|
|
/**
|
973 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its transparency level.
|
974 |
6a06a912
|
Leszek Koltunski
|
*
|
975 |
568b29d8
|
Leszek Koltunski
|
* See {@link #alpha(float, Static4D, Dynamic2D, int, float)}
|
976 |
6a06a912
|
Leszek Koltunski
|
*/
|
977 |
568b29d8
|
Leszek Koltunski
|
public long smooth_alpha(float alpha, Static4D region, Dynamic2D center, int duration, float count)
|
978 |
6a06a912
|
Leszek Koltunski
|
{
|
979 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
980 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
981 |
|
|
di.setDuration(duration);
|
982 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
983 |
|
|
di.add(new Static1D(alpha));
|
984 |
6a06a912
|
Leszek Koltunski
|
|
985 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SMOOTH_ALPHA, di, region, center);
|
986 |
6a06a912
|
Leszek Koltunski
|
}
|
987 |
|
|
|
988 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
989 |
|
|
/**
|
990 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its transparency level.
|
991 |
6a06a912
|
Leszek Koltunski
|
*
|
992 |
568b29d8
|
Leszek Koltunski
|
* See {@link #alpha(float, Static4D, Static2D, int, float)}
|
993 |
6a06a912
|
Leszek Koltunski
|
*/
|
994 |
568b29d8
|
Leszek Koltunski
|
public long smooth_alpha(float alpha, Static4D region, Static2D center, int duration, float count)
|
995 |
6a06a912
|
Leszek Koltunski
|
{
|
996 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
997 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
998 |
|
|
di.setDuration(duration);
|
999 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
1000 |
|
|
di.add(new Static1D(alpha));
|
1001 |
6a06a912
|
Leszek Koltunski
|
|
1002 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SMOOTH_ALPHA, di, region, center);
|
1003 |
6a06a912
|
Leszek Koltunski
|
}
|
1004 |
|
|
|
1005 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1006 |
|
|
/**
|
1007 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its transparency level.
|
1008 |
6a06a912
|
Leszek Koltunski
|
*
|
1009 |
568b29d8
|
Leszek Koltunski
|
* See {@link #alpha(float, Static4D, Static2D)}
|
1010 |
6a06a912
|
Leszek Koltunski
|
*/
|
1011 |
568b29d8
|
Leszek Koltunski
|
public long smooth_alpha(float alpha, Static4D region, Static2D center)
|
1012 |
6a06a912
|
Leszek Koltunski
|
{
|
1013 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
1014 |
6a06a912
|
Leszek Koltunski
|
di.setCount(0.5f);
|
1015 |
|
|
di.setDuration(0);
|
1016 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
1017 |
|
|
di.add(new Static1D(alpha));
|
1018 |
6a06a912
|
Leszek Koltunski
|
|
1019 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SMOOTH_ALPHA, di, region, center);
|
1020 |
6a06a912
|
Leszek Koltunski
|
}
|
1021 |
|
|
|
1022 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1023 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1024 |
|
|
// BRIGHTNESS
|
1025 |
|
|
/**
|
1026 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its brightness level.
|
1027 |
6a06a912
|
Leszek Koltunski
|
*
|
1028 |
568b29d8
|
Leszek Koltunski
|
* @param brightness 1-dimensional Dynamic that returns the level of brightness we want to have
|
1029 |
e0a16874
|
Leszek Koltunski
|
* at any given moment.
|
1030 |
|
|
* @param region Region this Effect is limited to.
|
1031 |
|
|
* Null here means 'apply the Effect to the whole Object'.
|
1032 |
568b29d8
|
Leszek Koltunski
|
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D representing
|
1033 |
e0a16874
|
Leszek Koltunski
|
* the current center of the effect.
|
1034 |
|
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1035 |
6a06a912
|
Leszek Koltunski
|
*/
|
1036 |
568b29d8
|
Leszek Koltunski
|
public long brightness(Dynamic1D brightness, Static4D region, Dynamic2D center)
|
1037 |
6a06a912
|
Leszek Koltunski
|
{
|
1038 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.BRIGHTNESS, brightness, region, center);
|
1039 |
6a06a912
|
Leszek Koltunski
|
}
|
1040 |
|
|
|
1041 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1042 |
|
|
/**
|
1043 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its brightness level.
|
1044 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
1045 |
|
|
* Here the center of the Effect stays constant.
|
1046 |
|
|
*
|
1047 |
568b29d8
|
Leszek Koltunski
|
* @param brightness 1-dimensional Dynamic that returns the level of brightness we want to have
|
1048 |
e0a16874
|
Leszek Koltunski
|
* at any given moment.
|
1049 |
|
|
* @param region Region this Effect is limited to.
|
1050 |
|
|
* Null here means 'apply the Effect to the whole Object'.
|
1051 |
|
|
* @param center Center of the Effect.
|
1052 |
|
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1053 |
6a06a912
|
Leszek Koltunski
|
*/
|
1054 |
568b29d8
|
Leszek Koltunski
|
public long brightness(Dynamic1D brightness, Static4D region, Static2D center)
|
1055 |
6a06a912
|
Leszek Koltunski
|
{
|
1056 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.BRIGHTNESS, brightness, region, center);
|
1057 |
6a06a912
|
Leszek Koltunski
|
}
|
1058 |
|
|
|
1059 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1060 |
|
|
/**
|
1061 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its brightness level.
|
1062 |
6a06a912
|
Leszek Koltunski
|
*
|
1063 |
d7bbef2f
|
Leszek Koltunski
|
* @param brightness Level of Brightness (between 0 and infinity) we want to interpolate to.
|
1064 |
|
|
* 1 - level of brightness unchanged, anything less than 1 - 'darken the image',
|
1065 |
|
|
* anything more than 1- lighten it up.
|
1066 |
|
|
* @param region Region this Effect is limited to.
|
1067 |
e0a16874
|
Leszek Koltunski
|
* Null here means 'apply the Effect to the whole Object'.
|
1068 |
568b29d8
|
Leszek Koltunski
|
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D
|
1069 |
d7bbef2f
|
Leszek Koltunski
|
* representing the current center of the effect.
|
1070 |
|
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
1071 |
568b29d8
|
Leszek Koltunski
|
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)}
|
1072 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1073 |
6a06a912
|
Leszek Koltunski
|
*/
|
1074 |
568b29d8
|
Leszek Koltunski
|
public long brightness(float brightness, Static4D region, Dynamic2D center, int duration, float count)
|
1075 |
6a06a912
|
Leszek Koltunski
|
{
|
1076 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
1077 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
1078 |
|
|
di.setDuration(duration);
|
1079 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
1080 |
|
|
di.add(new Static1D(brightness));
|
1081 |
6a06a912
|
Leszek Koltunski
|
|
1082 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.BRIGHTNESS, di, region, center);
|
1083 |
6a06a912
|
Leszek Koltunski
|
}
|
1084 |
|
|
|
1085 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1086 |
|
|
/**
|
1087 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its brightness level.
|
1088 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
1089 |
|
|
* Here the center of the Effect stays constant.
|
1090 |
|
|
*
|
1091 |
d7bbef2f
|
Leszek Koltunski
|
* @param brightness Level of Brightness (between 0 and infinity) we want to interpolate to.
|
1092 |
|
|
* 1 - level of brightness unchanged, anything less than 1 - 'darken the image',
|
1093 |
|
|
* anything more than 1 - lighten it up.
|
1094 |
|
|
* @param region Region this Effect is limited to.
|
1095 |
e0a16874
|
Leszek Koltunski
|
* Null here means 'apply the Effect to the whole Object'.
|
1096 |
|
|
* @param center Center of the Effect.
|
1097 |
d7bbef2f
|
Leszek Koltunski
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
1098 |
568b29d8
|
Leszek Koltunski
|
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)}
|
1099 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1100 |
6a06a912
|
Leszek Koltunski
|
*/
|
1101 |
568b29d8
|
Leszek Koltunski
|
public long brightness(float brightness, Static4D region, Static2D center, int duration, float count)
|
1102 |
6a06a912
|
Leszek Koltunski
|
{
|
1103 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
1104 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
1105 |
|
|
di.setDuration(duration);
|
1106 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
1107 |
|
|
di.add(new Static1D(brightness));
|
1108 |
6a06a912
|
Leszek Koltunski
|
|
1109 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.BRIGHTNESS, di, region, center);
|
1110 |
6a06a912
|
Leszek Koltunski
|
}
|
1111 |
|
|
|
1112 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1113 |
|
|
/**
|
1114 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its brightness level.
|
1115 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
1116 |
|
|
* Here the center of the Effect stays constant and the effect for now change in time.
|
1117 |
|
|
*
|
1118 |
d7bbef2f
|
Leszek Koltunski
|
* @param brightness Level of Brightness (between 0 and infinity) we want to interpolate to.
|
1119 |
|
|
* 1 - level of brightness unchanged, anything less than 1 - 'darken the image',
|
1120 |
|
|
* anything more than 1 - lighten it up.
|
1121 |
|
|
* @param region Region this Effect is limited to.
|
1122 |
e0a16874
|
Leszek Koltunski
|
* Null here means 'apply the Effect to the whole Object'.
|
1123 |
|
|
* @param center Center of the Effect.
|
1124 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1125 |
6a06a912
|
Leszek Koltunski
|
*/
|
1126 |
568b29d8
|
Leszek Koltunski
|
public long brightness(float brightness, Static4D region, Static2D center)
|
1127 |
6a06a912
|
Leszek Koltunski
|
{
|
1128 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
1129 |
6a06a912
|
Leszek Koltunski
|
di.setCount(0.5f);
|
1130 |
|
|
di.setDuration(0);
|
1131 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
1132 |
|
|
di.add(new Static1D(brightness));
|
1133 |
6a06a912
|
Leszek Koltunski
|
|
1134 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.BRIGHTNESS, di, region, center);
|
1135 |
6a06a912
|
Leszek Koltunski
|
}
|
1136 |
|
|
|
1137 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1138 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1139 |
|
|
// SMOOTH BRIGHTNESS
|
1140 |
|
|
/**
|
1141 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its brightness level.
|
1142 |
6a06a912
|
Leszek Koltunski
|
*
|
1143 |
568b29d8
|
Leszek Koltunski
|
* @param brightness 1-dimensional Dynamic that returns the level of brightness we want to have
|
1144 |
e0a16874
|
Leszek Koltunski
|
* at any given moment.
|
1145 |
|
|
* @param region Region this Effect is limited to.
|
1146 |
|
|
* Null here means 'apply the Effect to the whole Object'.
|
1147 |
568b29d8
|
Leszek Koltunski
|
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D
|
1148 |
e0a16874
|
Leszek Koltunski
|
* representing the current center of the effect.
|
1149 |
|
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1150 |
6a06a912
|
Leszek Koltunski
|
*/
|
1151 |
568b29d8
|
Leszek Koltunski
|
public long smooth_brightness(Dynamic1D brightness, Static4D region, Dynamic2D center)
|
1152 |
6a06a912
|
Leszek Koltunski
|
{
|
1153 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SMOOTH_BRIGHTNESS, brightness, region, center);
|
1154 |
6a06a912
|
Leszek Koltunski
|
}
|
1155 |
|
|
|
1156 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1157 |
|
|
/**
|
1158 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its brightness level.
|
1159 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
1160 |
|
|
* Here the center of the Effect stays constant.
|
1161 |
|
|
*
|
1162 |
568b29d8
|
Leszek Koltunski
|
* @param brightness 1-dimensional Dynamic that returns the level of brightness we want to have
|
1163 |
e0a16874
|
Leszek Koltunski
|
* at any given moment.
|
1164 |
|
|
* @param region Region this Effect is limited to.
|
1165 |
|
|
* Null here means 'apply the Effect to the whole Object'.
|
1166 |
|
|
* @param center Center of the Effect.
|
1167 |
|
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1168 |
6a06a912
|
Leszek Koltunski
|
*/
|
1169 |
568b29d8
|
Leszek Koltunski
|
public long smooth_brightness(Dynamic1D brightness, Static4D region, Static2D center)
|
1170 |
6a06a912
|
Leszek Koltunski
|
{
|
1171 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SMOOTH_BRIGHTNESS, brightness, region, center);
|
1172 |
6a06a912
|
Leszek Koltunski
|
}
|
1173 |
|
|
|
1174 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1175 |
|
|
/**
|
1176 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its brightness level.
|
1177 |
6a06a912
|
Leszek Koltunski
|
*
|
1178 |
d7bbef2f
|
Leszek Koltunski
|
* @param brightness Level of Brightness (between 0 and infinity) we want to interpolate to.
|
1179 |
|
|
* 1 - level of brightness unchanged, anything less than 1 - 'darken the image',
|
1180 |
|
|
* anything more than 1 - lighten it up.
|
1181 |
|
|
* @param region Region this Effect is limited to.
|
1182 |
e0a16874
|
Leszek Koltunski
|
* Null here means 'apply the Effect to the whole Object'.
|
1183 |
568b29d8
|
Leszek Koltunski
|
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D
|
1184 |
d7bbef2f
|
Leszek Koltunski
|
* represention the current center of the effect.
|
1185 |
|
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
1186 |
568b29d8
|
Leszek Koltunski
|
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)}
|
1187 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1188 |
6a06a912
|
Leszek Koltunski
|
*/
|
1189 |
568b29d8
|
Leszek Koltunski
|
public long smooth_brightness(float brightness, Static4D region, Dynamic2D center, int duration, float count)
|
1190 |
6a06a912
|
Leszek Koltunski
|
{
|
1191 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
1192 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
1193 |
|
|
di.setDuration(duration);
|
1194 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
1195 |
|
|
di.add(new Static1D(brightness));
|
1196 |
6a06a912
|
Leszek Koltunski
|
|
1197 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SMOOTH_BRIGHTNESS, di, region, center);
|
1198 |
6a06a912
|
Leszek Koltunski
|
}
|
1199 |
|
|
|
1200 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1201 |
|
|
/**
|
1202 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its brightness level.
|
1203 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
1204 |
|
|
* Here the center of the Effect stays constant.
|
1205 |
|
|
*
|
1206 |
d7bbef2f
|
Leszek Koltunski
|
* @param brightness Level of Brightness (between 0 and infinity) we want to interpolate to.
|
1207 |
|
|
* 1 - level of brightness unchanged, anything less than 1 - 'darken the image',
|
1208 |
|
|
* anything more than 1 - lighten it up.
|
1209 |
|
|
* @param region Region this Effect is limited to.
|
1210 |
e0a16874
|
Leszek Koltunski
|
* Null here means 'apply the Effect to the whole Object'.
|
1211 |
|
|
* @param center Center of the Effect.
|
1212 |
d7bbef2f
|
Leszek Koltunski
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
1213 |
568b29d8
|
Leszek Koltunski
|
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)}
|
1214 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1215 |
6a06a912
|
Leszek Koltunski
|
*/
|
1216 |
568b29d8
|
Leszek Koltunski
|
public long smooth_brightness(float brightness, Static4D region, Static2D center, int duration, float count)
|
1217 |
6a06a912
|
Leszek Koltunski
|
{
|
1218 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
1219 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
1220 |
|
|
di.setDuration(duration);
|
1221 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
1222 |
|
|
di.add(new Static1D(brightness));
|
1223 |
6a06a912
|
Leszek Koltunski
|
|
1224 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SMOOTH_BRIGHTNESS, di, region, center);
|
1225 |
6a06a912
|
Leszek Koltunski
|
}
|
1226 |
|
|
|
1227 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1228 |
|
|
/**
|
1229 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its brightness level.
|
1230 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
1231 |
|
|
* Here the center of the Effect stays constant and the effect for now change in time.
|
1232 |
|
|
*
|
1233 |
d7bbef2f
|
Leszek Koltunski
|
* @param brightness Level of Brightness (between 0 and infinity) we want to interpolate to.
|
1234 |
|
|
* 1 - level of brightness unchanged, anything less than 1 - 'darken the image',
|
1235 |
|
|
* anything more than 1 - lighten it up.
|
1236 |
|
|
* @param region Region this Effect is limited to.
|
1237 |
e0a16874
|
Leszek Koltunski
|
* Null here means 'apply the Effect to the whole Object'.
|
1238 |
|
|
* @param center Center of the Effect.
|
1239 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1240 |
6a06a912
|
Leszek Koltunski
|
*/
|
1241 |
568b29d8
|
Leszek Koltunski
|
public long smooth_brightness(float brightness, Static4D region, Static2D center)
|
1242 |
6a06a912
|
Leszek Koltunski
|
{
|
1243 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
1244 |
6a06a912
|
Leszek Koltunski
|
di.setCount(0.5f);
|
1245 |
|
|
di.setDuration(0);
|
1246 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
1247 |
|
|
di.add(new Static1D(brightness));
|
1248 |
6a06a912
|
Leszek Koltunski
|
|
1249 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SMOOTH_BRIGHTNESS, di, region, center);
|
1250 |
6a06a912
|
Leszek Koltunski
|
}
|
1251 |
|
|
|
1252 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1253 |
|
|
/**
|
1254 |
e0a16874
|
Leszek Koltunski
|
* Makes the whole Object change its brightness level.
|
1255 |
6a06a912
|
Leszek Koltunski
|
*
|
1256 |
d7bbef2f
|
Leszek Koltunski
|
* @param brightness Level of Brightness (between 0 and infinity) we want to interpolate to.
|
1257 |
|
|
* 1 - level of brightness unchanged, anything less than 1 - 'darken the image',
|
1258 |
|
|
* anything more than 1- lighten it up.
|
1259 |
|
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
1260 |
568b29d8
|
Leszek Koltunski
|
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)}
|
1261 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1262 |
6a06a912
|
Leszek Koltunski
|
*/
|
1263 |
|
|
public long smooth_brightness(float brightness, int duration, float count)
|
1264 |
|
|
{
|
1265 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
1266 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
1267 |
|
|
di.setDuration(duration);
|
1268 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
1269 |
|
|
di.add(new Static1D(brightness));
|
1270 |
6a06a912
|
Leszek Koltunski
|
|
1271 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SMOOTH_BRIGHTNESS, di,null, mZero2D);
|
1272 |
6a06a912
|
Leszek Koltunski
|
}
|
1273 |
|
|
|
1274 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1275 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1276 |
|
|
// CONTRAST
|
1277 |
|
|
/**
|
1278 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its contrast level.
|
1279 |
6a06a912
|
Leszek Koltunski
|
*
|
1280 |
568b29d8
|
Leszek Koltunski
|
* @param contrast 1-dimensional Dynamic that returns the level of contrast we want to have
|
1281 |
e0a16874
|
Leszek Koltunski
|
* at any given moment.
|
1282 |
|
|
* @param region Region this Effect is limited to.
|
1283 |
|
|
* Null here means 'apply the Effect to the whole Object'.
|
1284 |
568b29d8
|
Leszek Koltunski
|
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D
|
1285 |
e0a16874
|
Leszek Koltunski
|
* representing the current center of the effect.
|
1286 |
|
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1287 |
6a06a912
|
Leszek Koltunski
|
*/
|
1288 |
568b29d8
|
Leszek Koltunski
|
public long contrast(Dynamic1D contrast, Static4D region, Dynamic2D center)
|
1289 |
6a06a912
|
Leszek Koltunski
|
{
|
1290 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.CONTRAST, contrast, region, center);
|
1291 |
6a06a912
|
Leszek Koltunski
|
}
|
1292 |
|
|
|
1293 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1294 |
|
|
/**
|
1295 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its contrast level.
|
1296 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
1297 |
|
|
* Here the center of the Effect stays constant.
|
1298 |
|
|
*
|
1299 |
568b29d8
|
Leszek Koltunski
|
* @param contrast 1-dimensional Dynamic that returns the level of contrast we want to have
|
1300 |
e0a16874
|
Leszek Koltunski
|
* at any given moment.
|
1301 |
|
|
* @param region Region this Effect is limited to.
|
1302 |
|
|
* Null here means 'apply the Effect to the whole Object'.
|
1303 |
|
|
* @param center Center of the Effect.
|
1304 |
|
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1305 |
6a06a912
|
Leszek Koltunski
|
*/
|
1306 |
568b29d8
|
Leszek Koltunski
|
public long contrast(Dynamic1D contrast, Static4D region, Static2D center)
|
1307 |
6a06a912
|
Leszek Koltunski
|
{
|
1308 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.CONTRAST, contrast, region, center);
|
1309 |
6a06a912
|
Leszek Koltunski
|
}
|
1310 |
|
|
|
1311 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1312 |
|
|
/**
|
1313 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its contrast level.
|
1314 |
6a06a912
|
Leszek Koltunski
|
*
|
1315 |
d7bbef2f
|
Leszek Koltunski
|
* @param contrast Level of contrast (between 0 and infinity) we want to interpolate to.
|
1316 |
|
|
* 1 - level of contrast unchanged, anything less than 1 - reduce contrast,
|
1317 |
|
|
* anything more than 1 - increase the contrast.
|
1318 |
|
|
* @param region Region this Effect is limited to.
|
1319 |
e0a16874
|
Leszek Koltunski
|
* Null here means 'apply the Effect to the whole Object'.
|
1320 |
568b29d8
|
Leszek Koltunski
|
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D
|
1321 |
d7bbef2f
|
Leszek Koltunski
|
* represention the current center of the effect.
|
1322 |
6a06a912
|
Leszek Koltunski
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
1323 |
568b29d8
|
Leszek Koltunski
|
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)}
|
1324 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1325 |
6a06a912
|
Leszek Koltunski
|
*/
|
1326 |
568b29d8
|
Leszek Koltunski
|
public long contrast(float contrast, Static4D region, Dynamic2D center, int duration, float count)
|
1327 |
6a06a912
|
Leszek Koltunski
|
{
|
1328 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
1329 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
1330 |
|
|
di.setDuration(duration);
|
1331 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
1332 |
|
|
di.add(new Static1D(contrast));
|
1333 |
6a06a912
|
Leszek Koltunski
|
|
1334 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.CONTRAST, di, region, center);
|
1335 |
6a06a912
|
Leszek Koltunski
|
}
|
1336 |
|
|
|
1337 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1338 |
|
|
/**
|
1339 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its contrast level.
|
1340 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
1341 |
|
|
* Here the center of the Effect stays constant.
|
1342 |
|
|
*
|
1343 |
d7bbef2f
|
Leszek Koltunski
|
* @param contrast Level of contrast (between 0 and infinity) we want to interpolate to.
|
1344 |
|
|
* 1 - level of contrast unchanged, anything less than 1 - reduce contrast,
|
1345 |
|
|
* anything more than 1 -increase the contrast.
|
1346 |
|
|
* @param region Region this Effect is limited to.
|
1347 |
e0a16874
|
Leszek Koltunski
|
* Null here means 'apply the Effect to the whole Object'.
|
1348 |
|
|
* @param center Center of the Effect.
|
1349 |
6a06a912
|
Leszek Koltunski
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
1350 |
568b29d8
|
Leszek Koltunski
|
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)}
|
1351 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1352 |
6a06a912
|
Leszek Koltunski
|
*/
|
1353 |
568b29d8
|
Leszek Koltunski
|
public long contrast(float contrast, Static4D region, Static2D center, int duration, float count)
|
1354 |
6a06a912
|
Leszek Koltunski
|
{
|
1355 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
1356 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
1357 |
|
|
di.setDuration(duration);
|
1358 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
1359 |
|
|
di.add(new Static1D(contrast));
|
1360 |
6a06a912
|
Leszek Koltunski
|
|
1361 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.CONTRAST, di, region, center);
|
1362 |
6a06a912
|
Leszek Koltunski
|
}
|
1363 |
|
|
|
1364 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1365 |
|
|
/**
|
1366 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its contrast level.
|
1367 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
1368 |
|
|
* Here the center of the Effect stays constant and the effect for now change in time.
|
1369 |
|
|
*
|
1370 |
d7bbef2f
|
Leszek Koltunski
|
* @param contrast Level of contrast (between 0 and infinity) we want to interpolate to.
|
1371 |
|
|
* 1 - level of contrast unchanged, anything less than 1 - reduce contrast,
|
1372 |
|
|
* anything more than 1 - increase the contrast.
|
1373 |
|
|
* @param region Region this Effect is limited to.
|
1374 |
e0a16874
|
Leszek Koltunski
|
* Null here means 'apply the Effect to the whole Object'.
|
1375 |
|
|
* @param center Center of the Effect.
|
1376 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1377 |
6a06a912
|
Leszek Koltunski
|
*/
|
1378 |
568b29d8
|
Leszek Koltunski
|
public long contrast(float contrast, Static4D region, Static2D center)
|
1379 |
6a06a912
|
Leszek Koltunski
|
{
|
1380 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
1381 |
6a06a912
|
Leszek Koltunski
|
di.setCount(0.5f);
|
1382 |
|
|
di.setDuration(0);
|
1383 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
1384 |
|
|
di.add(new Static1D(contrast));
|
1385 |
6a06a912
|
Leszek Koltunski
|
|
1386 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.CONTRAST, di, region, center);
|
1387 |
6a06a912
|
Leszek Koltunski
|
}
|
1388 |
|
|
|
1389 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1390 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1391 |
|
|
// SMOOTH CONTRAST
|
1392 |
|
|
/**
|
1393 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its contrast level.
|
1394 |
6a06a912
|
Leszek Koltunski
|
*
|
1395 |
568b29d8
|
Leszek Koltunski
|
* @param contrast 1-dimensional Dynamic that returns the level of contrast we want to have
|
1396 |
e0a16874
|
Leszek Koltunski
|
* at any given moment.
|
1397 |
|
|
* @param region Region this Effect is limited to.
|
1398 |
|
|
* Null here means 'apply the Effect to the whole Object'.
|
1399 |
568b29d8
|
Leszek Koltunski
|
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D
|
1400 |
e0a16874
|
Leszek Koltunski
|
* representing the current center of the effect.
|
1401 |
|
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1402 |
6a06a912
|
Leszek Koltunski
|
*/
|
1403 |
568b29d8
|
Leszek Koltunski
|
public long smooth_contrast(Dynamic1D contrast, Static4D region, Dynamic2D center)
|
1404 |
6a06a912
|
Leszek Koltunski
|
{
|
1405 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SMOOTH_CONTRAST, contrast, region, center);
|
1406 |
6a06a912
|
Leszek Koltunski
|
}
|
1407 |
|
|
|
1408 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1409 |
|
|
/**
|
1410 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its contrast level.
|
1411 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
1412 |
|
|
* Here the center of the Effect stays constant.
|
1413 |
|
|
*
|
1414 |
568b29d8
|
Leszek Koltunski
|
* @param contrast 1-dimensional Dynamic that returns the level of contrast we want to have
|
1415 |
e0a16874
|
Leszek Koltunski
|
* at any given moment.
|
1416 |
|
|
* @param region Region this Effect is limited to.
|
1417 |
|
|
* Null here means 'apply the Effect to the whole Object'.
|
1418 |
|
|
* @param center Center of the Effect.
|
1419 |
|
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1420 |
6a06a912
|
Leszek Koltunski
|
*/
|
1421 |
568b29d8
|
Leszek Koltunski
|
public long smooth_contrast(Dynamic1D contrast, Static4D region, Static2D center)
|
1422 |
6a06a912
|
Leszek Koltunski
|
{
|
1423 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SMOOTH_CONTRAST, contrast, region, center);
|
1424 |
6a06a912
|
Leszek Koltunski
|
}
|
1425 |
|
|
|
1426 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1427 |
|
|
/**
|
1428 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its contrast level.
|
1429 |
6a06a912
|
Leszek Koltunski
|
*
|
1430 |
d7bbef2f
|
Leszek Koltunski
|
* @param contrast Level of contrast (between 0 and infinity) we want to interpolate to.
|
1431 |
|
|
* 1 - level of contrast unchanged, anything less than 1 - reduce contrast,
|
1432 |
|
|
* anything more than 1 - increase the contrast.
|
1433 |
|
|
* @param region Region this Effect is limited to.
|
1434 |
e0a16874
|
Leszek Koltunski
|
* Null here means 'apply the Effect to the whole Object'.
|
1435 |
568b29d8
|
Leszek Koltunski
|
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D
|
1436 |
d7bbef2f
|
Leszek Koltunski
|
* representing the current center of the effect.
|
1437 |
6a06a912
|
Leszek Koltunski
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
1438 |
568b29d8
|
Leszek Koltunski
|
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)}
|
1439 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1440 |
6a06a912
|
Leszek Koltunski
|
*/
|
1441 |
568b29d8
|
Leszek Koltunski
|
public long smooth_contrast(float contrast, Static4D region, Dynamic2D center, int duration, float count)
|
1442 |
6a06a912
|
Leszek Koltunski
|
{
|
1443 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
1444 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
1445 |
|
|
di.setDuration(duration);
|
1446 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
1447 |
|
|
di.add(new Static1D(contrast));
|
1448 |
6a06a912
|
Leszek Koltunski
|
|
1449 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SMOOTH_CONTRAST, di, region, center);
|
1450 |
6a06a912
|
Leszek Koltunski
|
}
|
1451 |
|
|
|
1452 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1453 |
|
|
/**
|
1454 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its contrast level.
|
1455 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
1456 |
|
|
* Here the center of the Effect stays constant.
|
1457 |
|
|
*
|
1458 |
d7bbef2f
|
Leszek Koltunski
|
* @param contrast Level of contrast (between 0 and infinity) we want to interpolate to.
|
1459 |
|
|
* 1 - level of contrast unchanged, anything less than 1 - reduce contrast,
|
1460 |
|
|
* anything more than 1 - increase the contrast.
|
1461 |
|
|
* @param region Region this Effect is limited to.
|
1462 |
e0a16874
|
Leszek Koltunski
|
* Null here means 'apply the Effect to the whole Object'.
|
1463 |
|
|
* @param center Center of the Effect.
|
1464 |
6a06a912
|
Leszek Koltunski
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
1465 |
568b29d8
|
Leszek Koltunski
|
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)}
|
1466 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1467 |
6a06a912
|
Leszek Koltunski
|
*/
|
1468 |
568b29d8
|
Leszek Koltunski
|
public long smooth_contrast(float contrast, Static4D region, Static2D center, int duration, float count)
|
1469 |
6a06a912
|
Leszek Koltunski
|
{
|
1470 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
1471 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
1472 |
|
|
di.setDuration(duration);
|
1473 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
1474 |
|
|
di.add(new Static1D(contrast));
|
1475 |
6a06a912
|
Leszek Koltunski
|
|
1476 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SMOOTH_CONTRAST, di, region, center);
|
1477 |
6a06a912
|
Leszek Koltunski
|
}
|
1478 |
|
|
|
1479 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1480 |
|
|
/**
|
1481 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its contrast level.
|
1482 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
1483 |
|
|
* Here the center of the Effect stays constant and the effect for now change in time.
|
1484 |
|
|
*
|
1485 |
d7bbef2f
|
Leszek Koltunski
|
* @param contrast Level of contrast (between 0 and infinity) we want to interpolate to.
|
1486 |
|
|
* 1 - level of contrast unchanged, anything less than 1 - reduce contrast,
|
1487 |
|
|
* anything more than 1 - increase the contrast.
|
1488 |
|
|
* @param region Region this Effect is limited to.
|
1489 |
e0a16874
|
Leszek Koltunski
|
* Null here means 'apply the Effect to the whole Object'.
|
1490 |
|
|
* @param center Center of the Effect.
|
1491 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1492 |
6a06a912
|
Leszek Koltunski
|
*/
|
1493 |
568b29d8
|
Leszek Koltunski
|
public long smooth_contrast(float contrast, Static4D region, Static2D center)
|
1494 |
6a06a912
|
Leszek Koltunski
|
{
|
1495 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
1496 |
6a06a912
|
Leszek Koltunski
|
di.setCount(0.5f);
|
1497 |
|
|
di.setDuration(0);
|
1498 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
1499 |
|
|
di.add(new Static1D(contrast));
|
1500 |
6a06a912
|
Leszek Koltunski
|
|
1501 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SMOOTH_CONTRAST, di, region, center);
|
1502 |
6a06a912
|
Leszek Koltunski
|
}
|
1503 |
|
|
|
1504 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1505 |
|
|
/**
|
1506 |
e0a16874
|
Leszek Koltunski
|
* Makes the whole Object change its contrast level.
|
1507 |
6a06a912
|
Leszek Koltunski
|
*
|
1508 |
d7bbef2f
|
Leszek Koltunski
|
* @param contrast Level of contrast (between 0 and infinity) we want to interpolate to.
|
1509 |
|
|
* 1 - level of contrast unchanged, anything less than 1 - reduce contrast,
|
1510 |
e0a16874
|
Leszek Koltunski
|
* anything more than 1 - increase the contrast.
|
1511 |
6a06a912
|
Leszek Koltunski
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
1512 |
568b29d8
|
Leszek Koltunski
|
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)}
|
1513 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1514 |
6a06a912
|
Leszek Koltunski
|
*/
|
1515 |
|
|
public long smooth_contrast(float contrast, int duration, float count)
|
1516 |
|
|
{
|
1517 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
1518 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
1519 |
|
|
di.setDuration(duration);
|
1520 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
1521 |
|
|
di.add(new Static1D(contrast));
|
1522 |
6a06a912
|
Leszek Koltunski
|
|
1523 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SMOOTH_CONTRAST, di,null, mZero2D);
|
1524 |
6a06a912
|
Leszek Koltunski
|
}
|
1525 |
|
|
|
1526 |
|
|
|
1527 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1528 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1529 |
|
|
// SATURATION
|
1530 |
|
|
/**
|
1531 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its saturation level.
|
1532 |
6a06a912
|
Leszek Koltunski
|
*
|
1533 |
568b29d8
|
Leszek Koltunski
|
* @param saturation 1-dimensional Dynamic that returns the level of saturation we want to have
|
1534 |
e0a16874
|
Leszek Koltunski
|
* at any given moment.
|
1535 |
|
|
* @param region Region this Effect is limited to.
|
1536 |
|
|
* Null here means 'apply the Effect to the whole Object'.
|
1537 |
568b29d8
|
Leszek Koltunski
|
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D
|
1538 |
e0a16874
|
Leszek Koltunski
|
* representing the current center of the effect.
|
1539 |
|
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1540 |
6a06a912
|
Leszek Koltunski
|
*/
|
1541 |
568b29d8
|
Leszek Koltunski
|
public long saturation(Dynamic1D saturation, Static4D region, Dynamic2D center)
|
1542 |
6a06a912
|
Leszek Koltunski
|
{
|
1543 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SATURATION, saturation, region, center);
|
1544 |
6a06a912
|
Leszek Koltunski
|
}
|
1545 |
|
|
|
1546 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1547 |
|
|
/**
|
1548 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its saturation level.
|
1549 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
1550 |
|
|
* Here the center of the Effect stays constant.
|
1551 |
|
|
*
|
1552 |
568b29d8
|
Leszek Koltunski
|
* @param saturation 1-dimensional Dynamic that returns the level of saturation we want to have
|
1553 |
e0a16874
|
Leszek Koltunski
|
* at any given moment.
|
1554 |
|
|
* @param region Region this Effect is limited to.
|
1555 |
|
|
* Null here means 'apply the Effect to the whole Object'.
|
1556 |
|
|
* @param center Center of the Effect.
|
1557 |
|
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1558 |
6a06a912
|
Leszek Koltunski
|
*/
|
1559 |
568b29d8
|
Leszek Koltunski
|
public long saturation(Dynamic1D saturation, Static4D region, Static2D center)
|
1560 |
6a06a912
|
Leszek Koltunski
|
{
|
1561 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SATURATION, saturation, region, center);
|
1562 |
6a06a912
|
Leszek Koltunski
|
}
|
1563 |
|
|
|
1564 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1565 |
|
|
/**
|
1566 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its saturation level.
|
1567 |
6a06a912
|
Leszek Koltunski
|
*
|
1568 |
d7bbef2f
|
Leszek Koltunski
|
* @param saturation Level of saturation (between 0 and infinity) we want to interpolate to.
|
1569 |
|
|
* 1 - level of saturation unchanged, anything less than 1 - reduce saturation,
|
1570 |
|
|
* anything more than 1 - increase the saturation.
|
1571 |
|
|
* @param region Region this Effect is limited to.
|
1572 |
e0a16874
|
Leszek Koltunski
|
* Null here means 'apply the Effect to the whole Object'.
|
1573 |
568b29d8
|
Leszek Koltunski
|
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D
|
1574 |
d7bbef2f
|
Leszek Koltunski
|
* representing the current center of the effect.
|
1575 |
|
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
1576 |
568b29d8
|
Leszek Koltunski
|
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)}
|
1577 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1578 |
6a06a912
|
Leszek Koltunski
|
*/
|
1579 |
568b29d8
|
Leszek Koltunski
|
public long saturation(float saturation, Static4D region, Dynamic2D center, int duration, float count)
|
1580 |
6a06a912
|
Leszek Koltunski
|
{
|
1581 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
1582 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
1583 |
|
|
di.setDuration(duration);
|
1584 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
1585 |
|
|
di.add(new Static1D(saturation));
|
1586 |
6a06a912
|
Leszek Koltunski
|
|
1587 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SATURATION, di, region, center);
|
1588 |
6a06a912
|
Leszek Koltunski
|
}
|
1589 |
|
|
|
1590 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1591 |
|
|
/**
|
1592 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its saturation level.
|
1593 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
1594 |
|
|
* Here the center of the Effect stays constant.
|
1595 |
|
|
*
|
1596 |
d7bbef2f
|
Leszek Koltunski
|
* @param saturation Level of saturation (between 0 and infinity) we want to interpolate to.
|
1597 |
|
|
* 1 - level of saturation unchanged, anything less than 1 - reduce saturation,
|
1598 |
|
|
* anything more than 1 - increase the saturation.
|
1599 |
|
|
* @param region Region this Effect is limited to.
|
1600 |
e0a16874
|
Leszek Koltunski
|
* Null here means 'apply the Effect to the whole Object'.
|
1601 |
|
|
* @param center Center of the Effect.
|
1602 |
d7bbef2f
|
Leszek Koltunski
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
1603 |
568b29d8
|
Leszek Koltunski
|
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)}
|
1604 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1605 |
6a06a912
|
Leszek Koltunski
|
*/
|
1606 |
568b29d8
|
Leszek Koltunski
|
public long saturation(float saturation, Static4D region, Static2D center, int duration, float count)
|
1607 |
6a06a912
|
Leszek Koltunski
|
{
|
1608 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
1609 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
1610 |
|
|
di.setDuration(duration);
|
1611 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
1612 |
|
|
di.add(new Static1D(saturation));
|
1613 |
6a06a912
|
Leszek Koltunski
|
|
1614 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SATURATION, di, region, center);
|
1615 |
6a06a912
|
Leszek Koltunski
|
}
|
1616 |
|
|
|
1617 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1618 |
|
|
/**
|
1619 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its saturation level.
|
1620 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
1621 |
|
|
* Here the center of the Effect stays constant and the effect for now change in time.
|
1622 |
|
|
*
|
1623 |
d7bbef2f
|
Leszek Koltunski
|
* @param saturation Level of saturation (between 0 and infinity) we want to interpolate to.
|
1624 |
|
|
* 1 - level of saturation unchanged, anything less than 1 - reduce saturation,
|
1625 |
|
|
* anything more than 1- increase the saturation.
|
1626 |
|
|
* @param region Region this Effect is limited to.
|
1627 |
e0a16874
|
Leszek Koltunski
|
* Null here means 'apply the Effect to the whole Object'.
|
1628 |
|
|
* @param center Center of the Effect.
|
1629 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1630 |
6a06a912
|
Leszek Koltunski
|
*/
|
1631 |
568b29d8
|
Leszek Koltunski
|
public long saturation(float saturation, Static4D region, Static2D center)
|
1632 |
6a06a912
|
Leszek Koltunski
|
{
|
1633 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
1634 |
6a06a912
|
Leszek Koltunski
|
di.setCount(0.5f);
|
1635 |
|
|
di.setDuration(0);
|
1636 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
1637 |
|
|
di.add(new Static1D(saturation));
|
1638 |
6a06a912
|
Leszek Koltunski
|
|
1639 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SATURATION, di, region, center);
|
1640 |
6a06a912
|
Leszek Koltunski
|
}
|
1641 |
|
|
|
1642 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1643 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1644 |
|
|
// SMOOTH_SATURATION
|
1645 |
|
|
/**
|
1646 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its saturation level.
|
1647 |
6a06a912
|
Leszek Koltunski
|
*
|
1648 |
568b29d8
|
Leszek Koltunski
|
* @param saturation 1-dimensional Dynamic that returns the level of saturation we want to have
|
1649 |
e0a16874
|
Leszek Koltunski
|
* at any given moment.
|
1650 |
|
|
* @param region Region this Effect is limited to.
|
1651 |
|
|
* Null here means 'apply the Effect to the whole Object'.
|
1652 |
568b29d8
|
Leszek Koltunski
|
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D
|
1653 |
e0a16874
|
Leszek Koltunski
|
* representing the current center of the effect.
|
1654 |
|
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1655 |
6a06a912
|
Leszek Koltunski
|
*/
|
1656 |
568b29d8
|
Leszek Koltunski
|
public long smooth_saturation(Dynamic1D saturation, Static4D region, Dynamic2D center)
|
1657 |
6a06a912
|
Leszek Koltunski
|
{
|
1658 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SMOOTH_SATURATION, saturation, region, center);
|
1659 |
6a06a912
|
Leszek Koltunski
|
}
|
1660 |
|
|
|
1661 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1662 |
|
|
/**
|
1663 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its saturation level.
|
1664 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
1665 |
|
|
* Here the center of the Effect stays constant.
|
1666 |
|
|
*
|
1667 |
568b29d8
|
Leszek Koltunski
|
* @param saturation 1-dimensional Dynamic that returns the level of saturation we want to have
|
1668 |
e0a16874
|
Leszek Koltunski
|
* at any given moment.
|
1669 |
|
|
* @param region Region this Effect is limited to.
|
1670 |
|
|
* Null here means 'apply the Effect to the whole Object'.
|
1671 |
|
|
* @param center Center of the Effect.
|
1672 |
|
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1673 |
6a06a912
|
Leszek Koltunski
|
*/
|
1674 |
568b29d8
|
Leszek Koltunski
|
public long smooth_saturation(Dynamic1D saturation, Static4D region, Static2D center)
|
1675 |
6a06a912
|
Leszek Koltunski
|
{
|
1676 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SMOOTH_SATURATION, saturation, region, center);
|
1677 |
6a06a912
|
Leszek Koltunski
|
}
|
1678 |
|
|
|
1679 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1680 |
|
|
/**
|
1681 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its saturation level.
|
1682 |
6a06a912
|
Leszek Koltunski
|
*
|
1683 |
d7bbef2f
|
Leszek Koltunski
|
* @param saturation Level of saturation (between 0 and infinity) we want to interpolate to.
|
1684 |
|
|
* 1 - level of saturation unchanged, anything less than 1 - reduce saturation,
|
1685 |
|
|
* anything more than 1 -increase the saturation.
|
1686 |
|
|
* @param region Region this Effect is limited to.
|
1687 |
e0a16874
|
Leszek Koltunski
|
* Null here means 'apply the Effect to the whole Object'.
|
1688 |
568b29d8
|
Leszek Koltunski
|
* @param center 2-dimensional Dynamic which, at any given time, returns a Static2D
|
1689 |
d7bbef2f
|
Leszek Koltunski
|
* representing the current center of the effect.
|
1690 |
|
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
1691 |
568b29d8
|
Leszek Koltunski
|
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)}
|
1692 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1693 |
6a06a912
|
Leszek Koltunski
|
*/
|
1694 |
568b29d8
|
Leszek Koltunski
|
public long smooth_saturation(float saturation, Static4D region, Dynamic2D center, int duration, float count)
|
1695 |
6a06a912
|
Leszek Koltunski
|
{
|
1696 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
1697 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
1698 |
|
|
di.setDuration(duration);
|
1699 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
1700 |
|
|
di.add(new Static1D(saturation));
|
1701 |
6a06a912
|
Leszek Koltunski
|
|
1702 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SMOOTH_SATURATION, di, region, center);
|
1703 |
6a06a912
|
Leszek Koltunski
|
}
|
1704 |
|
|
|
1705 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1706 |
|
|
/**
|
1707 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its saturation level.
|
1708 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
1709 |
|
|
* Here the center of the Effect stays constant.
|
1710 |
|
|
*
|
1711 |
d7bbef2f
|
Leszek Koltunski
|
* @param saturation Level of saturation (between 0 and infinity) we want to interpolate to.
|
1712 |
|
|
* 1 - level of saturation unchanged, anything less than 1 - reduce saturation,
|
1713 |
|
|
* anything more than 1 - increase the saturation.
|
1714 |
|
|
* @param region Region this Effect is limited to.
|
1715 |
e0a16874
|
Leszek Koltunski
|
* Null here means 'apply the Effect to the whole Object'.
|
1716 |
|
|
* @param center Center of the Effect.
|
1717 |
d7bbef2f
|
Leszek Koltunski
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
1718 |
568b29d8
|
Leszek Koltunski
|
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)}
|
1719 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1720 |
6a06a912
|
Leszek Koltunski
|
*/
|
1721 |
568b29d8
|
Leszek Koltunski
|
public long smooth_saturation(float saturation, Static4D region, Static2D center, int duration, float count)
|
1722 |
6a06a912
|
Leszek Koltunski
|
{
|
1723 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
1724 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
1725 |
|
|
di.setDuration(duration);
|
1726 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
1727 |
|
|
di.add(new Static1D(saturation));
|
1728 |
6a06a912
|
Leszek Koltunski
|
|
1729 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SMOOTH_SATURATION, di, region, center);
|
1730 |
6a06a912
|
Leszek Koltunski
|
}
|
1731 |
|
|
|
1732 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1733 |
|
|
/**
|
1734 |
e0a16874
|
Leszek Koltunski
|
* Makes a certain sub-region of the Object smoothly change its saturation level.
|
1735 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
1736 |
|
|
* Here the center of the Effect stays constant and the effect for now change in time.
|
1737 |
|
|
*
|
1738 |
d7bbef2f
|
Leszek Koltunski
|
* @param saturation Level of saturation (between 0 and infinity) we want to interpolate to.
|
1739 |
|
|
* 1 - level of saturation unchanged, anything less than 1 - reduce saturation,
|
1740 |
|
|
* anything more than 1 - increase the saturation.
|
1741 |
|
|
* @param region Region this Effect is limited to.
|
1742 |
e0a16874
|
Leszek Koltunski
|
* Null here means 'apply the Effect to the whole Object'.
|
1743 |
|
|
* @param center Center of the Effect.
|
1744 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1745 |
6a06a912
|
Leszek Koltunski
|
*/
|
1746 |
568b29d8
|
Leszek Koltunski
|
public long smooth_saturation(float saturation, Static4D region, Static2D center)
|
1747 |
6a06a912
|
Leszek Koltunski
|
{
|
1748 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
1749 |
6a06a912
|
Leszek Koltunski
|
di.setCount(0.5f);
|
1750 |
|
|
di.setDuration(0);
|
1751 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
1752 |
|
|
di.add(new Static1D(saturation));
|
1753 |
6a06a912
|
Leszek Koltunski
|
|
1754 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SMOOTH_SATURATION, di, region, center);
|
1755 |
6a06a912
|
Leszek Koltunski
|
}
|
1756 |
|
|
|
1757 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1758 |
|
|
/**
|
1759 |
e0a16874
|
Leszek Koltunski
|
* Makes the whole Object change its saturation level.
|
1760 |
6a06a912
|
Leszek Koltunski
|
*
|
1761 |
d7bbef2f
|
Leszek Koltunski
|
* @param saturation Level of saturation (between 0 and infinity) we want to interpolate to.
|
1762 |
|
|
* 1 - level of saturation unchanged, anything less than 1 - reduce saturation,
|
1763 |
|
|
* anything more than 1 - increase the saturation.
|
1764 |
|
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
1765 |
568b29d8
|
Leszek Koltunski
|
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)}
|
1766 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1767 |
6a06a912
|
Leszek Koltunski
|
*/
|
1768 |
|
|
public long smooth_saturation(float saturation, int duration, float count)
|
1769 |
|
|
{
|
1770 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
1771 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
1772 |
|
|
di.setDuration(duration);
|
1773 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
1774 |
|
|
di.add(new Static1D(saturation));
|
1775 |
6a06a912
|
Leszek Koltunski
|
|
1776 |
e0a16874
|
Leszek Koltunski
|
return mF.add(EffectNames.SMOOTH_SATURATION, di,null, mZero2D);
|
1777 |
6a06a912
|
Leszek Koltunski
|
}
|
1778 |
|
|
|
1779 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1780 |
|
|
// Vertex-based effects
|
1781 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1782 |
|
|
// DISTORT
|
1783 |
|
|
/**
|
1784 |
e0a16874
|
Leszek Koltunski
|
* Distort a (possibly changing in time) part of the Object by a (possibly changing in time) vector of force.
|
1785 |
6a06a912
|
Leszek Koltunski
|
*
|
1786 |
568b29d8
|
Leszek Koltunski
|
* @param vector 2- or 3-dimensional Dynamic that returns a 2- or 3-dimensional Point which
|
1787 |
d7bbef2f
|
Leszek Koltunski
|
* represents the vector the Center of the Effect is currently being dragged with.
|
1788 |
|
|
* @param region Region that masks the effect of the Distortion.
|
1789 |
568b29d8
|
Leszek Koltunski
|
* @param center 2-dimensional Dynamic that, at any given time, returns a Point2D representing
|
1790 |
d7bbef2f
|
Leszek Koltunski
|
* the Center of the Effect.
|
1791 |
|
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1792 |
6a06a912
|
Leszek Koltunski
|
*/
|
1793 |
568b29d8
|
Leszek Koltunski
|
public long distort(Dynamic vector, Static4D region, Dynamic2D center)
|
1794 |
6a06a912
|
Leszek Koltunski
|
{
|
1795 |
e0a16874
|
Leszek Koltunski
|
return mV.add(EffectNames.DISTORT, vector, region, center);
|
1796 |
6a06a912
|
Leszek Koltunski
|
}
|
1797 |
|
|
|
1798 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1799 |
|
|
/**
|
1800 |
e0a16874
|
Leszek Koltunski
|
* Distort part of the Object by a (possibly changing in time) vector of force.
|
1801 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
1802 |
|
|
* Difference between this and the previous method is that here the center of the Effect stays constant.
|
1803 |
|
|
*
|
1804 |
568b29d8
|
Leszek Koltunski
|
* @param vector 2- or 3-dimensional Dynamic that returns a 2- or 3-dimensional Point which
|
1805 |
d7bbef2f
|
Leszek Koltunski
|
* represents the vector the Center of the Effect is currently being dragged with.
|
1806 |
|
|
* @param region Region that masks the effect of the Distortion.
|
1807 |
e0a16874
|
Leszek Koltunski
|
* @param center Center of the Effect.
|
1808 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1809 |
6a06a912
|
Leszek Koltunski
|
*/
|
1810 |
568b29d8
|
Leszek Koltunski
|
public long distort(Dynamic vector, Static4D region, Static2D center)
|
1811 |
6a06a912
|
Leszek Koltunski
|
{
|
1812 |
e0a16874
|
Leszek Koltunski
|
return mV.add(EffectNames.DISTORT, vector, region, center);
|
1813 |
6a06a912
|
Leszek Koltunski
|
}
|
1814 |
|
|
|
1815 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1816 |
|
|
/**
|
1817 |
e0a16874
|
Leszek Koltunski
|
* Distort the whole Object by a (possibly changing in time) vector of force.
|
1818 |
6a06a912
|
Leszek Koltunski
|
*
|
1819 |
568b29d8
|
Leszek Koltunski
|
* @param vector 2- or 3-dimensional Dynamic that returns a 2- or 3-dimensional Point which
|
1820 |
e0a16874
|
Leszek Koltunski
|
* represents the vector the Center of the Effect is currently being dragged with.
|
1821 |
|
|
* @param center Center of the Effect.
|
1822 |
|
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1823 |
6a06a912
|
Leszek Koltunski
|
*/
|
1824 |
568b29d8
|
Leszek Koltunski
|
public long distort(Dynamic vector, Static2D center)
|
1825 |
6a06a912
|
Leszek Koltunski
|
{
|
1826 |
e0a16874
|
Leszek Koltunski
|
return mV.add(EffectNames.DISTORT, vector, null, center);
|
1827 |
6a06a912
|
Leszek Koltunski
|
}
|
1828 |
|
|
|
1829 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1830 |
|
|
/**
|
1831 |
e0a16874
|
Leszek Koltunski
|
* Distort part of the Object by a vector of force that changes from (0,0,0) to v.
|
1832 |
6a06a912
|
Leszek Koltunski
|
*
|
1833 |
d7bbef2f
|
Leszek Koltunski
|
* @param vector Maximum vector of force.
|
1834 |
|
|
* @param region Region that masks the effect of the Distortion.
|
1835 |
e0a16874
|
Leszek Koltunski
|
* @param center Center of the Effect.
|
1836 |
6a06a912
|
Leszek Koltunski
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
1837 |
568b29d8
|
Leszek Koltunski
|
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)}
|
1838 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1839 |
6a06a912
|
Leszek Koltunski
|
*/
|
1840 |
568b29d8
|
Leszek Koltunski
|
public long distort(Static3D vector, Static4D region, Static2D center, int duration, float count)
|
1841 |
6a06a912
|
Leszek Koltunski
|
{
|
1842 |
568b29d8
|
Leszek Koltunski
|
Dynamic3D di = new Dynamic3D();
|
1843 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
1844 |
|
|
di.setDuration(duration);
|
1845 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static3D(0.0f,0.0f,0.0f));
|
1846 |
6a06a912
|
Leszek Koltunski
|
di.add(vector);
|
1847 |
|
|
|
1848 |
e0a16874
|
Leszek Koltunski
|
return mV.add(EffectNames.DISTORT, di, region, center);
|
1849 |
6a06a912
|
Leszek Koltunski
|
}
|
1850 |
|
|
|
1851 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1852 |
|
|
/**
|
1853 |
e0a16874
|
Leszek Koltunski
|
* Distort the whole Object by a vector of force that changes from (0,0,0) to v.
|
1854 |
6a06a912
|
Leszek Koltunski
|
*
|
1855 |
d7bbef2f
|
Leszek Koltunski
|
* @param vector Maximum vector of force.
|
1856 |
e0a16874
|
Leszek Koltunski
|
* @param center Center of the Effect.
|
1857 |
6a06a912
|
Leszek Koltunski
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
1858 |
568b29d8
|
Leszek Koltunski
|
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)}
|
1859 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1860 |
6a06a912
|
Leszek Koltunski
|
*/
|
1861 |
568b29d8
|
Leszek Koltunski
|
public long distort(Static3D vector, Static2D center, int duration, float count)
|
1862 |
6a06a912
|
Leszek Koltunski
|
{
|
1863 |
568b29d8
|
Leszek Koltunski
|
Dynamic3D di = new Dynamic3D();
|
1864 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
1865 |
|
|
di.setDuration(duration);
|
1866 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static3D(0.0f,0.0f,0.0f));
|
1867 |
6a06a912
|
Leszek Koltunski
|
di.add(vector);
|
1868 |
|
|
|
1869 |
e0a16874
|
Leszek Koltunski
|
return mV.add(EffectNames.DISTORT, di, null, center);
|
1870 |
6a06a912
|
Leszek Koltunski
|
}
|
1871 |
|
|
|
1872 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1873 |
|
|
/**
|
1874 |
e0a16874
|
Leszek Koltunski
|
* Distort the whole Object by a vector of force that changes from (0,0,0) to v.
|
1875 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
1876 |
|
|
* Difference between this and the previous method is that here the vector of force will get interpolated
|
1877 |
|
|
* to the maximum v and the effect will end. We are thus limited to count=0.5.
|
1878 |
|
|
*
|
1879 |
d7bbef2f
|
Leszek Koltunski
|
* @param vector Maximum, final vector of force.
|
1880 |
e0a16874
|
Leszek Koltunski
|
* @param center Center of the Effect.
|
1881 |
6a06a912
|
Leszek Koltunski
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
1882 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1883 |
6a06a912
|
Leszek Koltunski
|
*/
|
1884 |
568b29d8
|
Leszek Koltunski
|
public long distort(Static3D vector, Static2D center, int duration)
|
1885 |
6a06a912
|
Leszek Koltunski
|
{
|
1886 |
568b29d8
|
Leszek Koltunski
|
Dynamic3D di = new Dynamic3D();
|
1887 |
6a06a912
|
Leszek Koltunski
|
di.setCount(0.5f);
|
1888 |
|
|
di.setDuration(duration);
|
1889 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static3D(0.0f,0.0f,0.0f));
|
1890 |
6a06a912
|
Leszek Koltunski
|
di.add(vector);
|
1891 |
|
|
|
1892 |
e0a16874
|
Leszek Koltunski
|
return mV.add(EffectNames.DISTORT, di, null, center);
|
1893 |
6a06a912
|
Leszek Koltunski
|
}
|
1894 |
|
|
|
1895 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1896 |
|
|
/**
|
1897 |
e0a16874
|
Leszek Koltunski
|
* Distort the whole Object by a vector of force v.
|
1898 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
1899 |
|
|
* Here we apply a constant vector of force.
|
1900 |
|
|
*
|
1901 |
d7bbef2f
|
Leszek Koltunski
|
* @param vector Vector of force.
|
1902 |
e0a16874
|
Leszek Koltunski
|
* @param center Center of the Effect.
|
1903 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1904 |
6a06a912
|
Leszek Koltunski
|
*/
|
1905 |
568b29d8
|
Leszek Koltunski
|
public long distort(Static3D vector, Static2D center )
|
1906 |
6a06a912
|
Leszek Koltunski
|
{
|
1907 |
568b29d8
|
Leszek Koltunski
|
Dynamic3D di = new Dynamic3D();
|
1908 |
6a06a912
|
Leszek Koltunski
|
di.setCount(0.5f);
|
1909 |
|
|
di.setDuration(0);
|
1910 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static3D(0.0f,0.0f,0.0f));
|
1911 |
6a06a912
|
Leszek Koltunski
|
di.add(vector);
|
1912 |
|
|
|
1913 |
e0a16874
|
Leszek Koltunski
|
return mV.add(EffectNames.DISTORT, di, null, center);
|
1914 |
6a06a912
|
Leszek Koltunski
|
}
|
1915 |
|
|
|
1916 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1917 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1918 |
|
|
// DEFORM
|
1919 |
|
|
/**
|
1920 |
e0a16874
|
Leszek Koltunski
|
* Deform the shape of the whole Object with a (possibly changing in time) vector of force applied to
|
1921 |
9351ad55
|
Leszek Koltunski
|
* a (possibly changing in time) point on the Object.
|
1922 |
6a06a912
|
Leszek Koltunski
|
*
|
1923 |
568b29d8
|
Leszek Koltunski
|
* @param vector Dynamic that, at any given time, returns a Static2D representing vector of
|
1924 |
9351ad55
|
Leszek Koltunski
|
* force that deforms the shape of the whole Object.
|
1925 |
568b29d8
|
Leszek Koltunski
|
* @param center 2-dimensional Dynamic that, at any given time, returns a Point2D representing
|
1926 |
e0a16874
|
Leszek Koltunski
|
* the Center of the Effect.
|
1927 |
|
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1928 |
6a06a912
|
Leszek Koltunski
|
*/
|
1929 |
568b29d8
|
Leszek Koltunski
|
public long deform(Dynamic vector, Dynamic2D center)
|
1930 |
6a06a912
|
Leszek Koltunski
|
{
|
1931 |
e0a16874
|
Leszek Koltunski
|
return mV.add(EffectNames.DEFORM, vector, null, center);
|
1932 |
6a06a912
|
Leszek Koltunski
|
}
|
1933 |
|
|
|
1934 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1935 |
|
|
/**
|
1936 |
e0a16874
|
Leszek Koltunski
|
* Deform the shape of the whole Object with a (possibly changing in time) vector of force applied to
|
1937 |
9351ad55
|
Leszek Koltunski
|
* a constant point on the Object.
|
1938 |
6a06a912
|
Leszek Koltunski
|
*
|
1939 |
568b29d8
|
Leszek Koltunski
|
* @param vector Dynamic that, at any given time, returns a Static2D representing
|
1940 |
9351ad55
|
Leszek Koltunski
|
* vector of force that deforms the shape of the whole Object.
|
1941 |
e0a16874
|
Leszek Koltunski
|
* @param center Center of the Effect.
|
1942 |
|
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1943 |
6a06a912
|
Leszek Koltunski
|
*/
|
1944 |
568b29d8
|
Leszek Koltunski
|
public long deform(Dynamic vector, Static2D center)
|
1945 |
6a06a912
|
Leszek Koltunski
|
{
|
1946 |
e0a16874
|
Leszek Koltunski
|
return mV.add(EffectNames.DEFORM, vector, null, center);
|
1947 |
6a06a912
|
Leszek Koltunski
|
}
|
1948 |
|
|
|
1949 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1950 |
|
|
/**
|
1951 |
e0a16874
|
Leszek Koltunski
|
* Deform the shape of the whole Object with a vector of force smoothly changing from (0,0,0) to v
|
1952 |
|
|
* applied to a constant point on the Object.
|
1953 |
6a06a912
|
Leszek Koltunski
|
*
|
1954 |
d7bbef2f
|
Leszek Koltunski
|
* @param vector Vector of force.
|
1955 |
e0a16874
|
Leszek Koltunski
|
* @param center Center of the Effect.
|
1956 |
6a06a912
|
Leszek Koltunski
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
1957 |
568b29d8
|
Leszek Koltunski
|
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)}
|
1958 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1959 |
6a06a912
|
Leszek Koltunski
|
*/
|
1960 |
568b29d8
|
Leszek Koltunski
|
public long deform(Static3D vector, Static2D center, int duration, float count)
|
1961 |
6a06a912
|
Leszek Koltunski
|
{
|
1962 |
568b29d8
|
Leszek Koltunski
|
Dynamic3D di = new Dynamic3D();
|
1963 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
1964 |
|
|
di.setDuration(duration);
|
1965 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static3D(0.0f,0.0f,0.0f));
|
1966 |
6a06a912
|
Leszek Koltunski
|
di.add(vector);
|
1967 |
|
|
|
1968 |
e0a16874
|
Leszek Koltunski
|
return mV.add(EffectNames.DEFORM, di, null, center);
|
1969 |
6a06a912
|
Leszek Koltunski
|
}
|
1970 |
|
|
|
1971 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1972 |
|
|
/**
|
1973 |
e0a16874
|
Leszek Koltunski
|
* Deform the shape of the whole Object with a vector of force smoothly changing from (0,0,0) to v
|
1974 |
|
|
* applied to a constant point on the Object.
|
1975 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
1976 |
|
|
* Identical to calling the previous method with count=0.5.
|
1977 |
|
|
*
|
1978 |
d7bbef2f
|
Leszek Koltunski
|
* @param vector Final vector of force.
|
1979 |
e0a16874
|
Leszek Koltunski
|
* @param center Center of the Effect.
|
1980 |
6a06a912
|
Leszek Koltunski
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
1981 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
1982 |
6a06a912
|
Leszek Koltunski
|
*/
|
1983 |
568b29d8
|
Leszek Koltunski
|
public long deform(Static3D vector, Static2D center, int duration)
|
1984 |
6a06a912
|
Leszek Koltunski
|
{
|
1985 |
568b29d8
|
Leszek Koltunski
|
Dynamic3D di = new Dynamic3D();
|
1986 |
6a06a912
|
Leszek Koltunski
|
di.setCount(0.5f);
|
1987 |
|
|
di.setDuration(duration);
|
1988 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static3D(0.0f,0.0f,0.0f));
|
1989 |
6a06a912
|
Leszek Koltunski
|
di.add(vector);
|
1990 |
|
|
|
1991 |
e0a16874
|
Leszek Koltunski
|
return mV.add(EffectNames.DEFORM, di, null, center);
|
1992 |
6a06a912
|
Leszek Koltunski
|
}
|
1993 |
|
|
|
1994 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1995 |
|
|
/**
|
1996 |
e0a16874
|
Leszek Koltunski
|
* Deform the shape of the whole Object with a constant vector of force applied to a constant
|
1997 |
|
|
* point on the Object.
|
1998 |
6a06a912
|
Leszek Koltunski
|
*
|
1999 |
d7bbef2f
|
Leszek Koltunski
|
* @param vector Vector of force.
|
2000 |
e0a16874
|
Leszek Koltunski
|
* @param center Center of the Effect.
|
2001 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
2002 |
6a06a912
|
Leszek Koltunski
|
*/
|
2003 |
568b29d8
|
Leszek Koltunski
|
public long deform(Static3D vector, Static2D center )
|
2004 |
6a06a912
|
Leszek Koltunski
|
{
|
2005 |
568b29d8
|
Leszek Koltunski
|
Dynamic3D di = new Dynamic3D();
|
2006 |
6a06a912
|
Leszek Koltunski
|
di.setCount(0.5f);
|
2007 |
|
|
di.setDuration(0);
|
2008 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static3D(0.0f,0.0f,0.0f));
|
2009 |
6a06a912
|
Leszek Koltunski
|
di.add(vector);
|
2010 |
|
|
|
2011 |
e0a16874
|
Leszek Koltunski
|
return mV.add(EffectNames.DEFORM, di, null, center);
|
2012 |
6a06a912
|
Leszek Koltunski
|
}
|
2013 |
|
|
|
2014 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2015 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2016 |
|
|
// SINK
|
2017 |
|
|
/**
|
2018 |
|
|
* Pull all points around the center of the effect towards the center (if degree>=1) or push them
|
2019 |
|
|
* away from the center (degree<=1)
|
2020 |
|
|
*
|
2021 |
568b29d8
|
Leszek Koltunski
|
* @param sink 1-dimensional Dynamic which, at any given time, returns a Point1D representing
|
2022 |
d7bbef2f
|
Leszek Koltunski
|
* the current degree of the effect.
|
2023 |
|
|
* @param region Region that masks the effect of the Sink.
|
2024 |
568b29d8
|
Leszek Koltunski
|
* @param center 2-dimensional Dynamic that, at any given time, returns a Point2D representing
|
2025 |
d7bbef2f
|
Leszek Koltunski
|
* the Center of the Effect.
|
2026 |
|
|
* @return ID of the effect added, or -1 if we failed to add one.
|
2027 |
6a06a912
|
Leszek Koltunski
|
*/
|
2028 |
568b29d8
|
Leszek Koltunski
|
public long sink(Dynamic1D sink, Static4D region, Dynamic2D center)
|
2029 |
6a06a912
|
Leszek Koltunski
|
{
|
2030 |
e0a16874
|
Leszek Koltunski
|
return mV.add(EffectNames.SINK, sink, region, center);
|
2031 |
6a06a912
|
Leszek Koltunski
|
}
|
2032 |
|
|
|
2033 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2034 |
|
|
/**
|
2035 |
|
|
* Pull all points around the center of the effect towards the center (if degree>=1) or push them
|
2036 |
|
|
* away from the center (degree<=1).
|
2037 |
|
|
* <p>
|
2038 |
|
|
* Here the Center stays constant.
|
2039 |
|
|
*
|
2040 |
568b29d8
|
Leszek Koltunski
|
* @param sink 1-dimensional Dynamic which, at any given time, returns a Point1D
|
2041 |
d7bbef2f
|
Leszek Koltunski
|
* representing the current degree of the effect.
|
2042 |
|
|
* @param region Region that masks the effect of the Sink.
|
2043 |
e0a16874
|
Leszek Koltunski
|
* @param center Center of the Effect.
|
2044 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
2045 |
6a06a912
|
Leszek Koltunski
|
*/
|
2046 |
568b29d8
|
Leszek Koltunski
|
public long sink(Dynamic1D sink, Static4D region, Static2D center)
|
2047 |
6a06a912
|
Leszek Koltunski
|
{
|
2048 |
e0a16874
|
Leszek Koltunski
|
return mV.add(EffectNames.SINK, sink, region, center);
|
2049 |
6a06a912
|
Leszek Koltunski
|
}
|
2050 |
|
|
|
2051 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2052 |
|
|
/**
|
2053 |
|
|
* Pull all points around the center of the effect towards the center (if degree>=1) or push them
|
2054 |
|
|
* away from the center (degree<=1).
|
2055 |
|
|
* <p>
|
2056 |
|
|
* Here we can only interpolate between 1 and degree.
|
2057 |
|
|
*
|
2058 |
e0a16874
|
Leszek Koltunski
|
* @param sink How much to push or pull. Between 0 and infinity.
|
2059 |
d7bbef2f
|
Leszek Koltunski
|
* @param region Region that masks the effect of the Sink.
|
2060 |
568b29d8
|
Leszek Koltunski
|
* @param center 2-dimensional Dynamic that, at any given time, returns a Point2D representing
|
2061 |
d7bbef2f
|
Leszek Koltunski
|
* the Center of the Effect.
|
2062 |
6a06a912
|
Leszek Koltunski
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
2063 |
568b29d8
|
Leszek Koltunski
|
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)}
|
2064 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
2065 |
6a06a912
|
Leszek Koltunski
|
*/
|
2066 |
568b29d8
|
Leszek Koltunski
|
public long sink(float sink, Static4D region, Dynamic2D center, int duration, float count)
|
2067 |
6a06a912
|
Leszek Koltunski
|
{
|
2068 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
2069 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
2070 |
|
|
di.setDuration(duration);
|
2071 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
2072 |
|
|
di.add(new Static1D(sink));
|
2073 |
6a06a912
|
Leszek Koltunski
|
|
2074 |
e0a16874
|
Leszek Koltunski
|
return mV.add(EffectNames.SINK, di, region, center);
|
2075 |
6a06a912
|
Leszek Koltunski
|
}
|
2076 |
|
|
|
2077 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2078 |
|
|
/**
|
2079 |
|
|
* Pull all points around the center of the effect towards the center (if degree>=1) or push them
|
2080 |
|
|
* away from the center (degree<=1).
|
2081 |
|
|
*
|
2082 |
e0a16874
|
Leszek Koltunski
|
* @param sink How much to push or pull. Between 0 and infinity.
|
2083 |
d7bbef2f
|
Leszek Koltunski
|
* @param region Region that masks the effect of the Sink.
|
2084 |
e0a16874
|
Leszek Koltunski
|
* @param center Center of the Effect.
|
2085 |
6a06a912
|
Leszek Koltunski
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
2086 |
568b29d8
|
Leszek Koltunski
|
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)}
|
2087 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
2088 |
6a06a912
|
Leszek Koltunski
|
*/
|
2089 |
568b29d8
|
Leszek Koltunski
|
public long sink(float sink, Static4D region, Static2D center, int duration, float count)
|
2090 |
6a06a912
|
Leszek Koltunski
|
{
|
2091 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
2092 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
2093 |
|
|
di.setDuration(duration);
|
2094 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
2095 |
|
|
di.add(new Static1D(sink));
|
2096 |
6a06a912
|
Leszek Koltunski
|
|
2097 |
e0a16874
|
Leszek Koltunski
|
return mV.add(EffectNames.SINK, di, region, center);
|
2098 |
6a06a912
|
Leszek Koltunski
|
}
|
2099 |
|
|
|
2100 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2101 |
|
|
/**
|
2102 |
e0a16874
|
Leszek Koltunski
|
* Pull all points of the Object towards the center of the Effect (if degree>=1) or push them
|
2103 |
6a06a912
|
Leszek Koltunski
|
* away from the center (degree<=1).
|
2104 |
|
|
*
|
2105 |
e0a16874
|
Leszek Koltunski
|
* @param sink How much to push or pull. Between 0 and infinity.
|
2106 |
|
|
* @param center Center of the Effect.
|
2107 |
6a06a912
|
Leszek Koltunski
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
2108 |
568b29d8
|
Leszek Koltunski
|
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)}
|
2109 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
2110 |
6a06a912
|
Leszek Koltunski
|
*/
|
2111 |
568b29d8
|
Leszek Koltunski
|
public long sink(float sink, Static2D center, int duration, float count)
|
2112 |
6a06a912
|
Leszek Koltunski
|
{
|
2113 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
2114 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
2115 |
|
|
di.setDuration(duration);
|
2116 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
2117 |
|
|
di.add(new Static1D(sink));
|
2118 |
6a06a912
|
Leszek Koltunski
|
|
2119 |
e0a16874
|
Leszek Koltunski
|
return mV.add(EffectNames.SINK, di, null, center);
|
2120 |
6a06a912
|
Leszek Koltunski
|
}
|
2121 |
|
|
|
2122 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2123 |
|
|
/**
|
2124 |
e0a16874
|
Leszek Koltunski
|
* Pull all points of the Object towards the center of the Effect (if degree>=1) or push them
|
2125 |
6a06a912
|
Leszek Koltunski
|
* away from the center (degree<=1).
|
2126 |
|
|
* <p>
|
2127 |
|
|
* Equivalent to calling the previous method with count=0.5.
|
2128 |
|
|
*
|
2129 |
e0a16874
|
Leszek Koltunski
|
* @param sink How much to push or pull. Between 0 and infinity.
|
2130 |
|
|
* @param center Center of the Effect.
|
2131 |
6a06a912
|
Leszek Koltunski
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
2132 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
2133 |
6a06a912
|
Leszek Koltunski
|
*/
|
2134 |
568b29d8
|
Leszek Koltunski
|
public long sink(float sink, Static2D center, int duration)
|
2135 |
6a06a912
|
Leszek Koltunski
|
{
|
2136 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
2137 |
6a06a912
|
Leszek Koltunski
|
di.setCount(0.5f);
|
2138 |
|
|
di.setDuration(duration);
|
2139 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
2140 |
|
|
di.add(new Static1D(sink));
|
2141 |
6a06a912
|
Leszek Koltunski
|
|
2142 |
e0a16874
|
Leszek Koltunski
|
return mV.add(EffectNames.SINK, di, null, center);
|
2143 |
6a06a912
|
Leszek Koltunski
|
}
|
2144 |
|
|
|
2145 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2146 |
|
|
/**
|
2147 |
e0a16874
|
Leszek Koltunski
|
* Pull all points of the Object towards the center of the Effect (if degree>=1) or push them
|
2148 |
6a06a912
|
Leszek Koltunski
|
* away from the center (degree<=1).
|
2149 |
|
|
* <p>
|
2150 |
|
|
* Equivalent of calling the previous method with duration=0; i.e. we pull immediately.
|
2151 |
|
|
*
|
2152 |
e0a16874
|
Leszek Koltunski
|
* @param sink How much to push or pull. Between 0 and infinity.
|
2153 |
|
|
* @param center Center of the Effect.
|
2154 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
2155 |
6a06a912
|
Leszek Koltunski
|
*/
|
2156 |
568b29d8
|
Leszek Koltunski
|
public long sink(float sink, Static2D center)
|
2157 |
6a06a912
|
Leszek Koltunski
|
{
|
2158 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
2159 |
6a06a912
|
Leszek Koltunski
|
di.setCount(0.5f);
|
2160 |
|
|
di.setDuration(0);
|
2161 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(1));
|
2162 |
|
|
di.add(new Static1D(sink));
|
2163 |
6a06a912
|
Leszek Koltunski
|
|
2164 |
e0a16874
|
Leszek Koltunski
|
return mV.add(EffectNames.SINK, di, null, center);
|
2165 |
6a06a912
|
Leszek Koltunski
|
}
|
2166 |
|
|
|
2167 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2168 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2169 |
|
|
// SWIRL
|
2170 |
|
|
/**
|
2171 |
e0a16874
|
Leszek Koltunski
|
* Rotate part of the Object around the Center of the Effect by a certain angle (as returned by the
|
2172 |
568b29d8
|
Leszek Koltunski
|
* Dynamic).
|
2173 |
6a06a912
|
Leszek Koltunski
|
*
|
2174 |
568b29d8
|
Leszek Koltunski
|
* @param swirl 1-dimensional Dynamic which, at any given time, returns a Point1D representing
|
2175 |
d7bbef2f
|
Leszek Koltunski
|
* the degree of Swirl.
|
2176 |
|
|
* @param region Region that masks the effect of the Swirl.
|
2177 |
568b29d8
|
Leszek Koltunski
|
* @param center 2-dimensional Dynamic that, at any given time, returns a Point2D representing
|
2178 |
d7bbef2f
|
Leszek Koltunski
|
* the Center of the Effect.
|
2179 |
|
|
* @return ID of the effect added, or -1 if we failed to add one.
|
2180 |
6a06a912
|
Leszek Koltunski
|
*/
|
2181 |
568b29d8
|
Leszek Koltunski
|
public long swirl(Dynamic1D swirl, Static4D region, Dynamic2D center)
|
2182 |
6a06a912
|
Leszek Koltunski
|
{
|
2183 |
e0a16874
|
Leszek Koltunski
|
return mV.add(EffectNames.SWIRL, swirl, region, center);
|
2184 |
6a06a912
|
Leszek Koltunski
|
}
|
2185 |
|
|
|
2186 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2187 |
|
|
/**
|
2188 |
e0a16874
|
Leszek Koltunski
|
* Rotate part of the Object around the Center of the Effect by a certain angle (as returned by the
|
2189 |
568b29d8
|
Leszek Koltunski
|
* Dynamic).
|
2190 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
2191 |
|
|
* Here the Center stays constant.
|
2192 |
|
|
*
|
2193 |
568b29d8
|
Leszek Koltunski
|
* @param swirl 1-dimensional Dynamic which, at any given time, returns a Point1D representing
|
2194 |
d7bbef2f
|
Leszek Koltunski
|
* the degree of Swirl.
|
2195 |
|
|
* @param region Region that masks the effect of the Swirl.
|
2196 |
e0a16874
|
Leszek Koltunski
|
* @param center Center of the Effect.
|
2197 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
2198 |
6a06a912
|
Leszek Koltunski
|
*/
|
2199 |
568b29d8
|
Leszek Koltunski
|
public long swirl(Dynamic1D swirl, Static4D region, Static2D center)
|
2200 |
6a06a912
|
Leszek Koltunski
|
{
|
2201 |
e0a16874
|
Leszek Koltunski
|
return mV.add(EffectNames.SWIRL, swirl, region, center);
|
2202 |
6a06a912
|
Leszek Koltunski
|
}
|
2203 |
|
|
|
2204 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2205 |
|
|
/**
|
2206 |
e0a16874
|
Leszek Koltunski
|
* Rotate part of the Object around the Center of the Effect by 'degree' angle.
|
2207 |
6a06a912
|
Leszek Koltunski
|
*
|
2208 |
e0a16874
|
Leszek Koltunski
|
* @param swirl Angle of rotation. Unit: degrees.
|
2209 |
d7bbef2f
|
Leszek Koltunski
|
* @param region Region that masks the effect of the Swirl.
|
2210 |
568b29d8
|
Leszek Koltunski
|
* @param center 2-dimensional Dynamic that, at any given time, returns a Point2D representing
|
2211 |
d7bbef2f
|
Leszek Koltunski
|
* the Center of the Effect.
|
2212 |
b1e91f2c
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
2213 |
6a06a912
|
Leszek Koltunski
|
*/
|
2214 |
568b29d8
|
Leszek Koltunski
|
public long swirl(int swirl, Static4D region, Dynamic2D center)
|
2215 |
6a06a912
|
Leszek Koltunski
|
{
|
2216 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
2217 |
b1e91f2c
|
Leszek Koltunski
|
di.setCount(0.5f);
|
2218 |
|
|
di.setDuration(0);
|
2219 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(0));
|
2220 |
|
|
di.add(new Static1D(swirl));
|
2221 |
6a06a912
|
Leszek Koltunski
|
|
2222 |
e0a16874
|
Leszek Koltunski
|
return mV.add(EffectNames.SWIRL, di, region, center);
|
2223 |
6a06a912
|
Leszek Koltunski
|
}
|
2224 |
|
|
|
2225 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2226 |
|
|
/**
|
2227 |
e0a16874
|
Leszek Koltunski
|
* Rotate part of the Object around the Center of the Effect by 'degree' angle.
|
2228 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
2229 |
|
|
* Here the Center stays constant.
|
2230 |
|
|
*
|
2231 |
e0a16874
|
Leszek Koltunski
|
* @param swirl Angle of rotation. Unit: degrees.
|
2232 |
d7bbef2f
|
Leszek Koltunski
|
* @param region Region that masks the effect of the Swirl.
|
2233 |
e0a16874
|
Leszek Koltunski
|
* @param center Center of the Effect.
|
2234 |
6a06a912
|
Leszek Koltunski
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
2235 |
568b29d8
|
Leszek Koltunski
|
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)}
|
2236 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
2237 |
6a06a912
|
Leszek Koltunski
|
*/
|
2238 |
568b29d8
|
Leszek Koltunski
|
public long swirl(int swirl, Static4D region, Static2D center, int duration, float count)
|
2239 |
6a06a912
|
Leszek Koltunski
|
{
|
2240 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
2241 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
2242 |
|
|
di.setDuration(duration);
|
2243 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(0));
|
2244 |
|
|
di.add(new Static1D(swirl));
|
2245 |
6a06a912
|
Leszek Koltunski
|
|
2246 |
e0a16874
|
Leszek Koltunski
|
return mV.add(EffectNames.SWIRL, di, region, center);
|
2247 |
6a06a912
|
Leszek Koltunski
|
}
|
2248 |
|
|
|
2249 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2250 |
|
|
/**
|
2251 |
e0a16874
|
Leszek Koltunski
|
* Rotate the whole Object around the Center of the Effect by 'degree' angle.
|
2252 |
6a06a912
|
Leszek Koltunski
|
*
|
2253 |
e0a16874
|
Leszek Koltunski
|
* @param swirl Angle of rotation. Unit: degrees.
|
2254 |
|
|
* @param center Center of the Effect.
|
2255 |
6a06a912
|
Leszek Koltunski
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
2256 |
568b29d8
|
Leszek Koltunski
|
* @param count Controls how many interpolations we want to do. See {@link Dynamic#setCount(float)}
|
2257 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
2258 |
6a06a912
|
Leszek Koltunski
|
*/
|
2259 |
568b29d8
|
Leszek Koltunski
|
public long swirl(int swirl, Static2D center, int duration, float count)
|
2260 |
6a06a912
|
Leszek Koltunski
|
{
|
2261 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
2262 |
6a06a912
|
Leszek Koltunski
|
di.setCount(count);
|
2263 |
|
|
di.setDuration(duration);
|
2264 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(0));
|
2265 |
|
|
di.add(new Static1D(swirl));
|
2266 |
6a06a912
|
Leszek Koltunski
|
|
2267 |
e0a16874
|
Leszek Koltunski
|
return mV.add(EffectNames.SWIRL, di, null, center);
|
2268 |
6a06a912
|
Leszek Koltunski
|
}
|
2269 |
|
|
|
2270 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2271 |
|
|
/**
|
2272 |
e0a16874
|
Leszek Koltunski
|
* Rotate the whole Object around the Center of the Effect by 'degree' angle.
|
2273 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
2274 |
|
|
* Equivalent to calling the previous method with count=0.5.
|
2275 |
|
|
*
|
2276 |
e0a16874
|
Leszek Koltunski
|
* @param swirl Angle of rotation. Unit: degrees.
|
2277 |
|
|
* @param center Center of the Effect.
|
2278 |
6a06a912
|
Leszek Koltunski
|
* @param duration Time, in milliseconds, it takes to do one full interpolation.
|
2279 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
2280 |
6a06a912
|
Leszek Koltunski
|
*/
|
2281 |
568b29d8
|
Leszek Koltunski
|
public long swirl(int swirl, Static2D center, int duration)
|
2282 |
6a06a912
|
Leszek Koltunski
|
{
|
2283 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
2284 |
6a06a912
|
Leszek Koltunski
|
di.setCount(0.5f);
|
2285 |
|
|
di.setDuration(duration);
|
2286 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(0));
|
2287 |
|
|
di.add(new Static1D(swirl));
|
2288 |
6a06a912
|
Leszek Koltunski
|
|
2289 |
e0a16874
|
Leszek Koltunski
|
return mV.add(EffectNames.SWIRL, di, null, center);
|
2290 |
6a06a912
|
Leszek Koltunski
|
}
|
2291 |
|
|
|
2292 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2293 |
|
|
/**
|
2294 |
e0a16874
|
Leszek Koltunski
|
* Rotate the whole Object around the Center of the Effect by 'degree' angle.
|
2295 |
6a06a912
|
Leszek Koltunski
|
* <p>
|
2296 |
|
|
* Equivalent to calling the previous method with duration=0.
|
2297 |
|
|
*
|
2298 |
e0a16874
|
Leszek Koltunski
|
* @param swirl Angle of rotation. Unit: degrees.
|
2299 |
|
|
* @param center Center of the Effect.
|
2300 |
d7bbef2f
|
Leszek Koltunski
|
* @return ID of the effect added, or -1 if we failed to add one.
|
2301 |
6a06a912
|
Leszek Koltunski
|
*/
|
2302 |
568b29d8
|
Leszek Koltunski
|
public long swirl(int swirl, Static2D center)
|
2303 |
6a06a912
|
Leszek Koltunski
|
{
|
2304 |
568b29d8
|
Leszek Koltunski
|
Dynamic1D di = new Dynamic1D();
|
2305 |
6a06a912
|
Leszek Koltunski
|
di.setCount(0.5f);
|
2306 |
|
|
di.setDuration(0);
|
2307 |
568b29d8
|
Leszek Koltunski
|
di.add(new Static1D(0));
|
2308 |
|
|
di.add(new Static1D(swirl));
|
2309 |
6a06a912
|
Leszek Koltunski
|
|
2310 |
e0a16874
|
Leszek Koltunski
|
return mV.add(EffectNames.SWIRL, di, null, center);
|
2311 |
6a06a912
|
Leszek Koltunski
|
}
|
2312 |
|
|
|
2313 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2314 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2315 |
|
|
// WAVE
|
2316 |
|
|
|
2317 |
|
|
}
|