00001
00002 #ifndef vil1_memory_image_h_
00003 #define vil1_memory_image_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
00020 #include <vil1/vil1_pixel.h>
00021 #include <vil1/vil1_image.h>
00022
00023
00024 struct vil1_memory_image_format
00025 {
00026 int components;
00027 int bits_per_component;
00028 vil1_component_format component_format;
00029 };
00030
00031
00032 class vil1_memory_image : public vil1_image
00033 {
00034 public:
00035 vil1_memory_image();
00036 vil1_memory_image(int planes, int w, int h, vil1_memory_image_format const&);
00037 vil1_memory_image(int planes, int w, int h, int components, int bits_per_component, vil1_component_format);
00038 vil1_memory_image(int planes, int w, int h, vil1_pixel_format_t);
00039 vil1_memory_image(int w, int h, int components, int bits_per_component, vil1_component_format);
00040 vil1_memory_image(int w, int h, vil1_pixel_format_t );
00041
00042 vil1_memory_image(vil1_image const &);
00043 vil1_memory_image(vil1_memory_image const&);
00044
00045 vil1_memory_image& operator=(vil1_memory_image const&);
00046
00047 void resize(int width, int height);
00048 void resize(int planes, int width, int height);
00049 inline void* get_buffer() { return rows0_[0]; }
00050
00051 vil1_memory_image(void *buf, int planes, int w, int h, vil1_memory_image_format const&);
00052 vil1_memory_image(void *buf, int planes, int w, int h, int components, int bits_per_component, vil1_component_format);
00053 vil1_memory_image(void *buf, int planes, int w, int h, vil1_pixel_format_t);
00054 vil1_memory_image(void *buf, int w, int h, int components, int bits_per_component, vil1_component_format);
00055 vil1_memory_image(void *buf, int w, int h, vil1_pixel_format_t );
00056
00057
00058
00059 int width () const { return width_ ; }
00060 int height() const { return height_; }
00061
00062 void assert_size(int width, int height) const;
00063
00064
00065
00066 void recache_from_impl();
00067 protected:
00068
00069 int width_;
00070 int height_;
00071 void ** rows0_;
00072 };
00073
00074 #endif // vil1_memory_image_h_