GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
gp_line_convert.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2/*
3 * Copyright (C) 2009-2013 Cyril Hrubis <metan@ucw.cz>
4 */
5
6/*
7
8 Converts a continuous line of pixels from buffer A to a line of pixels in
9 buffer B.
10
11 Supports only trivial conversions i.e. RGB888 to BGR888 and G1_LE to G1_BE,
12 etc.
13
14 The code is mainly used in image loaders when saving image from memory buffer
15 that has exactly same channels (in size and names) but placed differently in
16 pixel buffer.
17
18 */
19
20
21#ifndef LOADERS_LINE_CONVERT_H
22#define LOADERS_LINE_CONVERT_H
23
24#include <core/gp_pixel.h>
25
26typedef void (*gp_line_convert)(const uint8_t *in, uint8_t *out, unsigned int len);
27
28/*
29 * The out array is terminated by GP_PIXEL_UNKNOWN.
30 *
31 * Returns output pixel type given input pixel type and table of posible output
32 * types.
33 *
34 * Returns GP_PIXEL_UNKNOWN if no conversion is posible.
35 */
36gp_pixel_type gp_line_convertible(gp_pixel_type in, gp_pixel_type out[]);
37
38/*
39 * Returns pointer to conversion function or NULL if there is none.
40 */
41gp_line_convert gp_line_convert_get(gp_pixel_type in, gp_pixel_type out);
42
43#endif /* LOADERS_LINE_CONVERT_H */
gp_pixel_type
List of all pixel types.
A pixel description.