summaryrefslogtreecommitdiff
path: root/ricky/imbreak/params.py
blob: 4cf3af9667d9c24b61fd7c626b3799a62ae1dcd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
from ricky.params import Params
from ricky.param.username import Username
from ricky.param.imageurl import ImageUrl
from ricky.param.multiselect import MultiSelect
from ricky.param.constrainednumber import ConstrainedNumber
from ricky.param.bool import Bool


breaktype_options = [
    "CLASSIC",
    "REDUX",
    "BLURRY_BREAK",
    "BLURRY_BREAK_2",
    "SWIPE",
    "RGB_WASH",
    "RGB_WASH_2",
    "NOISY_BREAK",
    "BROKEN_VIGNETTE",
    "FAX_MACHINE",
    "STRIPES",
    "PHOTOCOPY"
]
breakmode_options = [
    "extreme",
    "subtle",
]
finalformat_options = [
    "png",
    "jpg",
    "gif",
]


class ImBreakParams(Params):
    def __init__(self):
        self._params = [
           Username(name="username", required=0),
           ImageUrl(name="url", required=1),
           MultiSelect(
                       name="finalformat",
                       required=0,
                       options=finalformat_options),
           MultiSelect(
                       name="breaktype",
                       required=1,
                       options=breaktype_options),
           ConstrainedNumber(
                       name="breakangle",
                       required=0,
                       min=-180,
                       max=180),
           MultiSelect(
                       name="breakmode",
                       required=1,
                       options=breakmode_options),
           Bool(name="expanded", required=0)
        ]