2 * drivers/video/rockchip/bmp_helper.h
4 * Copyright (C) 2012 Rockchip Corporation
5 * Author: Mark Yao <mark.yao@rock-chips.com>
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * You should have received a copy of the GNU General Public License along with
17 * this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef _BMP_HELPER_H_
21 #define _BMP_HELPER_H_
23 typedef struct bmpheader {
26 unsigned int reserved;
28 }__attribute__((packed)) BITMAPHEADER;
30 typedef struct bmpinfoheader {
34 unsigned short planes;
35 unsigned short bitcount;
36 unsigned int compression;
37 unsigned int imagesize;
38 unsigned int xpelspermeter;
39 unsigned int ypelspermeter;
41 unsigned int colorsimportant;
42 }__attribute__((packed)) BITMAPINFOHEADER;
44 #define BMP_RLE8_ESCAPE 0
45 #define BMP_RLE8_EOL 0
46 #define BMP_RLE8_EOBMP 1
47 #define BMP_RLE8_DELTA 2
49 #define range(x, min, max) ((x) < (min)) ? (min) : (((x) > (max)) ? (max) : (x))
51 int bmpencoder(void *__iomem *vaddr,int width, int height, u8 data_format,
52 void *data, void (*fn)(void *, void *, int));
53 int bmpdecoder(void *bmp_addr, void *dst, int *width, int *height, int *bits);
54 #endif /* _BMP_HELPER_H_ */