diqthash.h

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 DcmQuantColorHashTable
00023  *
00024  *  Last Update:      $Author: meichel $
00025  *  Update Date:      $Date: 2005/12/08 16:01:47 $
00026  *  CVS/RCS Revision: $Revision: 1.3 $
00027  *  Status:           $State: Exp $
00028  *
00029  *  CVS/RCS Log at end of file
00030  *
00031  */
00032 
00033 
00034 #ifndef DIQTHASH_H
00035 #define DIQTHASH_H
00036 
00037 
00038 #include "dcmtk/config/osconfig.h"
00039 #include "dcmtk/dcmimage/diqtpix.h"   /* for DcmQuantPixel */
00040 #include "dcmtk/dcmimage/diqthitl.h"  /* for DcmQuantHistogramItemList */
00041 
00042 
00043 class DicomImage;
00044 
00045 
00051 class DcmQuantColorHashTable
00052 {
00053 public: 
00055   DcmQuantColorHashTable(); 
00056 
00058   ~DcmQuantColorHashTable(); 
00059 
00065   inline void add(const DcmQuantPixel& colorP, int value)
00066   {
00067     table[colorP.hash()]->push_front(colorP, value);
00068   }
00069 
00075   inline int lookup(const DcmQuantPixel& colorP) const
00076   {
00077     return table[colorP.hash()]->lookup(colorP);  
00078   }
00079 
00093   unsigned long addToHashTable(
00094     DicomImage& image, 
00095     unsigned long newmaxval,
00096     unsigned long maxcolors);
00097 
00101   unsigned long countEntries() const;
00102 
00111   unsigned long createHistogram(DcmQuantHistogramItemPointer *& array);
00112 
00113 private:
00114 
00116   DcmQuantColorHashTable(const DcmQuantColorHashTable& src);
00117 
00119   DcmQuantColorHashTable& operator=(const DcmQuantColorHashTable& src);
00120 
00122   DcmQuantHistogramItemListPointer *table;
00123 };
00124 
00125 
00126 #endif
00127 
00128 
00129 /*
00130  * CVS/RCS Log:
00131  * $Log: diqthash.h,v $
00132  * Revision 1.3  2005/12/08 16:01:47  meichel
00133  * Changed include path schema for all DCMTK header files
00134  *
00135  * Revision 1.2  2003/12/23 12:17:26  joergr
00136  * Updated copyright header.
00137  *
00138  * Revision 1.1  2002/01/25 13:32:05  meichel
00139  * Initial release of new color quantization classes and
00140  *   the dcmquant tool in module dcmimage.
00141  *
00142  *
00143  */


Generated on 20 Dec 2005 for OFFIS DCMTK Version 3.5.4 by Doxygen 1.4.5