10 # include <vcl_msvc_warnings.h> 14 static float scale_at_level(
unsigned level)
18 float s = std::pow(2.0f, -static_cast<float>(level));
88 unsigned max_dim = this->
ni(),
nj = this->
nj();
94 double scale = max_dim/1000.0;
97 double lscale = std::log(scale);
98 unsigned nlev = static_cast<unsigned>(lscale/std::log(2.0));
105 unsigned j0,
unsigned n_j,
106 unsigned level)
const 112 double s = scale_at_level(level);
113 double factor = static_cast<unsigned>(1/s);
122 unsigned j0,
unsigned n_j,
124 float& actual_scale)
const 131 float f_lev = -std::log(scale)/std::log(2.0f);
132 unsigned level = static_cast<unsigned>(f_lev);
135 actual_scale = scale_at_level(level);
virtual vil_image_view_base_sptr get_copy_view_decimated_j2k(unsigned i0, unsigned ni, unsigned j0, unsigned nj, double i_factor, double j_factor) const
enum vil_pixel_format pixel_format() const override
Pixel Format.
virtual void print(const unsigned level)
for debug purposes.
Representation of a pyramid resolution hierarchy based on JPEG2000 NITF image.
vil_image_resource_sptr nitf2_sptr_
unsigned ni() const override
Dimensions: Planes x ni x nj.
virtual unsigned nplanes() const
The number of planes (or components) in the image.
bool is_jpeg_2000_compressed() const
virtual unsigned nlevels() const
Number of pyramid levels.
virtual char const * file_format() const
Return a string describing the file format.
vil_image_view_base_sptr get_copy_view() const
Create a read/write view of a copy of all the data.
unsigned nplanes() const override
return the image info of the current image.
virtual vil_image_resource_sptr get_resource(const unsigned level) const
Get an image resource from the pyramid at the specified level.
virtual enum vil_pixel_format pixel_format() const
Pixel Format.
vil_j2k_nitf2_pyramid_image_resource()
T * ptr() const
These methods all return the raw/dumb pointer.
virtual unsigned nj() const
The number of pixels in each column.
virtual unsigned ni() const
The number of pixels in each row.
unsigned nj() const override
Dimensions: Planes x ni x nj.