A Simple X Image Viewer
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 
 

91 строка
1.9 KiB

  1. /* sxiv: image.h
  2. * Copyright (c) 2012 Bert Muennich <be.muennich at googlemail.com>
  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. #ifndef IMAGE_H
  19. #define IMAGE_H
  20. #include <Imlib2.h>
  21. #include "types.h"
  22. #include "window.h"
  23. typedef struct {
  24. Imlib_Image *im;
  25. unsigned int delay;
  26. } img_frame_t;
  27. typedef struct {
  28. img_frame_t *frames;
  29. int cap;
  30. int cnt;
  31. int sel;
  32. bool animate;
  33. } multi_img_t;
  34. typedef struct {
  35. Imlib_Image *im;
  36. int w;
  37. int h;
  38. win_t *win;
  39. float x;
  40. float y;
  41. scalemode_t scalemode;
  42. float zoom;
  43. bool re;
  44. bool checkpan;
  45. bool dirty;
  46. bool aa;
  47. bool alpha;
  48. multi_img_t multi;
  49. } img_t;
  50. void img_init(img_t*, win_t*);
  51. bool img_load(img_t*, const fileinfo_t*);
  52. void img_close(img_t*, bool);
  53. void img_render(img_t*);
  54. bool img_fit_win(img_t*, scalemode_t);
  55. bool img_center(img_t*);
  56. bool img_zoom(img_t*, float);
  57. bool img_zoom_in(img_t*);
  58. bool img_zoom_out(img_t*);
  59. bool img_move(img_t*, float, float);
  60. bool img_pan(img_t*, direction_t, int);
  61. bool img_pan_edge(img_t*, direction_t);
  62. void img_rotate(img_t*, int);
  63. void img_rotate_left(img_t*);
  64. void img_rotate_right(img_t*);
  65. void img_flip(img_t*, flipdir_t);
  66. void img_toggle_antialias(img_t*);
  67. bool img_frame_navigate(img_t*, int);
  68. bool img_frame_animate(img_t*, bool);
  69. #endif /* IMAGE_H */