def slider(): if request.method == "POST": data = request.get_json() print(data, "data") data = json_parse(data) for key in data: value = data[key] print(key, value) write_json('slider', key, value) return "nothing"
def camera(): if request.method == "POST": data = request.get_json() data = json_parse(data) for key in data: value = data[key] if key == 'eyedropper': x = value[0] y = value[1] CVProcessor.generate_eyedropper(x, y) write_json('camera', key, value) return jsonify({ 'hue': CVProcessor.hue, 'saturation': CVProcessor.saturation, 'value': CVProcessor.value })
def set_saturation(self, saturation): self.saturation = saturation write_json('dual_slider', 'saturation', saturation)
def set_value(self, value): self.value = value write_json('dual_slider', 'value', value)
def set_hue(self, hue): self.hue = hue write_json('dual_slider', 'hue', hue)