MCPcopy Create free account
hub / github.com/F-Stack/f-stack / lwDrawPixel

Function lwDrawPixel

app/redis-6.2.6/src/lolwut.c:112–116  ·  view source on GitHub ↗

Set a pixel to the specified color. Color is 0 or 1, where zero means no * dot will be displayed, and 1 means dot will be displayed. * Coordinates are arranged so that left-top corner is 0,0. You can write * out of the size of the canvas without issues. */

Source from the content-addressed store, hash-verified

110 * Coordinates are arranged so that left-top corner is 0,0. You can write
111 * out of the size of the canvas without issues. */
112void lwDrawPixel(lwCanvas *canvas, int x, int y, int color) {
113 if (x < 0 || x >= canvas->width ||
114 y < 0 || y >= canvas->height) return;
115 canvas->pixels[x+y*canvas->width] = color;
116}
117
118/* Return the value of the specified pixel on the canvas. */
119int lwGetPixel(lwCanvas *canvas, int x, int y) {

Callers 2

lwDrawLineFunction · 0.85
generateSkyscraperFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected