fix red.
[kugel-rb.git] / apps / plugins / lib / picture.c
blob7717b76eeb7b3c7e34908b9e22226c904a6efd27
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2007 Copyright Kévin Ferrare
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #include "picture.h"
24 void picture_draw(struct screen* display, const struct picture* picture,
25 int x, int y){
26 display->bitmap(
27 picture->data,
28 x, y,
29 picture->width, picture->slide_height
33 /**
34 * Draws a part of the given picture on the given screen
35 * Use it when the data contains multiple pictures from top to bottom.
36 * In that case, picture.slide_height represents the height of one picture,
37 * not the whole set. picture.height represents the height of the whole image
38 * @param display the screen where to display the picture
39 * @param picture the picture's data, only a part will be displayed
40 * @param yoffset display the data in the picture from yoffset to
41 * yoffset+picture.height
42 * @param x abscissa where to put the picture
43 * @param y ordinate where to put the picture
45 void vertical_picture_draw_part(struct screen* display, const struct picture* picture,
46 int yoffset,
47 int x, int y){
48 display->bitmap_part(
49 picture->data,
50 /*slice into picture->data */
51 0, yoffset,
52 STRIDE(display->screen_type, picture->width, picture->height),
53 /* Position on the screen */
54 x, y, picture->width, picture->slide_height
58 /**
59 * Draws a part of the given picture on the given screen
60 * Use it when the data contains multiple pictures from top to bottom.
62 * @param display the screen where to display the picture
63 * @param picture the picture's data, only a part will be displayed
64 * @param sprite_no display that sprite in the picture
65 * @param x abscissa where to put the picture
66 * @param y ordinate where to put the picture
68 void vertical_picture_draw_sprite(struct screen* display, const struct picture* picture,
69 int sprite_no,
70 int x, int y){
71 vertical_picture_draw_part( display, picture,
72 sprite_no*picture->slide_height, x, y);