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,
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
;
47 int num_planes
; /* 1 or 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
);