00001
00002 #ifndef vil1_memory_image_impl_h_
00003 #define vil1_memory_image_impl_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <vil1/vil1_image_impl.h>
00020 #include <vil1/vil1_memory_image.h>
00021 #include <vcl_string.h>
00022
00023
00024 class vil1_memory_image_impl : public vil1_image_impl
00025 {
00026 public:
00027 vil1_memory_image_impl(int planes, int w, int h,
00028 vil1_memory_image_format const& format);
00029 vil1_memory_image_impl(int planes, int w, int h, int components, int bits_per_component,
00030 vil1_component_format component_format);
00031 vil1_memory_image_impl(int planes, int w, int h,
00032 vil1_pixel_format_t pixel_format);
00033 vil1_memory_image_impl(int w, int h, int components, int bits_per_component,
00034 vil1_component_format component_format);
00035 vil1_memory_image_impl(int w, int h,
00036 vil1_pixel_format_t pixel_format);
00037 vil1_memory_image_impl(vil1_memory_image_impl const&);
00038
00039 ~vil1_memory_image_impl();
00040
00041 virtual int planes() const { return planes_; }
00042 virtual int width() const { return width_; }
00043 virtual int height() const { return height_; }
00044 virtual int components() const { return components_; }
00045 virtual int bits_per_component() const { return bits_per_component_; }
00046 virtual vil1_component_format component_format() const { return component_format_; }
00047 virtual vil1_image get_plane(unsigned int p) const;
00048
00049 virtual bool get_section(void* buf, int x0, int y0, int width, int height) const;
00050 virtual bool put_section(void const* buf, int x0, int y0, int width, int height);
00051
00052 virtual bool get_property(char const *tag, void *property_value = 0) const;
00053
00054 void resize(int planes, int width, int height);
00055 void resize(int planes, int width, int height, int components, int bits_per_component,
00056 vil1_component_format format);
00057
00058
00059 virtual vcl_string is_a() const;
00060
00061
00062 virtual bool is_class(vcl_string const&) const;
00063
00064
00065
00066 vil1_memory_image_impl(void *buf, int planes, int w, int h,
00067 vil1_memory_image_format const& format);
00068
00069
00070 vil1_memory_image_impl(void *buf, int planes, int w, int h, int components, int bits_per_component,
00071 vil1_component_format component_format);
00072
00073
00074 vil1_memory_image_impl(void *buf, int planes, int w, int h,
00075 vil1_pixel_format_t pixel_format);
00076
00077
00078 vil1_memory_image_impl(void *buf, int w, int h, int components, int bits_per_component,
00079 vil1_component_format component_format);
00080
00081
00082 vil1_memory_image_impl(void *buf, int w, int h,
00083 vil1_pixel_format_t pixel_format);
00084
00085 protected:
00086 friend class vil1_memory_image;
00087
00088 void init(void *buf, int planes, int w, int h,
00089 vil1_pixel_format_t pixel_format);
00090 void init(void *buf, int planes, int w, int h, int components,
00091 int bits_per_component, vil1_component_format);
00092
00093 int planes_;
00094 int width_;
00095 int height_;
00096 int components_;
00097 int bits_per_component_;
00098 vil1_component_format component_format_;
00099
00100 int bytes_per_pixel_;
00101 bool is_foreign_buf_;
00102
00103 unsigned char* buf_;
00104 void*** rows_;
00105 };
00106
00107 #endif // vil1_memory_image_impl_h_