| 1 | /* sxiv: image.h |
| 2 | * Copyright (c) 2011 Bert Muennich <muennich at informatik.hu-berlin.de> |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License as published by |
| 6 | * the Free Software Foundation; either version 2 of the License, or |
| 7 | * (at your option) any later version. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 17 | */ |
| 18 | |
| 19 | #ifndef IMAGE_H |
| 20 | #define IMAGE_H |
| 21 | |
| 22 | #include <Imlib2.h> |
| 23 | |
| 24 | #include "types.h" |
| 25 | #include "window.h" |
| 26 | |
| 27 | typedef struct { |
| 28 | Imlib_Image *im; |
| 29 | |
| 30 | float zoom; |
| 31 | scalemode_t scalemode; |
| 32 | |
| 33 | unsigned char re; |
| 34 | unsigned char checkpan; |
| 35 | unsigned char aa; |
| 36 | unsigned char alpha; |
| 37 | |
| 38 | int x; |
| 39 | int y; |
| 40 | int w; |
| 41 | int h; |
| 42 | } img_t; |
| 43 | |
| 44 | void img_init(img_t*, win_t*); |
| 45 | |
| 46 | int img_load(img_t*, const fileinfo_t*); |
| 47 | void img_close(img_t*, int); |
| 48 | |
| 49 | void img_render(img_t*, win_t*); |
| 50 | |
| 51 | int img_fit_win(img_t*, win_t*); |
| 52 | int img_center(img_t*, win_t*); |
| 53 | |
| 54 | int img_zoom(img_t*, win_t*, float); |
| 55 | int img_zoom_in(img_t*, win_t*); |
| 56 | int img_zoom_out(img_t*, win_t*); |
| 57 | |
| 58 | int img_move(img_t*, win_t*, int, int); |
| 59 | int img_pan(img_t*, win_t*, direction_t, int); |
| 60 | int img_pan_edge(img_t*, win_t*, direction_t); |
| 61 | |
| 62 | void img_rotate_left(img_t*, win_t*); |
| 63 | void img_rotate_right(img_t*, win_t*); |
| 64 | |
| 65 | void img_toggle_antialias(img_t*); |
| 66 | |
| 67 | #endif /* IMAGE_H */ |