3 #include "HeatmapShapes.h"
26 int GetWidth()
const {
return m_width; }
27 int GetHeight()
const {
return m_height; }
28 const std::vector<float>& GetImageData()
const {
return m_imageData; }
30 inline float GetPixel(
int x,
int y)
const;
31 inline void SetPixel(
int x,
int y,
float value);
32 inline bool Contains(
int x,
int y)
const;
33 void Fill(
float value);
36 void Multiply(
float value);
37 void MultiplyAdd(
float scale,
float sum);
38 float GetPixelAtIndex(
int index)
const {
return m_imageData[index]; }
39 inline int IndexOf(
int x,
int y)
const;
40 void SetPixelAtIndex(
int index,
float value) { m_imageData[index] = value; }
41 void SumPixelAtIndex(
int index,
float value) { m_imageData[index] += value; }
47 std::vector<float> m_imageData;
50 inline float HeatmapImage::GetPixel(
int x,
int y)
const
52 const int index = IndexOf(x, y);
53 return m_imageData[index];
56 inline void HeatmapImage::SetPixel(
int x,
int y,
float value)
58 const int index = IndexOf(x, y);
59 m_imageData[index] = value;
62 inline bool HeatmapImage::Contains(
int x,
int y)
const
64 return x >= 0 && x < m_width && y >= 0 && y < m_height;
67 inline int HeatmapImage::IndexOf(
int x,
int y)
const
73 return (y*m_width) + x;