blob: 871cfc93b75b5db04efc38baed406c7e76c7907d [file] [log] [blame]
Talustus3019a912013-04-06 11:50:07 +02001/*
2 * -- http://android-fb2png.googlecode.com/svn/trunk/img_process.h --
3 *
4 * Copyright 2011, Kyan He <kyan.ql.he@gmail.com>
5 *
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef __IMG_PROCESS_H__
22#define __IMG_PROCESS_H__
23
24/**
25 * rgba8888 is found on Desire HD Linux localhost 2.6.35.10-g931a37e #1
26 * PREEMPT Wed Nov 9 14:04:03 CST 2011 armv7l GNU/Linux
27 */
28
29
30typedef struct rgb888 {
31 char r;
32 char g;
33 char b;
34} rgb888_t;
35
36typedef rgb888_t rgb24_t;
37
38typedef struct argb8888 {
39 char a;
40 char r;
41 char g;
42 char b;
43} argb8888_t;
44
45typedef struct abgr8888 {
46 char a;
47 char b;
48 char g;
49 char r;
50} abgr8888_t;
51
52typedef struct bgra8888 {
53 char b;
54 char g;
55 char r;
56 char a;
57} bgra8888_t;
58
59typedef struct rgba8888 {
60 char r;
61 char g;
62 char b;
63 char a;
64} rgba8888_t;
65
66typedef struct rgb565 {
67 short b:5;
68 short g:6;
69 short r:5;
70} rgb565_t;
71
72int rgb565_to_rgb888(const char* src, char* dst, size_t pixel);
73
74int argb8888_to_rgb888(const char* src, char* dst, size_t pixel);
75
76int abgr8888_to_rgb888(const char* src, char* dst, size_t pixel);
77
78int bgra8888_to_rgb888(const char* src, char* dst, size_t pixel);
79
80int rgba8888_to_rgb888(const char* src, char* dst, size_t pixel);
81
82int save_png(const char* path, const char* data, int width, int height);
83
84#endif