mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
update
This commit is contained in:
parent
06084e5588
commit
827294b88c
@ -16,6 +16,11 @@
|
|||||||
},
|
},
|
||||||
"minItems": 3,
|
"minItems": 3,
|
||||||
"maxItems": 3,
|
"maxItems": 3,
|
||||||
|
"options": {
|
||||||
|
"dependencies": {
|
||||||
|
"random-color": false
|
||||||
|
}
|
||||||
|
},
|
||||||
"propertyOrder" : 1
|
"propertyOrder" : 1
|
||||||
},
|
},
|
||||||
"rotation-time": {
|
"rotation-time": {
|
||||||
@ -34,34 +39,30 @@
|
|||||||
"propertyOrder" : 3
|
"propertyOrder" : 3
|
||||||
},
|
},
|
||||||
"brightness": {
|
"brightness": {
|
||||||
"type": "number",
|
"type": "integer",
|
||||||
"title":"edt_eff_brightness",
|
"title":"edt_eff_brightness",
|
||||||
"default": 100,
|
"default": 100,
|
||||||
"minimum" : 1,
|
"minimum" : 0,
|
||||||
|
"maximum" : 100,
|
||||||
"step" : 10,
|
"step" : 10,
|
||||||
"append" : "edt_append_percent",
|
"append" : "edt_append_percent",
|
||||||
"propertyOrder" : 4
|
"propertyOrder" : 4
|
||||||
},
|
},
|
||||||
"saturation": {
|
"saturation": {
|
||||||
"type": "number",
|
"type": "integer",
|
||||||
"title":"edt_eff_saturation",
|
"title":"edt_eff_saturation",
|
||||||
"default": 100,
|
"default": 100,
|
||||||
"minimum" : 1,
|
"minimum" : 0,
|
||||||
|
"maximum" : 100,
|
||||||
"step" : 10,
|
"step" : 10,
|
||||||
"append" : "edt_append_percent",
|
"append" : "edt_append_percent",
|
||||||
"propertyOrder" : 5
|
"propertyOrder" : 5
|
||||||
},
|
},
|
||||||
"reverse": {
|
|
||||||
"type": "boolean",
|
|
||||||
"title":"edt_eff_reversedirection",
|
|
||||||
"default": false,
|
|
||||||
"propertyOrder" : 6
|
|
||||||
},
|
|
||||||
"random-color": {
|
"random-color": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"title":"edt_eff_colorrandom",
|
"title":"edt_eff_colorrandom",
|
||||||
"default": false,
|
"default": false,
|
||||||
"propertyOrder" : 7
|
"propertyOrder" : 6
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"name" : "Sparks Color",
|
|
||||||
"script" : "sparks.py",
|
|
||||||
"args" :
|
|
||||||
{
|
|
||||||
"rotation-time" : 3.0,
|
|
||||||
"sleep-time" : 0.05,
|
|
||||||
"brightness" : 1.0,
|
|
||||||
"saturation" : 1.0,
|
|
||||||
"reverse" : false,
|
|
||||||
"color" : [255,255,255],
|
|
||||||
"random-color" : true
|
|
||||||
}
|
|
||||||
}
|
|
@ -7,7 +7,6 @@
|
|||||||
"sleep-time" : 0.05,
|
"sleep-time" : 0.05,
|
||||||
"brightness" : 100,
|
"brightness" : 100,
|
||||||
"saturation" : 100,
|
"saturation" : 100,
|
||||||
"reverse" : false,
|
|
||||||
"color" : [255,255,255],
|
"color" : [255,255,255],
|
||||||
"random-color" : false
|
"random-color" : false
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ rotationTime = float(hyperion.args.get('rotation-time', 3.0))
|
|||||||
sleepTime = float(hyperion.args.get('sleep-time', 0.05))
|
sleepTime = float(hyperion.args.get('sleep-time', 0.05))
|
||||||
brightness = float(hyperion.args.get('brightness', 100))/100.0
|
brightness = float(hyperion.args.get('brightness', 100))/100.0
|
||||||
saturation = float(hyperion.args.get('saturation', 100))/100.0
|
saturation = float(hyperion.args.get('saturation', 100))/100.0
|
||||||
reverse = bool(hyperion.args.get('reverse', False))
|
|
||||||
color = list(hyperion.args.get('color', (255,255,255)))
|
color = list(hyperion.args.get('color', (255,255,255)))
|
||||||
randomColor = bool(hyperion.args.get('random-color', False))
|
randomColor = bool(hyperion.args.get('random-color', False))
|
||||||
|
|
||||||
@ -24,7 +23,7 @@ while not hyperion.abort():
|
|||||||
if random.random() < 0.005:
|
if random.random() < 0.005:
|
||||||
|
|
||||||
if randomColor:
|
if randomColor:
|
||||||
rgb = colorsys.hsv_to_rgb(random.random(), 1, 1)
|
rgb = colorsys.hsv_to_rgb(random.random(), saturation, brightness)
|
||||||
for n in range(3):
|
for n in range(3):
|
||||||
color[n] = int(rgb[n]*255)
|
color[n] = int(rgb[n]*255)
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ PyMethodDef Effect::effectMethods[] = {
|
|||||||
{"imageRadialGradient" , Effect::wrapImageRadialGradient , METH_VARARGS, ""},
|
{"imageRadialGradient" , Effect::wrapImageRadialGradient , METH_VARARGS, ""},
|
||||||
{"imageSolidFill" , Effect::wrapImageSolidFill , METH_VARARGS, ""},
|
{"imageSolidFill" , Effect::wrapImageSolidFill , METH_VARARGS, ""},
|
||||||
{"imageDrawLine" , Effect::wrapImageDrawLine , METH_VARARGS, ""},
|
{"imageDrawLine" , Effect::wrapImageDrawLine , METH_VARARGS, ""},
|
||||||
|
{"imageDrawPoint" , Effect::wrapImageDrawPoint , METH_VARARGS, ""},
|
||||||
{"imageDrawRect" , Effect::wrapImageDrawRect , METH_VARARGS, ""},
|
{"imageDrawRect" , Effect::wrapImageDrawRect , METH_VARARGS, ""},
|
||||||
{"imageSetPixel" , Effect::wrapImageSetPixel , METH_VARARGS, "set pixel color of image"},
|
{"imageSetPixel" , Effect::wrapImageSetPixel , METH_VARARGS, "set pixel color of image"},
|
||||||
{"imageGetPixel" , Effect::wrapImageGetPixel , METH_VARARGS, "get pixel color of image"},
|
{"imageGetPixel" , Effect::wrapImageGetPixel , METH_VARARGS, "get pixel color of image"},
|
||||||
@ -682,6 +683,40 @@ PyObject* Effect::wrapImageDrawLine(PyObject *self, PyObject *args)
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PyObject* Effect::wrapImageDrawPoint(PyObject *self, PyObject *args)
|
||||||
|
{
|
||||||
|
Effect * effect = getEffect();
|
||||||
|
|
||||||
|
int argCount = PyTuple_Size(args);
|
||||||
|
int r, g, b, x, y;
|
||||||
|
int a = 255;
|
||||||
|
int thick = 1;
|
||||||
|
|
||||||
|
bool argsOK = false;
|
||||||
|
|
||||||
|
if ( argCount == 7 && PyArg_ParseTuple(args, "iiiiiii", &x, &y, &thick, &r, &g, &b, &a) )
|
||||||
|
{
|
||||||
|
argsOK = true;
|
||||||
|
}
|
||||||
|
if ( argCount == 6 && PyArg_ParseTuple(args, "iiiiii", &x, &y, &thick, &r, &g, &b) )
|
||||||
|
{
|
||||||
|
argsOK = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (argsOK)
|
||||||
|
{
|
||||||
|
QPainter * painter = effect->_painter;
|
||||||
|
QPen oldPen = painter->pen();
|
||||||
|
QPen newPen(QColor(r,g,b,a));
|
||||||
|
newPen.setWidth(thick);
|
||||||
|
painter->setPen(newPen);
|
||||||
|
painter->drawPoint(x, y);
|
||||||
|
painter->setPen(oldPen);
|
||||||
|
|
||||||
|
return Py_BuildValue("");
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
PyObject* Effect::wrapImageDrawRect(PyObject *self, PyObject *args)
|
PyObject* Effect::wrapImageDrawRect(PyObject *self, PyObject *args)
|
||||||
{
|
{
|
||||||
|
@ -62,6 +62,7 @@ private:
|
|||||||
static PyObject* wrapImageRadialGradient (PyObject *self, PyObject *args);
|
static PyObject* wrapImageRadialGradient (PyObject *self, PyObject *args);
|
||||||
static PyObject* wrapImageSolidFill (PyObject *self, PyObject *args);
|
static PyObject* wrapImageSolidFill (PyObject *self, PyObject *args);
|
||||||
static PyObject* wrapImageDrawLine (PyObject *self, PyObject *args);
|
static PyObject* wrapImageDrawLine (PyObject *self, PyObject *args);
|
||||||
|
static PyObject* wrapImageDrawPoint (PyObject *self, PyObject *args);
|
||||||
static PyObject* wrapImageDrawRect (PyObject *self, PyObject *args);
|
static PyObject* wrapImageDrawRect (PyObject *self, PyObject *args);
|
||||||
static PyObject* wrapImageSetPixel (PyObject *self, PyObject *args);
|
static PyObject* wrapImageSetPixel (PyObject *self, PyObject *args);
|
||||||
static PyObject* wrapImageGetPixel (PyObject *self, PyObject *args);
|
static PyObject* wrapImageGetPixel (PyObject *self, PyObject *args);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user