15 #ifndef GDCMPIXELFORMAT_H
16 #define GDCMPIXELFORMAT_H
71 unsigned short samplesperpixel = 1,
72 unsigned short bitsallocated = 8,
73 unsigned short bitsstored = 8,
74 unsigned short highbit = 7,
75 unsigned short pixelrepresentation = 0 ) :
76 SamplesPerPixel(samplesperpixel),
77 BitsAllocated(bitsallocated),
78 BitsStored(bitsstored),
80 PixelRepresentation(pixelrepresentation) {}
89 unsigned short GetSamplesPerPixel()
const;
93 SamplesPerPixel = spp;
94 assert( SamplesPerPixel == 1 || SamplesPerPixel == 3 || SamplesPerPixel == 4 );
100 return BitsAllocated;
108 HighBit = (
unsigned short)(ba - 1);
113 PixelRepresentation = 0;
120 assert( BitsStored <= BitsAllocated );
125 if( bs <= BitsAllocated && bs )
128 SetHighBit( (
unsigned short) (bs - 1) );
135 assert( HighBit < BitsStored );
140 if( hb < BitsStored )
147 return (
unsigned short)(PixelRepresentation ? 1 : 0);
151 PixelRepresentation = (
unsigned short)(pr ? 1 : 0);
155 ScalarType GetScalarType()
const;
159 void SetScalarType(ScalarType st);
160 const char *GetScalarTypeAsString()
const;
167 uint8_t GetPixelSize()
const;
170 void Print(std::ostream &os)
const;
173 int64_t GetMin()
const;
176 int64_t GetMax()
const;
179 bool IsValid()
const;
183 return GetScalarType() == st;
187 return GetScalarType() != st;
192 SamplesPerPixel == pf.SamplesPerPixel &&
193 BitsAllocated == pf.BitsAllocated &&
194 BitsStored == pf.BitsStored &&
195 HighBit == pf.HighBit &&
196 PixelRepresentation == pf.PixelRepresentation;
201 SamplesPerPixel != pf.SamplesPerPixel ||
202 BitsAllocated != pf.BitsAllocated ||
203 BitsStored != pf.BitsStored ||
204 HighBit != pf.HighBit ||
205 PixelRepresentation != pf.PixelRepresentation;
215 unsigned short SamplesPerPixel;
217 unsigned short BitsAllocated;
219 unsigned short BitsStored;
221 unsigned short HighBit;
223 unsigned short PixelRepresentation;
234 #endif //GDCMPIXELFORMAT_H
#define GDCM_EXPORT
Definition: gdcmWin32.h:34
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition: gdcmDirectory.h:88
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
Class to manipulate Transfer Syntax.
Definition: gdcmTransferSyntax.h:39
Validate class.
Definition: gdcmValidate.h:25
Definition: gdcmASN1.h:20