GDCM  2.4.5
gdcmPhotometricInterpretation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: GDCM (Grassroots DICOM). A DICOM library
4 
5  Copyright (c) 2006-2011 Mathieu Malaterre
6  All rights reserved.
7  See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notice for more information.
12 
13 =========================================================================*/
14 
15 #ifndef GDCMPHOTOMETRICINTERPRETATION_H
16 #define GDCMPHOTOMETRICINTERPRETATION_H
17 
18 #include "gdcmTypes.h"
19 #include <iostream>
20 
21 namespace gdcm
22 {
23 
24 class TransferSyntax;
29 {
30 public:
31  typedef enum {
32  UNKNOW = 0,
36  RGB,
37  HSV,
38  ARGB, // retired
46  // PALETTE_COLOR ?
47  //MONOCHROME = MONOCHROME1 | MONOCHROME2,
48  //COLOR = RGB | HSV | ARGB | CMYK | YBR_FULL | YBR_FULL_422 | YBR_PARTIAL_422 | YBR_PARTIAL_420 | YBR_ICT | YBR_RCT,
49  PI_END // Helpfull for internal implementation
50  } PIType; // PhotometricInterpretationType
51 
52  PhotometricInterpretation(PIType pi = UNKNOW):PIField(pi) {}
53 
54  static const char *GetPIString(PIType pi);
55 
56  const char *GetString() const;
57 
58  // You need to make sure end of string is \0
59  static PIType GetPIType(const char *pi);
60 
61  static bool IsRetired(PIType pi);
62 
63  bool IsLossy() const;
64  bool IsLossless() const;
65 
67  unsigned short GetSamplesPerPixel() const;
68 
69  // TODO
70  // not all PhotometricInterpretation are allowed for compressed Transfer
71  // syntax
72  // static bool IsAllowedForCompressedTS(PIType pi);
73 
74  friend std::ostream& operator<<(std::ostream& os, const PhotometricInterpretation& pi);
75 
76  operator PIType () const { return PIField; }
77 
78  PIType GetType () const { return PIField; }
79 
80  // Will return whether current PhotometricInterpretation is the same Color Space as input:
81  // eg. RGB and YBR_RCT are
82  bool IsSameColorSpace( PhotometricInterpretation const &pi ) const;
83 
84  //static PIType GetEquivalent(TransferSyntax const &ts);
85 
86 private:
87  PIType PIField;
88 };
89 //-----------------------------------------------------------------------------
90 inline std::ostream& operator<<(std::ostream& os, const PhotometricInterpretation &val)
91 {
92  const char *s = PhotometricInterpretation::GetPIString(val.PIField);
93  os << (s ? s : "");
94  return os;
95 }
96 
97 
98 } // end namespace gdcm
99 
100 #endif //GDCMPHOTOMETRICINTERPRETATION_H
Definition: gdcmPhotometricInterpretation.h:35
Definition: gdcmPhotometricInterpretation.h:33
#define GDCM_EXPORT
Definition: gdcmWin32.h:34
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition: gdcmDirectory.h:88
Definition: gdcmPhotometricInterpretation.h:41
Definition: gdcmPhotometricInterpretation.h:37
Definition: gdcmPhotometricInterpretation.h:45
PIType GetType() const
Definition: gdcmPhotometricInterpretation.h:78
Definition: gdcmPhotometricInterpretation.h:43
Definition: gdcmPhotometricInterpretation.h:38
Definition: gdcmPhotometricInterpretation.h:44
Definition: gdcmPhotometricInterpretation.h:42
static const char * GetPIString(PIType pi)
Class to represent an PhotometricInterpretation.
Definition: gdcmPhotometricInterpretation.h:28
Definition: gdcmPhotometricInterpretation.h:39
Definition: gdcmPhotometricInterpretation.h:34
PIType
Definition: gdcmPhotometricInterpretation.h:31
Definition: gdcmPhotometricInterpretation.h:40
Definition: gdcmASN1.h:20
Definition: gdcmPhotometricInterpretation.h:36
PhotometricInterpretation(PIType pi=UNKNOW)
Definition: gdcmPhotometricInterpretation.h:52

Generated on Fri Sep 25 2015 17:58:23 for GDCM by doxygen 1.8.9.1
SourceForge.net Logo