GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
gp_blit.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later
2/*
3 * Copyright (C) 2011 Tomas Gavenciak <gavento@ucw.cz>
4 * Copyright (C) 2011-2024 Cyril Hrubis <metan@ucw.cz>
5 */
6
11#ifndef CORE_GP_BLIT_H
12#define CORE_GP_BLIT_H
13
36void gp_blit_xyxy(const gp_pixmap *src,
37 gp_coord x0, gp_coord y0, gp_coord x1, gp_coord y1,
38 gp_pixmap *dst, gp_coord x2, gp_coord y2);
39
40/*
41 * Clipped variant. Could handle destination coordinates outside of the
42 * destination rectangle (both possitive and negative). Source larger than
43 * destination and so.
44 */
45void gp_blit_xyxy_clipped(const gp_pixmap *src,
46 gp_coord x0, gp_coord y0, gp_coord x1, gp_coord y1,
47 gp_pixmap *dst, gp_coord x2, gp_coord y2);
48
71void gp_blit_xywh(const gp_pixmap *src,
72 gp_coord x0, gp_coord y0, gp_size w0, gp_size h0,
73 gp_pixmap *dst, gp_coord x1, gp_coord y1);
74
75/*
76 * Clipped variant. Could handle destination coordinates outside of the
77 * destination rectangle (both possitive and negative). Source larger than
78 * destination and so.
79 */
80void gp_blit_xywh_clipped(const gp_pixmap *src,
81 gp_coord x0, gp_coord y0, gp_size w0, gp_size h0,
82 gp_pixmap *dst, gp_coord x1, gp_coord y1);
83
90static inline void gp_blit(const gp_pixmap *src,
91 gp_coord x0, gp_coord y0,
92 gp_size w0, gp_size h0,
93 gp_pixmap *dst, gp_coord x1, gp_coord y1)
94{
95 gp_blit_xywh(src, x0, y0, w0, h0, dst, x1, y1);
96}
97
98static inline void gp_blit_clipped(const gp_pixmap *src,
99 gp_coord x0, gp_coord y0,
100 gp_size w0, gp_size h0,
101 gp_pixmap *dst, gp_coord x1, gp_coord y1)
102{
103 gp_blit_xywh_clipped(src, x0, y0, w0, h0, dst, x1, y1);
104}
105
106/*
107 * Same as gp_blit_xyxy but doesn't respect rotations. Faster (for now).
108 */
109void gp_blit_xyxy_raw(const gp_pixmap *src,
110 gp_coord x0, gp_coord y0, gp_coord x1, gp_coord y1,
111 gp_pixmap *dst, gp_coord x2, gp_coord y2);
112
113/*
114 * Same as gp_blit_xywh but doesn't respect rotations. Faster (for now).
115 */
116void gp_blit_xywh_raw(const gp_pixmap *src,
117 gp_coord x0, gp_coord y0, gp_size w0, gp_size h0,
118 gp_pixmap *dst, gp_coord x2, gp_coord y2);
119
120/*
121 * Same as gp_blit but doesn't respect rotations. Faster (for now).
122 */
123static inline void gp_blit_raw(const gp_pixmap *src,
124 gp_coord x0, gp_coord y0,
125 gp_size w0, gp_size h0,
126 gp_pixmap *dst, gp_coord x1, gp_coord y1)
127{
128 gp_blit_xywh_raw(src, x0, y0, w0, h0, dst, x1, y1);
129}
130
131#endif /* CORE_GP_BLIT_H */
int gp_coord
Integer type for coordinates i.e. x, y, ...
Definition gp_types.h:19
unsigned int gp_size
Integer type for sizes i.e. w, h, ...
Definition gp_types.h:24
static void gp_blit(const gp_pixmap *src, gp_coord x0, gp_coord y0, gp_size w0, gp_size h0, gp_pixmap *dst, gp_coord x1, gp_coord y1)
Blits a rectangle from src into a dst.
Definition gp_blit.h:90
void gp_blit_xyxy(const gp_pixmap *src, gp_coord x0, gp_coord y0, gp_coord x1, gp_coord y1, gp_pixmap *dst, gp_coord x2, gp_coord y2)
Blits a rectangle from src into a dst.
void gp_blit_xywh(const gp_pixmap *src, gp_coord x0, gp_coord y0, gp_size w0, gp_size h0, gp_pixmap *dst, gp_coord x1, gp_coord y1)
Blits a rectangle from src into a dst.
A pixmap buffer.
Definition gp_pixmap.h:33