Functions

memoryAllocation.cpp File Reference

#include "memoryAllocation.h"

Functions

void releaseImage (void *image)
float * allocateImage_32f_C1 (int width, int height, int *widthStep)
WRESULT allocateSubbands (float *subbands[], int widthSteps[], int level, int filter_length_L, int filter_length_H, Size size)
WRESULT releaseSubbands (float *subbands[], int level)

Function Documentation

float* allocateImage_32f_C1 ( int  width,
int  height,
int *  widthStep 
)

The function allocates an image as a *widthStep x height x sizeof(float) byte block of memory. In the memory the beginning of each row is 16 byte aligned.

Parameters:
[in] width - the width of image in pixels
[in] height - the height of image in pixels
[in,out] *widthStep - the number of bytes between two conscutive rows
Returns:
pointer to the beginning of allocated block of memory
See also:
releaseImage
allocateSubbands
releaseSubbands
WRESULT allocateSubbands ( float *  subbands[],
int  widthSteps[],
int  level,
int  filter_length_L,
int  filter_length_H,
Size  size 
)

The function allocates (3xlevels+1) blocks of memory to hold individual subbands. The order of the subbands is the following: subbands[0]=HL1,[1]=HH1,[2]=LH1,[3]=HL2,[4]=HH2,[5]=LH2 .... [last]=LL. The dimensions of the subbands are:

\[ n_\mathrm{x}(s,m,j) = \mathrm{floor}( 2^{-j}s_\mathrm{x} + (1-2^{-j}(m-1)) \]

and

\[ n_\mathrm{y}(s,m,j) = \mathrm{floor}( 2^{-j}s_\mathrm{y} + (1-2^{-j}(m-1)), \]

přičemž

  • $ s,s_x,s_y $ are dimensions of the input image in pixels,
  • $ j $ denotes the depth of decomposition,
  • $ m $ is the length of used filters.
Parameters:
[in,out] *subbands[] - array holding ponters to the individual subbands
[in,out] widthSteps[] - array holding the distance between two consecutive rows in bytes in individual subbands
[in] level - the depth of decomposition
[in] filter_length_L - the length of analysing lowpass filter
[in] filter_length_H - the length of analysing highpass filter
[in] size - the dimensions of input images in pixels
Returns:
stavový kód WRESULT
See also:
releaseImage
releaseSubbands
segDTWTfwd_32f_C1
segDTWTinv_32f_C1
void releaseImage ( void *  image  ) 

The function frees the memory allocated by the function allocateImage_32f_C1

Parameters:
[in] *image - pointer to memoty to be freed
See also:
allocateImage_32f_C1
allocateSubbands
releaseSubbands
WRESULT releaseSubbands ( float *  subbands[],
int  level 
)

Funkce frees memory allocated by the function allocateSubbands.

Parameters:
[in] * subbands[] - array holding ponters to the individual subbands
[in] level - the depth of decomposition
Returns:
stavový kód WRESULT
See also:
allocateSubbands
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines