Add ability to edit game name from UI
[jpcrr.git] / streamtools / rgbtorgb.hh
blob3f779201524b94413e4a7cfc218b2c01c7fd3e92
1 #ifdef __cplusplus
2 extern "C" {
3 #define defaulttrue =true
4 #else
5 #define defaulttrue
6 #define bool int
7 #endif
9 /* RGB to RGB and RGB from/to YCbRr (YUV) conversions written by Bisqwit
10 * Copyright (C) 1992,2008 Joel Yliluoma (http://iki.fi/bisqwit/)
12 * Concepts:
13 * 15 = RGB15 or BGR15
14 * 16 = RGB16 or BGR16
15 * 24 = RGB24 or BGR24
16 * 32 = RGB32 or BGR32
17 * I420 = YCbCr where Y is issued for each pixel,
18 * followed by Cr for 2x2 pixels,
19 * followed by Cb for 2x2 pixels
20 * YUY2 = YCbCr where for each pixel, Y is issued,
21 * followed by Cr for 2x1 pixels (if even pixel)
22 * or Cb for 2x1 pixels (if odd pixel)
24 * Note: Not all functions honor the swap_red_blue setting.
27 void Convert32To24Frame(const void* data, unsigned char* dest, unsigned npixels)
28 __attribute__((noinline));
30 void Convert15To24Frame(const void* data, unsigned char* dest, unsigned npixels, bool swap_red_blue defaulttrue)
31 __attribute__((noinline));
33 void Convert16To24Frame(const void* data, unsigned char* dest, unsigned npixels, bool swap_red_blue defaulttrue)
34 __attribute__((noinline));
36 void Convert15To32Frame(const void* data, unsigned char* dest, unsigned npixels, bool swap_red_blue defaulttrue)
37 __attribute__((noinline));
39 void Convert16To32Frame(const void* data, unsigned char* dest, unsigned npixels, bool swap_red_blue defaulttrue)
40 __attribute__((noinline));
42 void Convert24To16Frame(const void* data, unsigned char* dest, unsigned npixels, unsigned width);
44 void Convert24To15Frame(const void* data, unsigned char* dest, unsigned npixels, unsigned width);
46 void Convert_I420To24Frame(const void* data, unsigned char* dest, unsigned npixels, unsigned width, bool swap_red_blue defaulttrue)
47 __attribute__((noinline));
49 void Convert15To_I420Frame(const void* data, unsigned char* dest, unsigned npixels, unsigned width);
50 void Convert16To_I420Frame(const void* data, unsigned char* dest, unsigned npixels, unsigned width);
51 void Convert24To_I420Frame(const void* data, unsigned char* dest, unsigned npixels, unsigned width);
52 void Convert32To_I420Frame(const void* data, unsigned char* dest, unsigned npixels, unsigned width);
54 void Convert_YUY2To24Frame(const void* data, unsigned char* dest, unsigned npixels, unsigned width, bool swap_red_blue defaulttrue)
55 __attribute__((noinline));
57 void Convert15To_YUY2Frame(const void* data, unsigned char* dest, unsigned npixels, unsigned width);
58 void Convert16To_YUY2Frame(const void* data, unsigned char* dest, unsigned npixels, unsigned width);
59 void Convert24To_YUY2Frame(const void* data, unsigned char* dest, unsigned npixels, unsigned width);
60 void Convert32To_YUY2Frame(const void* data, unsigned char* dest, unsigned npixels, unsigned width);
62 #ifdef __cplusplus
64 #undef defaulttrue
65 #else
66 #undef defaulttrue
67 #undef bool
68 #endif