+#ifndef HEAT_IMAGE_H
+#define HEAT_IMAGE_H
+
+/*
+ * Une classe représentant une image de float.
+ */
+class HeatImage
+ {
+ public:
+ HeatImage(int w, int h, float* image = 0);
+ ~HeatImage();
+
+ inline void clear()
+ {
+ memset(this->image, 0, this->w * this->h * sizeof(float));
+ }
+
+ __device__
+ inline void setCuda(int x, int y, float value)
+ {
+ this->image[x + this->w * y] = value;
+ }
+
+ inline void set(int x, int y, float value)
+ {
+ this->image[x + this->w * y] = value;
+ }
+
+ __device__
+ inline float getCuda(int x, int y)
+ {
+ return this->image[x + this->w * y];
+ }
+
+ __device__
+ inline int getWCuda()
+ {
+ return this->w;
+ }
+
+ inline int getW()
+ {
+ return this->w;
+ }
+
+ __device__
+ inline int getHCuda()
+ {
+ return this->h;
+ }
+
+ inline int getH()
+ {
+ return this->h;
+ }
+
+ inline void swapWith(HeatImage& other)
+ {
+ float* tmp = this->image;
+ this->image = other.image;
+ other.image = tmp;
+ }
+
+ inline float*& getRaw() { return this->image; }
+ inline void setRaw(float* image) { this->image = image; }
+
+ private:
+ int w, h;
+ float* image;
+ };
+
+
+#endif