00001 #ifndef _DLIMAGEHEAD_H_ 00002 #define _DLIMAGEHEAD_H_ 00003 00004 #include "DLTagList.h" 00005 #include "DLConst.h" 00006 #include "DLColor.h" 00007 00014 class DLImageHead 00015 { 00016 public: 00020 DLImageHead(); 00021 00025 DLImageHead(const DLImageHead & orig); 00026 00030 enum DLBitDepths 00031 { 00032 DL_BITDEPTH_UNKNOWN = -1, 00033 DL_BITDEPTH_1 = 1, 00034 DL_BITDEPTH_8 = 8, 00035 DL_BITDEPTH_24 = 24 00036 }; 00037 00041 enum DLDataAlignments 00042 { 00043 DL_UNKNOWN_ALIGN = -1, 00044 DL_1BYTE_ALIGN = 1, 00045 DL_4BYTE_ALIGN = 4 00046 }; 00047 00052 const DLImageHead & operator=(const DLImageHead & right); 00053 00057 virtual ~DLImageHead(); 00058 00062 DLTagList imageTags; 00063 00065 int width; 00066 00068 int height; 00069 00078 DLBitDepths depth; 00079 00084 int channels; 00085 00095 DLColor::DLColorTypes colorModel; 00096 00100 int rowSize; 00101 00109 DLDataAlignments dataAlignment; 00110 00112 int dataOrder; 00113 00117 float horizontalResolution; 00118 00122 float verticalResolution; 00123 00132 bool resolutionFlag; 00133 00135 int dlGetRowSize() const { 00136 00137 int lrowSize = 0; 00138 if (depth == DL_BITDEPTH_8) 00139 lrowSize = width; 00140 else if (depth == DL_BITDEPTH_24) 00141 lrowSize = width * 3; 00142 else if (depth == DL_BITDEPTH_1) 00143 lrowSize = (width + 7)/8; 00144 00145 return lrowSize; 00146 }; 00147 00148 };//end class 00149 00150 #endif //_DLIMAGEHEAD_H_