dcmimage/include/dcmtk/dcmimage/diqtpbox.h

00001 /*
00002  *
00003  *  Copyright (C) 2002-2010, OFFIS e.V.
00004  *  All rights reserved.  See COPYRIGHT file for details.
00005  *
00006  *  This software and supporting documentation were developed by
00007  *
00008  *    OFFIS e.V.
00009  *    R&D Division Health
00010  *    Escherweg 2
00011  *    D-26121 Oldenburg, Germany
00012  *
00013  *
00014  *  Module:  dcmimage
00015  *
00016  *  Author:  Marco Eichelberg
00017  *
00018  *  Purpose: class DcmQuantPixelBoxArray
00019  *
00020  *  Last Update:      $Author: joergr $
00021  *  Update Date:      $Date: 2010-10-14 13:16:30 $
00022  *  CVS/RCS Revision: $Revision: 1.6 $
00023  *  Status:           $State: Exp $
00024  *
00025  *  CVS/RCS Log at end of file
00026  *
00027  */
00028 
00029 
00030 #ifndef DIQTPBOX_H
00031 #define DIQTPBOX_H
00032 
00033 
00034 #include "dcmtk/config/osconfig.h"
00035 
00036 #define INCLUDE_CSTDLIB
00037 #define INCLUDE_CASSERT
00038 #include "dcmtk/ofstd/ofstdinc.h"
00039 
00040 BEGIN_EXTERN_C
00041 #ifdef HAVE_SYS_TYPES_H
00042 /* needed e.g. on Solaris for definition of size_t */
00043 #include <sys/types.h>
00044 #endif
00045 END_EXTERN_C
00046 
00051 struct DcmQuantPixelBox
00052 {
00054   int ind;
00055 
00057   int colors;
00058 
00060   unsigned long sum;
00061 };
00062 
00063 
00065 typedef DcmQuantPixelBox *DcmQuantPixelBoxPointer;
00066 
00067 
00073 class DcmQuantPixelBoxArray
00074 {
00075 public:
00076 
00080   DcmQuantPixelBoxArray(unsigned long entries);
00081 
00083   ~DcmQuantPixelBoxArray();
00084 
00090   inline DcmQuantPixelBox& operator[](size_t idx)
00091   {
00092 #ifdef DEBUG
00093     assert(idx < length);
00094 #endif
00095     return *(array[idx]);
00096   }
00097 
00103   void sort(unsigned long boxes);
00104 
00105 private:
00106 
00108   DcmQuantPixelBoxArray(const DcmQuantPixelBoxArray& src);
00109 
00111   DcmQuantPixelBoxArray& operator=(const DcmQuantPixelBoxArray& src);
00112 
00114   DcmQuantPixelBoxPointer *array;
00115 
00117   unsigned long length;
00118 };
00119 
00120 
00121 #endif
00122 
00123 
00124 /*
00125  * CVS/RCS Log:
00126  * $Log: diqtpbox.h,v $
00127  * Revision 1.6  2010-10-14 13:16:30  joergr
00128  * Updated copyright header. Added reference to COPYRIGHT file.
00129  *
00130  * Revision 1.5  2009-08-19 14:45:30  meichel
00131  * Added additional includes needed for Sun Studio 11 on Solaris.
00132  *
00133  * Revision 1.4  2005-12-08 16:01:52  meichel
00134  * Changed include path schema for all DCMTK header files
00135  *
00136  * Revision 1.3  2003/12/23 12:19:10  joergr
00137  * Updated copyright header.
00138  *
00139  * Revision 1.2  2002/11/27 14:16:56  meichel
00140  * Adapted module dcmimage to use of new header file ofstdinc.h
00141  *
00142  * Revision 1.1  2002/01/25 13:32:06  meichel
00143  * Initial release of new color quantization classes and
00144  *   the dcmquant tool in module dcmimage.
00145  *
00146  *
00147  */


Generated on 6 Jan 2011 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.5.1