1
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2
|
// Copyright 2016 Leszek Koltunski leszek@koltunski.pl //
|
3
|
// //
|
4
|
// This file is part of Distorted. //
|
5
|
// //
|
6
|
// This library is free software; you can redistribute it and/or //
|
7
|
// modify it under the terms of the GNU Lesser General Public //
|
8
|
// License as published by the Free Software Foundation; either //
|
9
|
// version 2.1 of the License, or (at your option) any later version. //
|
10
|
// //
|
11
|
// This library 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 GNU //
|
14
|
// Lesser General Public License for more details. //
|
15
|
// //
|
16
|
// You should have received a copy of the GNU Lesser General Public //
|
17
|
// License along with this library; if not, write to the Free Software //
|
18
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA //
|
19
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
20
|
|
21
|
package org.distorted.library.effect;
|
22
|
|
23
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
24
|
|
25
|
import org.distorted.library.main.DistortedEffects;
|
26
|
|
27
|
/**
|
28
|
* A list of quality levels.
|
29
|
* <p>
|
30
|
* One can set quality of a Postprocessing Effect to one of those. The lower the quality, the faster
|
31
|
* the rendering will be.
|
32
|
*
|
33
|
* @see DistortedEffects
|
34
|
*/
|
35
|
public enum EffectQuality
|
36
|
{
|
37
|
HIGHEST ( 0 ), // has to start from 0
|
38
|
HIGH ( 1 ),
|
39
|
MEDIUM ( 2 ),
|
40
|
LOW ( 3 );
|
41
|
|
42
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
43
|
/**
|
44
|
* Each next Quality level renders into 1/MULTIPLIER smaller buffers.
|
45
|
*/
|
46
|
public static final float MULTIPLIER = 0.5f;
|
47
|
/**
|
48
|
* Numof of possible qualities.
|
49
|
*/
|
50
|
public static final int LENGTH = values().length;
|
51
|
|
52
|
private final int level;
|
53
|
|
54
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
55
|
|
56
|
EffectQuality(int level)
|
57
|
{
|
58
|
this.level = level;
|
59
|
}
|
60
|
|
61
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
62
|
/**
|
63
|
* Only for use by the library itself.
|
64
|
*
|
65
|
* @y.exclude
|
66
|
*/
|
67
|
public int getLevel()
|
68
|
{
|
69
|
return level;
|
70
|
}
|
71
|
}
|
72
|
|