00001 #ifndef SLIDE_H
00002 #define SLIDE_H
00003
00004 #include "data.h"
00005 #include "transfunc.h"
00006
00007
00008 #define CLAMP0255(x) x = ((x < 0) ? 0 : ((x < 255) ? x : 255))
00009
00010
00011 class Slice {
00012 private:
00013 int m_depth;
00014 int m_type;
00015 int m_x, m_y;
00016 int m_width, m_height;
00017 rgb *slice_data;
00018
00019 bool m_bZoom;
00020 bool m_bUseTransfer;
00021 int m_dSliceNumber;
00022 Transfunc *m_tTransferfunction;
00023
00024
00025 public:
00026
00027 enum { XY, XZ, YZ };
00028
00029 Slice();
00030 ~Slice();
00031 bool SetType(int tp);
00032 int GetType();
00033
00034 int GetSliceNumber(Data *dat = NULL);
00035
00036 void SetTransferfunction(Transfunc *transferfunction) { m_tTransferfunction = transferfunction; }
00037 bool SetPixels(Data *dat, int dp) { return SetPixels(m_tTransferfunction, dat, dp == -1 ? m_depth : dp); }
00038
00039 void SetZoom(bool zoom) { m_bZoom = zoom; }
00040 bool GetZoom() { return m_bZoom; }
00041
00042 void SetTransfer(bool transfer) { m_bUseTransfer = transfer; }
00043 bool GetTransfer() { return m_bUseTransfer; }
00044 bool SetPixels(Transfunc *tf, Data *dat, int dp);
00045 bool DrawSlice(int width, int height);
00046
00047 void GetImageInfo(int &width, int &height, int &x, int &y, int &plane, int &depth);
00048 rgb *GetScreenShotImage(int &width, int &height) { width = m_width;
00049 height = m_height;
00050 return slice_data; };
00051 };
00052
00053 #endif