A Simple X Image Viewer
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

image.h 1.4 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. #ifndef IMAGE_H
  19. #define IMAGE_H
  20. #include "window.h"
  21. enum scalemode {
  22. SCALE_DOWN = 0,
  23. SCALE_FIT,
  24. SCALE_ZOOM
  25. };
  26. typedef enum pandir_e {
  27. PAN_LEFT = 0,
  28. PAN_RIGHT,
  29. PAN_UP,
  30. PAN_DOWN
  31. } pandir_t;
  32. typedef struct img_s {
  33. float zoom;
  34. unsigned char re;
  35. unsigned char checkpan;
  36. unsigned char zoomed;
  37. int x;
  38. int y;
  39. int w;
  40. int h;
  41. } img_t;
  42. void img_init(img_t*, win_t*);
  43. void img_free(img_t*);
  44. int img_load(img_t*, const char*);
  45. void img_render(img_t*, win_t*);
  46. int img_zoom_in(img_t*);
  47. int img_zoom_out(img_t*);
  48. int img_pan(img_t*, win_t*, pandir_t);
  49. #endif /* IMAGE_H */