Fl_Tiled_Image.H 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // "$Id: Fl_Tiled_Image.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
  3. //
  4. // Tiled image header file for the Fast Light Tool Kit (FLTK).
  5. //
  6. // Copyright 1998-2010 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
  25. over a specified area. The source (tile) image is <B>not</B>
  26. copied unless you call the color_average(),
  27. desaturate(),
  28. or inactive()
  29. methods.
  30. */
  31. class FL_EXPORT Fl_Tiled_Image : public Fl_Image {
  32. protected:
  33. Fl_Image *image_; // The image that is shared
  34. int alloc_image_; // Did we allocate this image?
  35. public:
  36. Fl_Tiled_Image(Fl_Image *i, int W = 0, int H = 0);
  37. virtual ~Fl_Tiled_Image();
  38. virtual Fl_Image *copy(int W, int H);
  39. Fl_Image *copy() { return copy(w(), h()); }
  40. virtual void color_average(Fl_Color c, float i);
  41. virtual void desaturate();
  42. virtual void draw(int X, int Y, int W, int H, int cx, int cy);
  43. void draw(int X, int Y) { draw(X, Y, w(), h(), 0, 0); }
  44. /** Gets The image that is shared */
  45. Fl_Image *image() { return image_; }
  46. DECLARE_CLASS_CHEAP_RTTI_2(Fl_Tiled_Image, Fl_Image)
  47. };
  48. #endif // !Fl_Tiled_Image_H
  49. //
  50. // End of "$Id: Fl_Tiled_Image.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
  51. //