diff options
Diffstat (limited to 'apps/plugins/lib/picture.c')
-rw-r--r-- | apps/plugins/lib/picture.c | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/apps/plugins/lib/picture.c b/apps/plugins/lib/picture.c new file mode 100644 index 0000000000..f214dfcdfd --- /dev/null +++ b/apps/plugins/lib/picture.c | |||
@@ -0,0 +1,70 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id: jackpot.c 14034 2007-07-28 05:42:55Z kevin $ | ||
9 | * | ||
10 | * Copyright (C) 2007 Copyright Kévin Ferrare | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #include "picture.h" | ||
21 | |||
22 | void picture_draw(struct screen* display, const struct picture* picture, | ||
23 | int x, int y){ | ||
24 | display->bitmap( | ||
25 | picture->data, | ||
26 | x, y, | ||
27 | picture->width, picture->height | ||
28 | ); | ||
29 | } | ||
30 | |||
31 | /** | ||
32 | * Draws a part of the given picture on the given screen | ||
33 | * Use it when the data contains multiple pictures from top to bottom. | ||
34 | * In that case, picture.height represents the height of one picture, | ||
35 | * not the whole set. | ||
36 | * @param display the screen where to display the picture | ||
37 | * @param picture the picture's data, only a part will be displayed | ||
38 | * @param yoffset display the data in the picture from yoffset to | ||
39 | * yoffset+picture.height | ||
40 | * @param x abscissa where to put the picture | ||
41 | * @param y ordinate where to put the picture | ||
42 | */ | ||
43 | void vertical_picture_draw_part(struct screen* display, const struct picture* picture, | ||
44 | int yoffset, | ||
45 | int x, int y){ | ||
46 | display->bitmap_part( | ||
47 | picture->data, | ||
48 | /*slice into picture->data */ | ||
49 | 0, yoffset, | ||
50 | picture->width, | ||
51 | /* Position on the screen */ | ||
52 | x, y, picture->width, picture->height | ||
53 | ); | ||
54 | } | ||
55 | |||
56 | /** | ||
57 | * Draws a part of the given picture on the given screen | ||
58 | * Use it when the data contains multiple pictures from top to bottom. | ||
59 | * | ||
60 | * @param display the screen where to display the picture | ||
61 | * @param picture the picture's data, only a part will be displayed | ||
62 | * @param sprite_no display that sprite in the picture | ||
63 | * @param x abscissa where to put the picture | ||
64 | * @param y ordinate where to put the picture | ||
65 | */ | ||
66 | void vertical_picture_draw_sprite(struct screen* display, const struct picture* picture, | ||
67 | int sprite_no, | ||
68 | int x, int y){ | ||
69 | vertical_picture_draw_part(display, picture, sprite_no*picture->height, x, y); | ||
70 | } | ||