00001 /* 00002 * 00003 * Copyright (C) 1996-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: dcmimgle 00019 * 00020 * Author: Joerg Riesmeier 00021 * 00022 * Purpose: DicomMonoOutputPixel (Header) 00023 * 00024 * Last Update: $Author: meichel $ 00025 * Update Date: $Date: 2005/12/08 16:47:53 $ 00026 * CVS/RCS Revision: $Revision: 1.18 $ 00027 * Status: $State: Exp $ 00028 * 00029 * CVS/RCS Log at end of file 00030 * 00031 */ 00032 00033 00034 #ifndef DIMOOPX_H 00035 #define DIMOOPX_H 00036 00037 #include "dcmtk/config/osconfig.h" 00038 #include "dcmtk/dcmimgle/diutils.h" 00039 00040 #define INCLUDE_CSTDLIB 00041 #define INCLUDE_CSTDIO 00042 #include "dcmtk/ofstd/ofstdinc.h" 00043 00044 #include "dcmtk/ofstd/ofstream.h" 00045 00046 00047 /*------------------------* 00048 * forward declarations * 00049 *------------------------*/ 00050 00051 class DiMonoPixel; 00052 00053 00054 /*---------------------* 00055 * class declaration * 00056 *---------------------*/ 00057 00060 class DiMonoOutputPixel 00061 { 00062 00063 public: 00064 00072 DiMonoOutputPixel(const DiMonoPixel *pixel, 00073 const unsigned long size, 00074 const unsigned long frame, 00075 const unsigned long max); 00076 00079 virtual ~DiMonoOutputPixel(); 00080 00085 virtual EP_Representation getRepresentation() const = 0; 00086 00091 virtual const void *getData() const = 0; 00092 00097 virtual void *getDataPtr() = 0; 00098 00101 virtual void removeDataReference() = 0; 00102 00107 virtual size_t getItemSize() const = 0; 00108 00115 virtual int writePPM(ostream &stream) const = 0; 00116 00123 virtual int writePPM(FILE *stream) const = 0; 00124 00129 inline unsigned long getCount() const 00130 { 00131 return FrameSize; 00132 } 00133 00142 int isUnused(const unsigned long value); 00143 00144 00145 protected: 00146 00149 virtual void determineUsedValues() = 0; 00150 00151 00153 /*const*/ unsigned long Count; 00155 const unsigned long FrameSize; 00156 00158 Uint8 *UsedValues; 00160 const unsigned long MaxValue; 00161 00162 00163 private: 00164 00165 // --- declarations to avoid compiler warnings 00166 00167 DiMonoOutputPixel(const DiMonoOutputPixel &); 00168 DiMonoOutputPixel &operator=(const DiMonoOutputPixel &); 00169 }; 00170 00171 00172 #endif 00173 00174 00175 /* 00176 * 00177 * CVS/RCS Log: 00178 * $Log: dimoopx.h,v $ 00179 * Revision 1.18 2005/12/08 16:47:53 meichel 00180 * Changed include path schema for all DCMTK header files 00181 * 00182 * Revision 1.17 2004/02/06 11:07:50 joergr 00183 * Distinguish more clearly between const and non-const access to pixel data. 00184 * 00185 * Revision 1.16 2004/01/05 14:52:20 joergr 00186 * Removed acknowledgements with e-mail addresses from CVS log. 00187 * 00188 * Revision 1.15 2003/12/08 18:44:05 joergr 00189 * Removed leading underscore characters from preprocessor symbols (reserved 00190 * symbols). Updated copyright header. 00191 * 00192 * Revision 1.14 2002/11/27 14:08:05 meichel 00193 * Adapted module dcmimgle to use of new header file ofstdinc.h 00194 * 00195 * Revision 1.13 2002/04/16 13:53:11 joergr 00196 * Added configurable support for C++ ANSI standard includes (e.g. streams). 00197 * 00198 * Revision 1.12 2001/06/01 15:49:46 meichel 00199 * Updated copyright header 00200 * 00201 * Revision 1.11 2000/03/08 16:24:19 meichel 00202 * Updated copyright header. 00203 * 00204 * Revision 1.10 2000/02/23 15:12:15 meichel 00205 * Corrected macro for Borland C++ Builder 4 workaround. 00206 * 00207 * Revision 1.9 2000/02/01 10:52:37 meichel 00208 * Avoiding to include <stdlib.h> as extern "C" on Borland C++ Builder 4, 00209 * workaround for bug in compiler header files. 00210 * 00211 * Revision 1.8 1999/10/06 13:41:21 joergr 00212 * Added method to renmoved reference to (internally handles) pixel data. 00213 * 00214 * Revision 1.7 1999/09/17 12:26:52 joergr 00215 * Added/changed/completed DOC++ style comments in the header files. 00216 * 00217 * Revision 1.6 1999/07/23 14:05:55 joergr 00218 * Enhanced handling of corrupted pixel data (wrong length). 00219 * 00220 * Revision 1.5 1999/03/24 17:20:13 joergr 00221 * Added/Modified comments and formatting. 00222 * 00223 * Revision 1.4 1999/02/11 16:37:56 joergr 00224 * Added routine to check whether particular grayscale values are unused in 00225 * the output data. 00226 * 00227 * Revision 1.3 1999/02/03 17:30:30 joergr 00228 * Added BEGIN_EXTERN_C and END_EXTERN_C to some C includes. 00229 * 00230 * Revision 1.2 1999/01/20 15:07:02 joergr 00231 * Replaced invocation of getCount() by member variable Count where possible. 00232 * 00233 * Revision 1.1 1998/11/27 15:25:48 joergr 00234 * Added copyright message. 00235 * 00236 * Revision 1.3 1998/05/11 14:53:22 joergr 00237 * Added CVS/RCS header to each file. 00238 * 00239 * 00240 */