summaryrefslogtreecommitdiff
path: root/app/client/live/index.js
blob: 558cd40594a32d17cbfc06ad9d1e1d00cadc0c27 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
import { h, Component } from 'preact'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'

import Player from './components/player.component'
import ParamGroup from '../common/paramGroup.component'
import Slider from '../common/slider.component'

import * as liveActions from './actions'

class App extends Component {
  constructor(props){
    super()
    props.actions.get_params()
  }
  render(){
    const props = this.props
    return (
      <div className='app'>
        <Player />
        <div className='params'>
          <div className='column'>
            <ParamGroup
              title='Transition'
              name='transition'
            >
              <Slider
                name='transition_period'
                min={10} max={5000} type='int'
              />
              <Slider
                name='transition_min'
                min={0.001} max={0.2} type='float'
              />
              <Slider
                name='transition_max'
                min={0.1} max={1.0} type='float'
              />
            </ParamGroup>

            <ParamGroup
              title='Recursion'
              name='recursive'
            >
              <Slider
                name='recursive_frac'
                min={0.0} max={0.5} type='float'
              />
              <Slider
                name='recurse_roll'
                min={-64} max={64} type='int'
              />
              <Slider
                name='recurse_roll_axis'
                min={0} max={1} type='int'
              />
            </ParamGroup>

            <ParamGroup
              title='Sequence'
              name='sequence'
            >
              <Slider
                name='sequence_frac'
                min={0.0} max={0.5} type='float'
              />
              <Slider
                name='process_frac'
                min={0} max={1} type='float'
              />
            </ParamGroup>
          </div>
          <div className='column'>
            <ParamGroup
              title='Clahe'
              name='clahe'
            >
              <Slider
                name='clip_limit'
                min={1.0} max={4.0} type='float'
              />
            </ParamGroup>

            <ParamGroup
              title='Posterize'
              name='posterize'
            >
              <Slider
                name='spatial_window'
                min={2} max={128} type='int'
              />
              <Slider
                name='color_window'
                min={2} max={128} type='int'
              />
            </ParamGroup>

            <ParamGroup
              title='Blur'
              name='blur'
            >
              <Slider
                name='blur_radius'
                min={3} max={7} type='odd'
              />
              <Slider
                name='blur_sigma'
                min={0} max={2} type='float'
              />
            </ParamGroup>

            <ParamGroup
              title='Canny Edge Detection'
              name='canny'
            >
              <Slider
                name='canny_lo'
                min={10} max={200} type='int'
              />
              <Slider
                name='canny_hi'
                min={10} max={200} type='int'
              />
            </ParamGroup>

          </div>
        </div>
      </div>
    )
  }
}

const mapStateToProps = state => ({
})

const mapDispatchToProps = (dispatch, ownProps) => ({
  actions: bindActionCreators(liveActions, dispatch)
})

export default connect(mapStateToProps, mapDispatchToProps)(App)