The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
gfx_scale.c File Reference

libgfx: drawing a buffer at another size (bilinear filtering). More...

#include "gfx_internal.h"

Functions

void gfx_blend_scaled (gfx_buffer_t *dst, gfx_rect_t dst_rect, const gfx_buffer_t *src, gfx_rect_t src_rect, uint8_t opacity)
 draw a part of src scaled to fill dst_rect, blended over dst, with bilinear filtering.

Detailed Description

libgfx: drawing a buffer at another size (bilinear filtering).

the source position of each destination pixel is kept in 16.16 fixed point: the centre of destination pixel i maps to the source position (i + 0.5) * scale - 0.5. a sample between pixels mixes the four neighbours; at the edges the nearest pixel is used again.

Function Documentation

◆ gfx_blend_scaled()

void gfx_blend_scaled ( gfx_buffer_t * dst,
gfx_rect_t dst_rect,
const gfx_buffer_t * src,
gfx_rect_t src_rect,
uint8_t opacity )

draw a part of src scaled to fill dst_rect, blended over dst, with bilinear filtering.