Krolyxon
Commit 79d780a

Branches

Refs →

nsxivimage.h

84 lines · 1.9 KB · Objective-C

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 it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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
27typedef struct {
28 Imlib_Image *im;
29 unsigned int delay;
30} img_frame_t;
31
32typedef struct {
33 img_frame_t *frames;
34 int cap;
35 int cnt;
36 int sel;
37 unsigned char animate;
38} multi_img_t;
39
40typedef struct {
41 Imlib_Image *im;
42 multi_img_t multi;
43
44 float zoom;
45 scalemode_t scalemode;
46
47 unsigned char re;
48 unsigned char checkpan;
49 unsigned char aa;
50 unsigned char alpha;
51
52 int x;
53 int y;
54 int w;
55 int h;
56} img_t;
57
58void img_init(img_t*, win_t*);
59
60int img_load(img_t*, const fileinfo_t*);
61void img_close(img_t*, int);
62
63void img_render(img_t*, win_t*);
64
65int img_fit_win(img_t*, win_t*);
66int img_center(img_t*, win_t*);
67
68int img_zoom(img_t*, win_t*, float);
69int img_zoom_in(img_t*, win_t*);
70int img_zoom_out(img_t*, win_t*);
71
72int img_move(img_t*, win_t*, int, int);
73int img_pan(img_t*, win_t*, direction_t, int);
74int img_pan_edge(img_t*, win_t*, direction_t);
75
76void img_rotate_left(img_t*, win_t*);
77void img_rotate_right(img_t*, win_t*);
78
79void img_toggle_antialias(img_t*);
80
81int img_frame_navigate(img_t*, int);
82int img_frame_animate(img_t*, int);
83
84#endif /* IMAGE_H */