PatchworkOS
Loading...
Searching...
No Matches
drawable.c File Reference
#include "internal.h"
#include <math.h>
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Data Structures

struct  edge_t
 

Functions

void draw_rect (drawable_t *draw, const rect_t *rect, pixel_t pixel)
 Draw a filled rectangle.
 
static int edge_compare (const void *a, const void *b)
 
void draw_polygon (drawable_t *draw, const point_t *points, uint64_t pointCount, pixel_t pixel)
 Draw a filled polygon.
 
void draw_line (drawable_t *draw, const point_t *start, const point_t *end, pixel_t pixel, uint32_t thickness)
 Draw a line between two points.
 
void draw_frame (drawable_t *draw, const rect_t *rect, uint64_t width, pixel_t foreground, pixel_t background)
 Draw a skeuomorphic frame.
 
void draw_dashed_outline (drawable_t *draw, const rect_t *rect, pixel_t pixel, uint32_t length, int32_t width)
 Draw a dashed outline just inside the given rectangle.
 
void draw_bezel (drawable_t *draw, const rect_t *rect, uint64_t width, pixel_t pixel)
 Draw a filled border bezel just inside the given rectangle.
 
void draw_gradient (drawable_t *draw, const rect_t *rect, pixel_t start, pixel_t end, direction_t direction, bool shouldAddNoise)
 Draw a gradient filled rectangle.
 
void draw_transfer (drawable_t *dest, drawable_t *src, const rect_t *destRect, const point_t *srcPoint)
 Transfer pixels from one drawable to another.
 
void draw_transfer_blend (drawable_t *dest, drawable_t *src, const rect_t *destRect, const point_t *srcPoint)
 Transfer pixels from one drawable to another with alpha blending.
 
void draw_image (drawable_t *draw, image_t *image, const rect_t *destRect, const point_t *srcPoint)
 Draw an image,.
 
void draw_image_blend (drawable_t *draw, image_t *image, const rect_t *destRect, const point_t *srcPoint)
 Draw an image with alpha blending.
 
static void draw_grf_char (drawable_t *draw, const font_t *font, const point_t *point, uint8_t chr, pixel_t pixel)
 
void draw_string (drawable_t *draw, const font_t *font, const point_t *point, pixel_t pixel, const char *string, uint64_t length)
 Draw a string.
 
static void draw_calculate_aligned_text_pos (const rect_t *rect, const font_t *font, const char *string, uint64_t length, align_t xAlign, align_t yAlign, point_t *aligned)
 
void draw_text (drawable_t *draw, const rect_t *rect, const font_t *font, align_t xAlign, align_t yAlign, pixel_t pixel, const char *text)
 Draw text to a drawable.
 
void draw_text_multiline (drawable_t *draw, const rect_t *rect, const font_t *font, align_t xAlign, align_t yAlign, pixel_t pixel, const char *text)
 Draw multiline text to a drawable.
 
void draw_ridge (drawable_t *draw, const rect_t *rect, uint64_t width, pixel_t foreground, pixel_t background)
 Draw a ridge effect.
 
void draw_separator (drawable_t *draw, const rect_t *rect, pixel_t highlight, pixel_t shadow, direction_t direction)
 Draw a separator line.
 
void draw_invalidate (drawable_t *draw, const rect_t *rect)
 Invalidate a rectangle in the drawable.
 

Function Documentation

◆ draw_calculate_aligned_text_pos()

static void draw_calculate_aligned_text_pos ( const rect_t rect,
const font_t font,
const char *  string,
uint64_t  length,
align_t  xAlign,
align_t  yAlign,
point_t aligned 
)
static

◆ draw_grf_char()

◆ edge_compare()

static int edge_compare ( const void *  a,
const void *  b 
)
inlinestatic

Definition at line 33 of file drawable.c.

References edge_t::x.

Referenced by draw_polygon().