00001 /* 00002 * 00003 * Copyright (C) 2002-2005, OFFIS 00004 * 00005 * This software and supporting documentation were developed by 00006 * 00007 * Kuratorium OFFIS e.V. 00008 * Healthcare Information and Communication Systems 00009 * Escherweg 2 00010 * D-26121 Oldenburg, Germany 00011 * 00012 * THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND OFFIS MAKES NO WARRANTY 00013 * REGARDING THE SOFTWARE, ITS PERFORMANCE, ITS MERCHANTABILITY OR 00014 * FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES OR 00015 * ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND 00016 * PERFORMANCE OF THE SOFTWARE IS WITH THE USER. 00017 * 00018 * Module: dcmimage 00019 * 00020 * Author: Marco Eichelberg 00021 * 00022 * Purpose: class DcmQuantPixelBoxArray 00023 * 00024 * Last Update: $Author: meichel $ 00025 * Update Date: $Date: 2005/12/08 16:01:52 $ 00026 * CVS/RCS Revision: $Revision: 1.4 $ 00027 * Status: $State: Exp $ 00028 * 00029 * CVS/RCS Log at end of file 00030 * 00031 */ 00032 00033 00034 #ifndef DIQTPBOX_H 00035 #define DIQTPBOX_H 00036 00037 00038 #include "dcmtk/config/osconfig.h" 00039 00040 #define INCLUDE_CSTDLIB 00041 #define INCLUDE_CASSERT 00042 #include "dcmtk/ofstd/ofstdinc.h" 00043 00044 00049 struct DcmQuantPixelBox 00050 { 00052 int ind; 00053 00055 int colors; 00056 00058 unsigned long sum; 00059 }; 00060 00061 00063 typedef DcmQuantPixelBox *DcmQuantPixelBoxPointer; 00064 00065 00071 class DcmQuantPixelBoxArray 00072 { 00073 public: 00074 00078 DcmQuantPixelBoxArray(unsigned long entries); 00079 00081 ~DcmQuantPixelBoxArray(); 00082 00088 inline DcmQuantPixelBox& operator[](size_t idx) 00089 { 00090 #ifdef DEBUG 00091 assert(idx < length); 00092 #endif 00093 return *(array[idx]); 00094 } 00095 00101 void sort(unsigned long boxes); 00102 00103 private: 00104 00106 DcmQuantPixelBoxArray(const DcmQuantPixelBoxArray& src); 00107 00109 DcmQuantPixelBoxArray& operator=(const DcmQuantPixelBoxArray& src); 00110 00112 DcmQuantPixelBoxPointer *array; 00113 00115 unsigned long length; 00116 }; 00117 00118 00119 #endif 00120 00121 00122 /* 00123 * CVS/RCS Log: 00124 * $Log: diqtpbox.h,v $ 00125 * Revision 1.4 2005/12/08 16:01:52 meichel 00126 * Changed include path schema for all DCMTK header files 00127 * 00128 * Revision 1.3 2003/12/23 12:19:10 joergr 00129 * Updated copyright header. 00130 * 00131 * Revision 1.2 2002/11/27 14:16:56 meichel 00132 * Adapted module dcmimage to use of new header file ofstdinc.h 00133 * 00134 * Revision 1.1 2002/01/25 13:32:06 meichel 00135 * Initial release of new color quantization classes and 00136 * the dcmquant tool in module dcmimage. 00137 * 00138 * 00139 */