#ifndef DISPLACEMENT_H_
#define DISPLACEMENT_H_
/**
 * \file displacement.h
 * \brief a header for displacement.c
 *
 *
 * \ingroup corefiles
 * \date Aug 14, 2009
 * \author: alexander
 */
#ifdef __cplusplus
	extern "C" {
#endif

#include "geometry.h"

#define DISPLACEMENT_FIXED_BITS 8
#define DISPELEM(G12buf, X, Y)  (G12buf)->data[(G12buf)->w * (Y) + (X)]


/**
 * \brief A buffer that stores the displacment packed as the the fixed point
 * */

typedef struct DisplacementBuffer_TAG {
	int h;              /**< Height of the buffer. */
	int w;              /**< Width of the buffer. */
	vector2Ds16 *data;    /**< The data of the displacement vectors. */
} DisplacementBuffer;


DisplacementBuffer *displacementBufferCreate(int h, int w);

void displacementBufferDelete(DisplacementBuffer *toDelete);

#ifdef __cplusplus
	} // 	extern "C"
#endif

#endif  //DISPLACEMENT_H_


