1c08c145dfbe36001ed1ebe95fd52ce4b370ab5b
[mplayer/glamo.git] / drivers / libglamo / blit.h
blob1c08c145dfbe36001ed1ebe95fd52ce4b370ab5b
1 /*
2 * Image blitting support using the 2D engine.
4 * Copyright (C) 2007 OpenMoko, Inc.
5 * Author: Chia-I Wu <olv@openmoko.org>
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 or
10 * (at your option) version 3 of the License.
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.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 * MA 02111-1307 USA
22 #ifndef _BLIT_H_
23 #define _BLIT_H_
25 #include "dma.h"
27 enum glamo_blit_format {
28 GLAMO_BLIT_FORMAT_I420,
29 GLAMO_BLIT_FORMAT_YV16,
30 GLAMO_BLIT_FORMAT_YUY2,
33 enum glamo_blit_rotation {
34 GLAMO_BLIT_ROTATION_0,
35 GLAMO_BLIT_ROTATION_90,
36 GLAMO_BLIT_ROTATION_270,
37 GLAMO_BLIT_ROTATION_180,
38 GLAMO_BLIT_ROTATION_MIRROR,
39 GLAMO_BLIT_ROTATION_FLIP
42 struct glamo_blit_image {
43 enum glamo_blit_format format;
44 const unsigned char *data;
45 int width;
46 int height;
47 int num_planes; /* 1 or 3 */
48 int pitches[3];
49 int offsets[3];
52 struct glamo_blit_manager {
53 struct glamo_dma_manager *dma;
54 enum glamo_blit_format format;
57 struct glamo_blit_manager *glamo_blit_new(struct glamo_dma_manager *dma, enum glamo_blit_format format);
58 void glamo_blit_destroy(struct glamo_blit_manager *blit);
59 void glamo_blit_wait(struct glamo_blit_manager *blit);
60 void glamo_blit_dump(struct glamo_blit_manager *blit);
62 void glamo_blit_rotate(struct glamo_blit_manager *blit,
63 enum glamo_blit_rotation);
65 struct glamo_blit_image *glamo_blit_new_image(struct glamo_blit_manager *blit,
66 const unsigned char *data, int width, int height);
67 void glamo_blit_destroy_image(struct glamo_blit_manager *blit, struct glamo_blit_image *image);
68 void glamo_blit_show_image(struct glamo_blit_manager *blit, struct glamo_blit_image *image,
69 int x, int y, int width, int height);
70 void glamo_blit_dump_image(struct glamo_blit_manager *blit, struct glamo_blit_image *image);
72 #endif /* _BLIT_H */