diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-01-19 13:44:59 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-01-19 13:44:59 (GMT) |
| commit | 44639a6423c03552a3c0faafab27ef8f395f73a6 (patch) | |
| tree | 1a4fc49a56060759fcbec6f18e9159cf126e8606 /src/search/Thumbnail.h | |
| parent | 4a60b97c700c2f1843b7e99313554cb89fb5da4e (diff) | |
| download | powder-44639a6423c03552a3c0faafab27ef8f395f73a6.zip powder-44639a6423c03552a3c0faafab27ef8f395f73a6.tar.gz | |
Some folder changes, started search and client
Diffstat (limited to 'src/search/Thumbnail.h')
| -rw-r--r-- | src/search/Thumbnail.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/search/Thumbnail.h b/src/search/Thumbnail.h new file mode 100644 index 0000000..3b865ca --- /dev/null +++ b/src/search/Thumbnail.h @@ -0,0 +1,49 @@ +#ifndef THUMBNAIL_H +#define THUMBNAIL_H + +#include "Graphics.h" +#include "interface/Point.h" + +class Thumbnail +{ +public: + Thumbnail(const Thumbnail & thumb): + ID(thumb.ID), + Datestamp(thumb.Datestamp), + Data(thumb.Data), + Size(thumb.Size) + { + //Ensure the actual thumbnail data is copied + if(thumb.Data) + { + Data = (pixel *)malloc((thumb.Size.X*thumb.Size.Y) * PIXELSIZE); + memcpy(Data, thumb.Data, (thumb.Size.X*thumb.Size.Y) * PIXELSIZE); + } + else + { + Data = NULL; + } + } + + Thumbnail(int _id, int _datestamp, pixel * _data, ui::Point _size): + ID(_id), + Datestamp(_datestamp), + Data(_data), + Size(_size) + { + } + + ~Thumbnail() + { + if(Data) + { + free(Data); + } + } + + int ID, Datestamp; + ui::Point Size; + pixel * Data; +}; + +#endif // THUMBNAIL_H |
