GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
gp_rotate.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2/*
3 * Copyright (C) 2009-2025 Cyril Hrubis <metan@ucw.cz>
4 */
5
6/*
7
8 gp_pixmap symmetrys and mirroring.
9
10 */
11
12#ifndef FILTERS_GP_ROTATE_H
13#define FILTERS_GP_ROTATE_H
14
15#include <core/gp_types.h>
16#include <filters/gp_filter.h>
17
18/*
19 * Mirrors bitmap horizontally.
20 *
21 * The dst must be at least as big as source.
22 *
23 * The filter works 'in-place' which means that src and dst
24 * may be very same pixmap. Note that when aborting in-place operation
25 * the image buffer gets into an inconsistent state.
26 *
27 * Returns zero on success, non-zero if operation was aborted.
28 */
29int gp_filter_mirror_h(const gp_pixmap *src, gp_pixmap *dst,
30 gp_progress_cb *callback);
31
32/*
33 * Mirrors bitmap horizontally.
34 *
35 * Returns pointer to newly allocated pixmap, or NULL if malloc() has failed
36 * or operation was aborted from withing a callback.
37 */
38gp_pixmap *gp_filter_mirror_h_alloc(const gp_pixmap *src,
39 gp_progress_cb *callback);
40
41/*
42 * Mirrors bitmap vertically.
43 *
44 * The dst must be at least as big as source.
45 *
46 * The filter works 'in-place' which means that src and dst
47 * may be very same pixmap. Note that when aborting in-place operation
48 * the image buffer gets into an inconsistent state.
49 *
50 * Returns zero on success, non-zero if operation was aborted.
51 */
52int gp_filter_mirror_v(const gp_pixmap *src, gp_pixmap *dst,
53 gp_progress_cb *callback);
54
55/*
56 * Mirrors bitmap vertically.
57 *
58 * Returns pointer to newly allocated pixmap, or NULL if malloc() has failed
59 * or operation was aborted from withing a callback.
60 */
61gp_pixmap *gp_filter_mirror_v_alloc(const gp_pixmap *src,
62 gp_progress_cb *callback);
63
64/*
65 * Rotate the pixmap by 90, 180, 270.
66 *
67 * Returns pointer to destination bitmap or NULL if allocation failed.
68 */
69int gp_filter_rotate_90(const gp_pixmap *src, gp_pixmap *dst,
70 gp_progress_cb *callback);
71
72gp_pixmap *gp_filter_rotate_90_alloc(const gp_pixmap *src,
73 gp_progress_cb *callback);
74
75int gp_filter_rotate_180(const gp_pixmap *src, gp_pixmap *dst,
76 gp_progress_cb *callback);
77
78gp_pixmap *gp_filter_rotate_180_alloc(const gp_pixmap *src,
79 gp_progress_cb *callback);
80
81int gp_filter_rotate_270(const gp_pixmap *src, gp_pixmap *dst,
82 gp_progress_cb *callback);
83
84gp_pixmap *gp_filter_rotate_270_alloc(const gp_pixmap *src,
85 gp_progress_cb *callback);
86
87int gp_filter_symmetry(const gp_pixmap *src, gp_pixmap *dst,
88 gp_symmetry symmetry,
89 gp_progress_cb *callback);
90
91gp_pixmap *gp_filter_symmetry_alloc(const gp_pixmap *src,
92 gp_symmetry symmetry,
93 gp_progress_cb *callback);
94
95#endif /* FILTERS_GP_ROTATE_H */
A common types.
gp_symmetry
Rotation and mirroring flags.
Definition gp_types.h:47
Common filter includes.
A pixmap buffer.
Definition gp_pixmap.h:33
Progress callback.