OFFIS DCMTK  Version 3.6.0
dicocpt.h
1 /*
2  *
3  * Copyright (C) 1998-2011, 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: Joerg Riesmeier
17  *
18  * Purpose: DicomColorCopyTemplate (Header)
19  *
20  * Last Update: $Author: joergr $
21  * Update Date: $Date: 2011-11-17 16:13:14 $
22  * CVS/RCS Revision: $Revision: 1.13 $
23  * Status: $State: Exp $
24  *
25  * CVS/RCS Log at end of file
26  *
27  */
28 
29 
30 #ifndef DICOCPT_H
31 #define DICOCPT_H
32 
33 #include "dcmtk/config/osconfig.h"
34 #include "dcmtk/ofstd/ofbmanip.h"
35 
36 #include "dcmtk/dcmimage/dicopxt.h"
37 
38 
39 /*---------------------*
40  * class declaration *
41  *---------------------*/
42 
45 template<class T>
47  : public DiColorPixelTemplate<T>
48 {
49 
50  public:
51 
60  const unsigned long fstart,
61  const unsigned long fcount,
62  const unsigned long fsize)
63  : DiColorPixelTemplate<T>(pixel, fcount * fsize)
64  {
65  if ((pixel != NULL) && (pixel->getCount() > 0))
66  {
67  if ((pixel->getCount() > fstart * fsize) && (pixel->getCount() >= (fstart + fcount) * fsize))
68  copy(OFstatic_cast(const T **, OFconst_cast(void *, pixel->getData())), fstart * fsize);
69  }
70  }
71 
75  {
76  }
77 
78 
79  private:
80 
86  inline void copy(const T *pixel[3],
87  const unsigned long offset)
88  {
89  if (this->Init(pixel))
90  {
91  for (int j = 0; j < 3; j++)
92  OFBitmanipTemplate<T>::copyMem(pixel[j] + offset, this->Data[j], this->getCount());
93  }
94  }
95 };
96 
97 
98 #endif
99 
100 
101 /*
102  *
103  * CVS/RCS Log:
104  * $Log: dicocpt.h,v $
105  * Revision 1.13 2011-11-17 16:13:14 joergr
106  * Minor fixes to keep XCode 4.2 on Mac OS X Lion (clang compiler) quiet.
107  *
108  * Revision 1.12 2010-10-14 13:16:29 joergr
109  * Updated copyright header. Added reference to COPYRIGHT file.
110  *
111  * Revision 1.11 2005/12/08 16:01:28 meichel
112  * Changed include path schema for all DCMTK header files
113  *
114  * Revision 1.10 2004/04/21 10:00:31 meichel
115  * Minor modifications for compilation with gcc 3.4.0
116  *
117  * Revision 1.9 2004/02/06 11:18:18 joergr
118  * Distinguish more clearly between const and non-const access to pixel data.
119  *
120  * Revision 1.8 2003/12/23 11:18:26 joergr
121  * Adapted type casts to new-style typecast operators defined in ofcast.h.
122  * Removed leading underscore characters from preprocessor symbols (reserved
123  * symbols). Updated copyright header.
124  *
125  * Revision 1.7 2001/11/09 16:40:45 joergr
126  * Updated/Enhanced comments.
127  *
128  * Revision 1.6 2001/06/01 15:49:27 meichel
129  * Updated copyright header
130  *
131  * Revision 1.5 2000/12/08 14:06:01 joergr
132  * Added new checking routines to avoid crashes when processing corrupted image
133  * data.
134  *
135  * Revision 1.4 2000/03/08 16:21:49 meichel
136  * Updated copyright header.
137  *
138  * Revision 1.3 1999/04/28 12:51:56 joergr
139  * Corrected some typos, comments and formatting.
140  *
141  * Revision 1.2 1999/01/20 14:38:30 joergr
142  * Corrected some typos and formatting.
143  *
144  * Revision 1.1 1998/11/27 15:16:38 joergr
145  * Added copyright message.
146  * Introduced new method and corresponding classes to create a copy of a
147  * dcmimage object (optional parameters: frame start and count).
148  *
149  *
150  */


Generated on Thu Dec 20 2012 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.2