dcmimage/include/dcmtk/dcmimage/diqthash.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 DcmQuantColorHashTable
00019  *
00020  *  Last Update:      $Author: joergr $
00021  *  Update Date:      $Date: 2010-10-14 13:16:29 $
00022  *  CVS/RCS Revision: $Revision: 1.4 $
00023  *  Status:           $State: Exp $
00024  *
00025  *  CVS/RCS Log at end of file
00026  *
00027  */
00028 
00029 
00030 #ifndef DIQTHASH_H
00031 #define DIQTHASH_H
00032 
00033 
00034 #include "dcmtk/config/osconfig.h"
00035 #include "dcmtk/dcmimage/diqtpix.h"   /* for DcmQuantPixel */
00036 #include "dcmtk/dcmimage/diqthitl.h"  /* for DcmQuantHistogramItemList */
00037 
00038 
00039 class DicomImage;
00040 
00041 
00047 class DcmQuantColorHashTable
00048 {
00049 public: 
00051   DcmQuantColorHashTable(); 
00052 
00054   ~DcmQuantColorHashTable(); 
00055 
00061   inline void add(const DcmQuantPixel& colorP, int value)
00062   {
00063     table[colorP.hash()]->push_front(colorP, value);
00064   }
00065 
00071   inline int lookup(const DcmQuantPixel& colorP) const
00072   {
00073     return table[colorP.hash()]->lookup(colorP);  
00074   }
00075 
00089   unsigned long addToHashTable(
00090     DicomImage& image, 
00091     unsigned long newmaxval,
00092     unsigned long maxcolors);
00093 
00097   unsigned long countEntries() const;
00098 
00107   unsigned long createHistogram(DcmQuantHistogramItemPointer *& array);
00108 
00109 private:
00110 
00112   DcmQuantColorHashTable(const DcmQuantColorHashTable& src);
00113 
00115   DcmQuantColorHashTable& operator=(const DcmQuantColorHashTable& src);
00116 
00118   DcmQuantHistogramItemListPointer *table;
00119 };
00120 
00121 
00122 #endif
00123 
00124 
00125 /*
00126  * CVS/RCS Log:
00127  * $Log: diqthash.h,v $
00128  * Revision 1.4  2010-10-14 13:16:29  joergr
00129  * Updated copyright header. Added reference to COPYRIGHT file.
00130  *
00131  * Revision 1.3  2005/12/08 16:01:47  meichel
00132  * Changed include path schema for all DCMTK header files
00133  *
00134  * Revision 1.2  2003/12/23 12:17:26  joergr
00135  * Updated copyright header.
00136  *
00137  * Revision 1.1  2002/01/25 13:32:05  meichel
00138  * Initial release of new color quantization classes and
00139  *   the dcmquant tool in module dcmimage.
00140  *
00141  *
00142  */


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