#ifndef FILTER_H
#define FILTER_H

#include "bitmap_8bit.h"

typedef struct {
  int x;
  int y;
} Point2D;

typedef struct {
  
  Point2D origin;
  int width;
  int height;
  int isAverage;
  double *mask;
 
} Filter;


// ----- SPATIAL FILTERS --------

/*
 *     
 * Note:
 * isAverage: TRUE, if final value of point is average, not the sum of masked
 *                  values.
 */

Filter *createFilter(Point2D origin, int width, int height, 
		     int isAverage, double *mask);

Bitmap_8bit * applyFilter(Bitmap_8bit *source, Filter *filter);

void printFilter(Filter *f);



// --- MEDIAN FILTERING ---

Bitmap_8bit *applyMedianFilter(Bitmap_8bit * source);


#endif

