1 /* 2 * 3 * Copyright (C) 2002-2018, 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: typedefs and constants for the color quantization classes 19 * 20 */ 21 22 23 #ifndef DIQTTYPE_H 24 #define DIQTTYPE_H 25 26 27 #include "dcmtk/config/osconfig.h" 28 29 #include "dcmtk/dcmimage/dicdefin.h" 30 31 /// the basic type for pixel color components 32 typedef unsigned char DcmQuantComponent; 33 34 /// size of color hash table. Don't touch this. 35 #define DcmQuantHashSize 20023UL 36 37 /** maximum number of colors we count in a color histogram. 38 * If the number of colors turns out to be larger than this, 39 * then the image bit depth is reduced until the number 40 * of colors becomes smaller than this maximum. 41 */ 42 #define DcmQuantMaxColors 65536 43 44 45 // include this file in doxygen documentation 46 47 /** @file diqttype.h 48 * @brief type definitions and constants for the color quantization classes 49 */ 50 51 52 /** defines the algorithm used for determining the 53 * largest dimension in the Median Cut algorithm 54 */ 55 enum DcmLargestDimensionType 56 { 57 /// determine dimension by comparing the range in RGB space (default) 58 DcmLargestDimensionType_default, 59 60 /// determine dimension by transforming into luminance before comparison 61 DcmLargestDimensionType_luminance 62 }; 63 64 65 /** defines the algorithm for choosing a representative color for each 66 * box in the Median Cut algorithm 67 */ 68 enum DcmRepresentativeColorType 69 { 70 /// average all the colors in the box (as specified in Heckbert's paper; this is the default) 71 DcmRepresentativeColorType_default, 72 73 /// average all pixels in the box 74 DcmRepresentativeColorType_averagePixels, 75 76 /// choose center of the box, ignoring any structure within the boxes 77 DcmRepresentativeColorType_centerOfBox 78 79 }; 80 81 #endif 82