15 #ifndef GDCMPIXELFORMAT_H
16 #define GDCMPIXELFORMAT_H
60 unsigned short samplesperpixel = 1,
61 unsigned short bitsallocated = 8,
62 unsigned short bitsstored = 8,
63 unsigned short highbit = 7,
64 unsigned short pixelrepresentation = 0 ) :
65 SamplesPerPixel(samplesperpixel),
66 BitsAllocated(bitsallocated),
67 BitsStored(bitsstored),
69 PixelRepresentation(pixelrepresentation) {}
78 unsigned short GetSamplesPerPixel()
const;
82 SamplesPerPixel = spp;
83 assert( SamplesPerPixel == 1 || SamplesPerPixel == 3 || SamplesPerPixel == 4 );
97 HighBit = (
unsigned short)(ba - 1);
102 PixelRepresentation = 0;
109 assert( BitsStored <= BitsAllocated );
114 if( bs <= BitsAllocated && bs )
117 SetHighBit( (
unsigned short) (bs - 1) );
124 assert( HighBit < BitsStored );
129 if( hb < BitsStored )
136 return (
unsigned short)(PixelRepresentation ? 1 : 0);
140 PixelRepresentation = (
unsigned short)(pr ? 1 : 0);
144 ScalarType GetScalarType()
const;
148 void SetScalarType(ScalarType st);
149 const char *GetScalarTypeAsString()
const;
156 uint8_t GetPixelSize()
const;
159 void Print(std::ostream &os)
const;
162 int64_t GetMin()
const;
165 int64_t GetMax()
const;
168 bool IsValid()
const;
172 return GetScalarType() == st;
176 return GetScalarType() != st;
181 SamplesPerPixel == pf.SamplesPerPixel &&
182 BitsAllocated == pf.BitsAllocated &&
183 BitsStored == pf.BitsStored &&
184 HighBit == pf.HighBit &&
185 PixelRepresentation == pf.PixelRepresentation;
190 SamplesPerPixel != pf.SamplesPerPixel ||
191 BitsAllocated != pf.BitsAllocated ||
192 BitsStored != pf.BitsStored ||
193 HighBit != pf.HighBit ||
194 PixelRepresentation != pf.PixelRepresentation;
203 unsigned short SamplesPerPixel;
205 unsigned short BitsAllocated;
207 unsigned short BitsStored;
209 unsigned short HighBit;
211 unsigned short PixelRepresentation;
222 #endif //GDCMPIXELFORMAT_H
#define GDCM_EXPORT
Definition: gdcmWin32.h:34
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition: gdcmDirectory.h:92
Bitmap class A bitmap based image. Used as parent for both IconImage and the main Pixel Data Image It...
Definition: gdcmBitmap.h:38
#define gdcmAssertMacro(arg)
Assert.
Definition: gdcmTrace.h:186
Validate class.
Definition: gdcmValidate.h:25