XenevaOS
Loading...
Searching...
No Matches
Macros | Functions
draw.cpp File Reference
#include "draw.h"
#include <stdlib.h>
#include <math.h>
#include "_fastcpy.h"
#include <string.h>
Include dependency graph for draw.cpp:

Macros

#define sign(x)   ((x < 0) ? -1 : ((x > 0) ? 1 : 0))
 

Functions

void ChDrawRect (ChCanvas *canvas, unsigned x, unsigned y, unsigned w, unsigned h, uint32_t col)
 
void ChDrawRectClipped (ChCanvas *canv, unsigned x, unsigned y, unsigned w, unsigned h, ChRect *clip, uint32_t col)
 
void ChDrawVerticalLine (ChCanvas *canv, unsigned x, unsigned y, unsigned len, uint32_t col)
 
void ChDrawHorizontalLine (ChCanvas *canv, unsigned x, unsigned y, unsigned len, uint32_t col)
 
void ChDrawRectUnfilled (ChCanvas *canv, unsigned x, unsigned y, unsigned w, unsigned h, uint32_t color)
 
void ChDrawRectUnfilledClipped (ChCanvas *canv, unsigned x, unsigned y, unsigned w, unsigned h, ChRect *clip, uint32_t col)
 
void ChDrawFilledCircle (ChCanvas *canv, int x, int y, int radius, uint32_t fill_col)
 
void ChDrawLine (ChCanvas *canv, int x1, int y1, int x2, int y2, uint32_t color)
 
void ChDrawCircleUnfilled (ChCanvas *canvas, int x, int y, int radius, uint32_t color)
 
void ChDrawFilledCircleAA (ChCanvas *canv, int cx, int cy, int radius, uint32_t color)
 
void ChDrawCapsule (ChCanvas *canv, int x, int y, int width, int height, uint32_t color)
 
void ChDrawBoxBlur (ChCanvas *canv, uint32_t *inputBuf, uint32_t *outputBuf, int cx, int cy, int w, int h)
 

Macro Definition Documentation

◆ sign

#define sign (   x)    ((x < 0) ? -1 : ((x > 0) ? 1 : 0))

BSD 2-Clause License

Copyright (c) 2022-2023, Manas Kamal Choudhury All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Function Documentation

◆ ChDrawBoxBlur()

void ChDrawBoxBlur ( ChCanvas canv,
uint32_t inputBuf,
uint32_t outputBuf,
int  cx,
int  cy,
int  w,
int  h 
)

acrylic_box_blur – Adds box blur filter to a given image using 3x3 matrix kernel

Parameters
canvas– current canvas where to draw
input– input image buffer
output– output image buffer
cx– current x position to focus
cy– current y position to focus
w– box boundary width
h– box boundary height

◆ ChDrawCapsule()

void ChDrawCapsule ( ChCanvas canv,
int  x,
int  y,
int  width,
int  height,
uint32_t  color 
)

◆ ChDrawCircleUnfilled()

void ChDrawCircleUnfilled ( ChCanvas canvas,
int  x,
int  y,
int  radius,
uint32_t  color 
)

◆ ChDrawFilledCircle()

void ChDrawFilledCircle ( ChCanvas canv,
int  x,
int  y,
int  radius,
uint32_t  fill_col 
)

◆ ChDrawFilledCircleAA()

void ChDrawFilledCircleAA ( ChCanvas canv,
int  cx,
int  cy,
int  radius,
uint32_t  color 
)

◆ ChDrawHorizontalLine()

void ChDrawHorizontalLine ( ChCanvas canv,
unsigned  x,
unsigned  y,
unsigned  len,
uint32_t  col 
)

◆ ChDrawLine()

void ChDrawLine ( ChCanvas canv,
int  x1,
int  y1,
int  x2,
int  y2,
uint32_t  color 
)

◆ ChDrawRect()

void ChDrawRect ( ChCanvas canvas,
unsigned  x,
unsigned  y,
unsigned  w,
unsigned  h,
uint32_t  col 
)

◆ ChDrawRectClipped()

void ChDrawRectClipped ( ChCanvas canv,
unsigned  x,
unsigned  y,
unsigned  w,
unsigned  h,
ChRect clip,
uint32_t  col 
)

◆ ChDrawRectUnfilled()

void ChDrawRectUnfilled ( ChCanvas canv,
unsigned  x,
unsigned  y,
unsigned  w,
unsigned  h,
uint32_t  color 
)

◆ ChDrawRectUnfilledClipped()

void ChDrawRectUnfilledClipped ( ChCanvas canv,
unsigned  x,
unsigned  y,
unsigned  w,
unsigned  h,
ChRect clip,
uint32_t  col 
)

◆ ChDrawVerticalLine()

void ChDrawVerticalLine ( ChCanvas canv,
unsigned  x,
unsigned  y,
unsigned  len,
uint32_t  col 
)