OFFIS DCMTK  Version 3.6.0
diqthash.h
1 /*
2  *
3  * Copyright (C) 2002-2010, OFFIS e.V.
4  * All rights reserved. See COPYRIGHT file for details.
5  *
6  * This software and supporting documentation were developed by
7  *
8  * OFFIS e.V.
9  * R&D Division Health
10  * Escherweg 2
11  * D-26121 Oldenburg, Germany
12  *
13  *
14  * Module: dcmimage
15  *
16  * Author: Marco Eichelberg
17  *
18  * Purpose: class DcmQuantColorHashTable
19  *
20  * Last Update: $Author: joergr $
21  * Update Date: $Date: 2010-10-14 13:16:29 $
22  * CVS/RCS Revision: $Revision: 1.4 $
23  * Status: $State: Exp $
24  *
25  * CVS/RCS Log at end of file
26  *
27  */
28 
29 
30 #ifndef DIQTHASH_H
31 #define DIQTHASH_H
32 
33 
34 #include "dcmtk/config/osconfig.h"
35 #include "dcmtk/dcmimage/diqtpix.h" /* for DcmQuantPixel */
36 #include "dcmtk/dcmimage/diqthitl.h" /* for DcmQuantHistogramItemList */
37 
38 
39 class DicomImage;
40 
41 
48 {
49 public:
52 
55 
61  inline void add(const DcmQuantPixel& colorP, int value)
62  {
63  table[colorP.hash()]->push_front(colorP, value);
64  }
65 
71  inline int lookup(const DcmQuantPixel& colorP) const
72  {
73  return table[colorP.hash()]->lookup(colorP);
74  }
75 
89  unsigned long addToHashTable(
90  DicomImage& image,
91  unsigned long newmaxval,
92  unsigned long maxcolors);
93 
97  unsigned long countEntries() const;
98 
107  unsigned long createHistogram(DcmQuantHistogramItemPointer *& array);
108 
109 private:
110 
113 
116 
119 };
120 
121 
122 #endif
123 
124 
125 /*
126  * CVS/RCS Log:
127  * $Log: diqthash.h,v $
128  * Revision 1.4 2010-10-14 13:16:29 joergr
129  * Updated copyright header. Added reference to COPYRIGHT file.
130  *
131  * Revision 1.3 2005/12/08 16:01:47 meichel
132  * Changed include path schema for all DCMTK header files
133  *
134  * Revision 1.2 2003/12/23 12:17:26 joergr
135  * Updated copyright header.
136  *
137  * Revision 1.1 2002/01/25 13:32:05 meichel
138  * Initial release of new color quantization classes and
139  * the dcmquant tool in module dcmimage.
140  *
141  *
142  */
objects of this class represent individual RGB pixels.
Definition: diqtpix.h:44
this class extends DcmQuantPixel by an integer value which is used for various purposes.
Definition: diqthitm.h:45
DcmQuantColorHashTable & operator=(const DcmQuantColorHashTable &src)
private undefined copy assignment operator
void push_front(const DcmQuantPixel &colorP, int value)
inserts a new DcmQuantHistogramItem at the beginning of the list.
Definition: diqthitl.h:107
this class implements a hash table for colors.
Definition: diqthash.h:47
~DcmQuantColorHashTable()
destructor
DcmQuantHistogramItemListPointer * table
hash array of lists for color/value pairs
Definition: diqthash.h:118
this is a helper class used by class DcmQuantColorHashTable.
Definition: diqthitl.h:42
void add(const DcmQuantPixel &colorP, int value)
adds a new color to the hash table.
Definition: diqthash.h:61
int lookup(const DcmQuantPixel &colorP)
searches the list for an entry that equals the given pixel value.
Definition: diqthitl.h:67
DcmQuantColorHashTable()
constructor
int lookup(const DcmQuantPixel &colorP) const
looks up the given color in the hash table.
Definition: diqthash.h:71
unsigned long hash() const
this method computes an unsigned long hash value for the current pixel.
Definition: diqtpix.h:90
Interface class for dcmimgle/dcmimage module.
Definition: dcmimage.h:64
unsigned long addToHashTable(DicomImage &image, unsigned long newmaxval, unsigned long maxcolors)
adds all pixels of all frames of the given image (which must be a color image) to the hash table...
unsigned long createHistogram(DcmQuantHistogramItemPointer *&array)
converts the contents of this hash table into a histogram array.
unsigned long countEntries() const
counts the number of entries in the hash table


Generated on Wed Dec 14 2016 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.11