Fl_Tiled_Image.H 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //
  2. // "$Id: Fl_Tiled_Image.H 12411 2017-08-30 17:44:09Z manolo $"
  3. //
  4. // Tiled image header file for the Fast Light Tool Kit (FLTK).
  5. //
  6. // Copyright 1998-2015 by Bill Spitzak and others.
  7. //
  8. // This library is free software. Distribution and use rights are outlined in
  9. // the file "COPYING" which should have been included with this file. If this
  10. // file is missing or damaged, see the license at:
  11. //
  12. // http://www.fltk.org/COPYING.php
  13. //
  14. // Please report all bugs and problems on the following page:
  15. //
  16. // http://www.fltk.org/str.php
  17. //
  18. /* \file
  19. Fl_Tiled_Image widget . */
  20. #ifndef Fl_Tiled_Image_H
  21. # define Fl_Tiled_Image_H
  22. # include "Fl_Image.H"
  23. /**
  24. This class supports tiling of images over a specified area.
  25. The source (tile) image is \b not copied unless you call the
  26. color_average(), desaturate(), or inactive() methods.
  27. */
  28. class FL_EXPORT Fl_Tiled_Image : public Fl_Image {
  29. protected:
  30. Fl_Image *image_; // The image that is tiled
  31. int alloc_image_; // Did we allocate this image?
  32. public:
  33. Fl_Tiled_Image(Fl_Image *i, int W = 0, int H = 0);
  34. virtual ~Fl_Tiled_Image();
  35. virtual Fl_Image *copy(int W, int H);
  36. Fl_Image *copy() { return copy(w(), h()); }
  37. virtual void color_average(Fl_Color c, float i);
  38. virtual void desaturate();
  39. virtual void draw(int X, int Y, int W, int H, int cx = 0, int cy = 0);
  40. void draw(int X, int Y) { draw(X, Y, w(), h(), 0, 0); }
  41. /** Gets The image that is tiled */
  42. Fl_Image *image() { return image_; }
  43. DECLARE_CLASS_CHEAP_RTTI_2(Fl_Tiled_Image, Fl_Image)
  44. };
  45. #endif // !Fl_Tiled_Image_H
  46. //
  47. // End of "$Id: Fl_Tiled_Image.H 12411 2017-08-30 17:44:09Z manolo $"
  48. //