libimage  0.25.4
 All Classes Namespaces Files Functions Variables Enumerations Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ReprojectedImage Class Reference

#include <ReprojectedImage.h>

Inheritance diagram for ReprojectedImage:
Inheritance graph
Collaboration diagram for ReprojectedImage:
Collaboration graph

Public Member Functions

 ReprojectedImage (Image *image, BoundingBox< double > bbox, Grid *grid, Interpolation::KernelType KT=Interpolation::LANCZOS_2, bool bMask=false)
 Create a ReprojectedImage object, from all attributes, except resolutions (calculated)
 ReprojectedImage (Image *image, BoundingBox< double > bbox, double resx, double resy, Grid *grid, Interpolation::KernelType KT=Interpolation::LANCZOS_2, bool bMask=false)
 Create a ReprojectedImage object, from all attributes.
void initialize ()
 Initialize calculation's buffers.
int getline (float *buffer, int line)
int getline (uint8_t *buffer, int line)
int getline (uint16_t *buffer, int line)
 ~ReprojectedImage ()
 Default destructor.
void print ()
 Reprojected image description output.
- Public Member Functions inherited from Image
void makeMask ()
 Define the image as a mask.
int getWidth ()
 Return the image's width.
int getHeight ()
 Return the image's height.
void setBbox (BoundingBox< double > box)
 Define the image's bounding box and calculate resolutions.
bool setDimensions (int w, int h, BoundingBox< double > box, double rx, double ry)
 Define the image's bounding box and calculate resolutions.
BoundingBox< double > getBbox () const
 Return the image's bounding box.
void setCRS (CRS srs)
 Define the CRS of the image's bounding box.
CRS getCRS () const
 Return the image's bounding box's CRS.
double getXmin () const
 Return bounding box's xmin.
double getYmax () const
 Return bounding box's ymax.
double getXmax () const
 Return bounding box's xmax.
double getYmin () const
 Return bounding box's ymin.
double getResX () const
 Return the X wise resolution.
double getResY () const
 Return the Y wise resolution.
ImagegetMask ()
 Return the associated mask.
bool setMask (Image *newMask)
 Defined data mask and check consistency.
int x2c (double x)
 Conversion from terrain coordinate X to image column indice.
int y2l (double y)
 Conversion from terrain coordinate Y to image line indice.
double c2x (int c)
 Conversion from image column indice to terrain coordinate X (pixel's center)
double l2y (int l)
 Conversion from image line indice to terrain coordinate X (pixel's center)
double getPhaseX ()
 Phasis calculation, X wise.
double getPhaseY ()
 Phasis calculation, Y wise.
bool isCompatibleWith (Image *pImage)
 Determine compatibility with another image, comparing CRS, phasis and resolutions.
 Image (int width, int height, int channels, double resx, double resy, BoundingBox< double > bbox)
 Create an Image object, from all attributes.
 Image (int width, int height, int channels)
 Create an Image without providing georeferencement, neither resolutions nor bounding box.
 Image (int width, int height, int channels, BoundingBox< double > bbox)
 Create an Image without providing resolutions.
 Image (int width, int height, int channels, double resx, double resy)
 Create an Image object without providing bbox.
virtual ~Image ()
 Default destructor.
virtual void printTFW ()
 Image TFW output.

Private Member Functions

float * computeDestLine (int line)
int getSourceLineIndex (int line)

Private Attributes

ImagesourceImage
 Source image, to resample.
bool useMask
 Precise if mask have to be used by interpolation (heavy)
const KernelK
 Interpolation kernel to use.
int Kx
 Number of source pixels used by interpolation, widthwise.
int Ky
 Number of source pixels used by interpolation, heightwise.
double ratioX
 Ratio between destination resolution and source resolution, widthwise.
double ratioY
 Ratio between destination resolution and source resolution, heighthwise.
Gridgrid
 Reprojection grid.
float * __buffer
 Global buffer.
int memorizedLines
 Number of memorized source lines, for image and mask.
int * src_line_index
 Memorized source lines indexing.
float ** src_image_buffer
 Image source lines storage buffer.
float ** src_mask_buffer
 Mask source lines storage buffer.
int dst_line_index
 Reprojected lines indexing.
float * dst_image_buffer [4]
 4 completly reprojected image lines
float * mux_dst_image_buffer
 4 completly reprojected image lines, multiplexed
float * dst_mask_buffer [4]
 4 completly reprojected mask lines
float * mux_dst_mask_buffer
 4 completly reprojected mask lines, multiplexed
float * X [4]
 X coordinate, in source pixel, of the line to reproject.
float * Y [4]
 Y coordinate, in source pixel, of the line to reproject.
float * Wx [1024]
 Pre-calculated weights, X wise.
float * Wy [1024]
 Pre-calculated weights, Y wise.
float * WWx
 X wise weights use to calculate the 4 pixels in progress, multiplexed.
float * WWy
 Y wise weights use to calculate the 4 pixels in progress, multiplexed.
int xmin [1024]
 First usefull source pixels, X wise, pre-calculated.
int ymin [1024]
 First usefull source pixels, Y wise, pre-calculated.
float * tmp1Img
 Source pixels to use to calculate the 4 pixels in progress, multiplexed.
float * tmp2Img
 4 pixels, X wise interpolated, multiplexed
float * tmp1Msk
 Source mask's pixels to use to calculate the 4 pixels in progress, multiplexed.
float * tmp2Msk
 4 mask pixels, X wise interpolated, multiplexed

Additional Inherited Members

- Static Public Member Functions inherited from Image
static bool dimensionsAreConsistent (double resolution_x, double resolution_y, int w, int h, BoundingBox< double > bounding_box)
 Check provided dimensions' consistency.
- Public Attributes inherited from Image
const int channels
 Number of samples per pixel.
- Protected Member Functions inherited from Image
void computeResolutions ()
 Resolutions calculation, from pixel size and bounding box.
- Protected Attributes inherited from Image
int width
 Image's width, in pixel.
int height
 Image's height, in pixel.
bool isMask
 Is this image a mask ?
BoundingBox< double > bbox
 Image's bounding box.
CRS crs
 Bounding box's CRS.
Imagemask
 Mask associated to the image, optionnal.
double resx
 Image's resolution, X wise.
double resy
 Image's resolution, Y wise.

Detailed Description

Author
Institut national de l'information géographique et forestière

Constructor & Destructor Documentation

ReprojectedImage::ReprojectedImage ( Image image,
BoundingBox< double >  bbox,
Grid grid,
Interpolation::KernelType  KT = Interpolation::LANCZOS_2,
bool  bMask = false 
)
inline

Create a ReprojectedImage object, from all attributes, except resolutions (calculated)

Parameters
[in]imagesource image
[in]bboxreprojected image bounding box
[in]gridreprojecting grid to use
[in]KTinterpolation kernel to use for reprojecting
[in]bUseMaskprecise if reprojecting use masks

Here is the call graph for this function:

ReprojectedImage::ReprojectedImage ( Image image,
BoundingBox< double >  bbox,
double  resx,
double  resy,
Grid grid,
Interpolation::KernelType  KT = Interpolation::LANCZOS_2,
bool  bMask = false 
)
inline

Create a ReprojectedImage object, from all attributes.

Parameters
[in]imagesource image
[in]bboxreprojected image bounding box
[in]resxX wise resolution
[in]resyY wise resolution
[in]gridreprojecting grid to use
[in]KTinterpolation kernel to use for reprojecting
[in]bUseMaskprecise if reprojecting use masks

Here is the call graph for this function:

ReprojectedImage::~ReprojectedImage ( )
inline

Default destructor.

Desallocate global :

And remove sourceImage

Member Data Documentation

float* ReprojectedImage::__buffer
private

Global buffer.

Contains:

  • widthwise source lines memorization buffers (image and mask)
  • intermediate calculation buffers (image and mask)
  • weights' buffer
  • index buffer
Grid* ReprojectedImage::grid
private

Reprojection grid.

The grid is used to know corresponding pixel in the source image.

double ReprojectedImage::ratioX
private

Ratio between destination resolution and source resolution, widthwise.

X ratio = X destination resolution / X source resolution

double ReprojectedImage::ratioY
private

Ratio between destination resolution and source resolution, heighthwise.

Y ratio = Y destination resolution / Y source resolution

float** ReprojectedImage::src_image_buffer
private

Image source lines storage buffer.

We store memorizedLines lines

int* ReprojectedImage::src_line_index
private

Memorized source lines indexing.

To convert source image line (widthwise resampled) indice to memorized line indice (in #resampled_image and #resampled_mask).

float** ReprojectedImage::src_mask_buffer
private

Mask source lines storage buffer.

We store memorizedLines lines


The documentation for this class was generated from the following files: