RAWK
Gigapixel Raw Image Processing Toolkit
 All Classes Functions Variables Pages
image_solid.hpp
1 // RAWK Copyright (C) 2014 Robert Kooima
2 //
3 // This program is free software: you can redistribute it and/or modify it
4 // under the terms of the GNU General Public License as published by the Free
5 // Software Foundation, either version 3 of the License, or (at your option)
6 // any later version.
7 //
8 // This program is distributed in the hope that it will be useful, but WITH-
9 // OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 // more details.
12 
13 #ifndef IMAGE_SOLID_HPP
14 #define IMAGE_SOLID_HPP
15 
16 //------------------------------------------------------------------------------
17 
19 
20 class solid : public image
21 {
22 public:
25 
26  solid(int height, int width, double value)
27  : height(height), width(width), value(value) { }
28 
29  virtual double get(int i, int j, int k) const
30  {
31  return value;
32  }
33 
34  virtual int get_height() const { return height; }
35  virtual int get_width () const { return width; }
36  virtual int get_depth () const { return 1; }
37 
38  virtual void doc(std::ostream& out) const
39  {
40  out << "solid " << height << " " << width << " " << value;
41  }
42 
43 private:
44  int height;
45  int width;
46  double value;
47 };
48 
49 //------------------------------------------------------------------------------
50 
51 #endif
virtual int get_depth() const
Return the depth of this image.
Definition: image_solid.hpp:36
solid(int height, int width, double value)
Generate a block of pixels with the given width and height, a depth of one, and a constant value...
Definition: image_solid.hpp:26
virtual int get_width() const
Return the height of this image.
Definition: image_solid.hpp:35
Base class for all image sources, filters, and operators.
Definition: image.hpp:20
virtual void doc(std::ostream &out) const
Produce a string documenting the function of this object.
Definition: image_solid.hpp:38
Solid value generator.
Definition: image_solid.hpp:20
virtual int get_height() const
Return the height of this image.
Definition: image_solid.hpp:34