1 #ifndef vil_pyramid_image_list_h_ 2 #define vil_pyramid_image_list_h_ 16 # include <vcl_msvc_warnings.h> 30 char const*
tag()
const override {
return "pyil";}
52 char const* level_file_format,
53 char const* filename)
override;
81 void print(
const unsigned int l)
83 std::cout <<
"level[" << l <<
"] scale: " <<
scale_ 84 <<
" ni: " <<
image_->ni() <<
'\n';
99 inline unsigned int nplanes()
const override 102 return levels_[0]->image_->nplanes();
109 inline unsigned int ni()
const override 112 return levels_[0]->image_->ni();
119 inline unsigned int nj()
const override 122 return levels_[0]->image_->nj();
132 return levels_[0]->image_->pixel_format();
142 unsigned int n_j)
const override 145 return levels_[0]->image_->get_copy_view(i0, n_i, j0, n_j);
173 {
if (level<
levels_.size())
return levels_[level]->image_;
else return nullptr; }
177 unsigned int j0,
unsigned int n_j,
178 unsigned int level)
const override;
187 unsigned int j0,
unsigned int n_j,
189 float& actual_scale)
const override;
194 void print(
const unsigned int level)
override 223 #endif // vil_pyramid_image_list_h_
bool add_resource(vil_image_resource_sptr const &image)
Add an image resource directly to the pyramid without copying.
void print(const unsigned int l)
print ni and scale and values.
vil_image_resource_sptr image_
the resource.
unsigned int nplanes() const override
The number of planes (or components) in the image.
enum vil_pixel_format pixel_format() const override
Pixel Format.
Representation of a pyramid resolution hierarchy; mostly pure virtual methods.
float scale_
scale associated with level.
void set_directory(char const *directory)
pyramid_level * closest(const float scale) const
find the image resource with scale closest to specified scale.
unsigned int nj() const override
The number of pixels in each column.
unsigned int cur_level_
the current pyramid level for this resource.
bool put_resource(vil_image_resource_sptr const &image) override
Copy an image resource to the pyramid.
Stream interface for VIL image loaders.
char const * file_format() const override
Return a string describing the file format.
bool is_same_size(vil_image_resource_sptr const &image)
input image is the same size as one already in the pyramid.
pyramid_level(vil_image_resource_sptr const &image)
Representation of a pyramid resolution hierarchy.
float find_next_level(vil_image_resource_sptr const &image)
find the nearest level to the image size.
void normalize_scales()
normalize the scale factors so that the base image scale = 1.0.
vil_image_view_base_sptr get_copy_view() const
Create a read/write view of a copy of all the data.
unsigned int nlevels() const override
number of levels in the pyramid.
~vil_pyramid_image_list() override
vil_image_resource_sptr get_resource(const unsigned int level) const override
virtual method for getting a level of the pyramid.
vil_image_view_base_sptr get_copy_view(unsigned int i0, unsigned int n_i, unsigned int j0, unsigned int n_j) const override
Create a read/write view of a copy of this data.
vil_image_resource_sptr get_level(const unsigned int level) const
Get a level image resource of the pyramid.
unsigned int ni() const override
The number of pixels in each row.
void print(const unsigned int level) override
std::vector< pyramid_level * > levels_
vil_image_view_base_sptr get_copy_view(const float scale, float &actual_scale) const override
Get a view from the image in the pyramid closest to scale.