draw-pixel

wayland/vidor-graphics/draw-pixel

Draw a pixel.
draw-pixel
@/draw-pixel
Draw a pixel.
GFX@/gfx-device
A Vidor graphics device.
Xnumber
X coordinate.
Ynumber
Y coordinate.
Colorxod/color/color
Color of pixel.
Alphanumber
Alpha compositing. Takes a value from 0 to 255.
UPDpulse
Update
draw-pixel
GFX
X
Y
Color
Alpha
UPD
Done
Donepulse
Pulse on completion.
To use the node in your project you should have the wayland/vidor-graphics library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

#pragma XOD evaluate_on_pin disable
#pragma XOD evaluate_on_pin enable input_UPD

node {
    void evaluate(Context ctx) {

        if (!isInputDirty<input_UPD>(ctx))
            return;

        auto gfx = getValue<input_GFX>(ctx);
        auto color = getValue<input_Color>(ctx);
        uint32_t color32 = gfx->Color(color.r, color.g, color.b);
        gfx->drawLine(
            getValue<input_X>(ctx),
            getValue<input_Y>(ctx),
            color32,
            getValue<input_Alpha>(ctx));
        emitValue<output_Done>(ctx, 1);
    }
}