00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef DICOIMG_H
00031 #define DICOIMG_H
00032
00033 #include "dcmtk/config/osconfig.h"
00034
00035 #include "dcmtk/dcmimgle/diimage.h"
00036 #include "dcmtk/dcmimage/dicopx.h"
00037
00038
00039
00040
00041
00042
00043 class DiColorOutputPixel;
00044
00045
00046
00047
00048
00049
00052 class DiColorImage
00053 : public DiImage
00054 {
00055
00056 public:
00057
00065 DiColorImage(const DiDocument *docu,
00066 const EI_Status status,
00067 const int spp,
00068 const OFBool rgb = OFTrue);
00069
00072 virtual ~DiColorImage();
00073
00078 virtual EP_Interpretation getInternalColorModel() const
00079 {
00080 return (RGBColorModel) ? EPI_RGB : EPI_YBR_Full;
00081 }
00082
00089 virtual unsigned long getOutputDataSize(const int bits = 0) const;
00090
00103 const void *getOutputData(const unsigned long frame,
00104 const int bits,
00105 const int planar = 0);
00106
00121 int getOutputData(void *buffer,
00122 const unsigned long size,
00123 const unsigned long frame,
00124 const int bits,
00125 const int planar = 0);
00126
00134 const void *getOutputPlane(const int plane) const;
00135
00139 void deleteOutputData();
00140
00148 DiImage *createImage(const unsigned long fstart,
00149 const unsigned long fcount) const;
00150
00171 DiImage *createScale(const signed long left_pos,
00172 const signed long top_pos,
00173 const unsigned long src_cols,
00174 const unsigned long src_rows,
00175 const unsigned long dest_cols,
00176 const unsigned long dest_rows,
00177 const int interpolate,
00178 const int aspect,
00179 const Uint16 pvalue) const;
00180
00190 int flip(const int horz,
00191 const int vert);
00192
00200 DiImage *createFlip(const int horz,
00201 const int vert) const;
00202
00211 int rotate(const int degree);
00212
00219 DiImage *createRotate(const int degree) const;
00220
00229 DiImage *createMono(const double red,
00230 const double green,
00231 const double blue) const;
00232
00237 const DiPixel *getInterData() const
00238 {
00239 return InterData;
00240 }
00241
00246 const DiColorPixel *getColorInterData() const
00247 {
00248 return InterData;
00249 }
00250
00263 unsigned long createDIB(void *&data,
00264 const unsigned long size,
00265 const unsigned long frame,
00266 const int bits,
00267 const int upsideDown,
00268 const int padding = 1);
00269
00279 unsigned long createAWTBitmap(void *&data,
00280 const unsigned long frame,
00281 const int bits);
00282
00291 int writeImageToDataset(DcmItem &dataset,
00292 const int mode,
00293 const int planar);
00294
00304 int writePPM(STD_NAMESPACE ostream& stream,
00305 const unsigned long frame,
00306 const int bits);
00307
00317 int writePPM(FILE *stream,
00318 const unsigned long frame,
00319 const int bits);
00320
00329 int writeRawPPM(FILE *stream,
00330 const unsigned long frame,
00331 const int bits);
00332
00341 int writeBMP(FILE *stream,
00342 const unsigned long frame,
00343 const int bits);
00344
00345
00346 protected:
00347
00354 DiColorImage(const DiColorImage *image,
00355 const unsigned long fstart,
00356 const unsigned long fcount);
00357
00376 DiColorImage(const DiColorImage *image,
00377 const signed long left_pos,
00378 const signed long top_pos,
00379 const Uint16 src_cols,
00380 const Uint16 src_rows,
00381 const Uint16 dest_cols,
00382 const Uint16 dest_rows,
00383 const int interpolate = 0,
00384 const int aspect = 0);
00385
00392 DiColorImage(const DiColorImage *image,
00393 const int horz,
00394 const int vert);
00395
00401 DiColorImage(const DiColorImage *image,
00402 const int degree);
00403
00408 int checkInterData(const int mode = 1);
00409
00421 const void *getData(void *buffer,
00422 const unsigned long size,
00423 const unsigned long frame,
00424 const int bits,
00425 const int planar);
00426
00432 virtual void updateImagePixelModuleAttributes(DcmItem &dataset);
00433
00435 const OFBool RGBColorModel;
00436
00438 DiColorPixel *InterData;
00439
00440
00441 private:
00442
00444 DiColorOutputPixel *OutputData;
00445
00446
00447
00448 DiColorImage(const DiColorImage &);
00449 DiColorImage &operator=(const DiColorImage &);
00450 };
00451
00452
00453 #endif
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527
00528
00529
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563