OFFIS DCMTK  Version 3.6.0
dicoflt.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: DicomColorFlipTemplate (Header)
19  *
20  * Last Update: $Author: joergr $
21  * Update Date: $Date: 2011-11-17 16:13:14 $
22  * CVS/RCS Revision: $Revision: 1.16 $
23  * Status: $State: Exp $
24  *
25  * CVS/RCS Log at end of file
26  *
27  */
28 
29 
30 #ifndef DICOFLT_H
31 #define DICOFLT_H
32 
33 #include "dcmtk/config/osconfig.h"
34 
35 #include "dcmtk/dcmimage/dicopxt.h"
36 #include "dcmtk/dcmimgle/diflipt.h"
37 
38 
39 /*---------------------*
40  * class declaration *
41  *---------------------*/
42 
46 template<class T>
48  : public DiColorPixelTemplate<T>,
49  protected DiFlipTemplate<T>
50 {
51 
52  public:
53 
64  const Uint16 columns,
65  const Uint16 rows,
66  const Uint32 frames,
67  const int horz,
68  const int vert)
69  : DiColorPixelTemplate<T>(pixel, OFstatic_cast(unsigned long, columns) * OFstatic_cast(unsigned long, rows) * frames),
70  DiFlipTemplate<T>(3, columns, rows, frames)
71  {
72  if ((pixel != NULL) && (pixel->getCount() > 0))
73  {
74  if (pixel->getCount() == OFstatic_cast(unsigned long, columns) * OFstatic_cast(unsigned long, rows) * frames)
75  flip(OFstatic_cast(const T **, OFconst_cast(void *, pixel->getData())), horz, vert);
76  else {
77  DCMIMAGE_WARN("could not flip image ... corrupted data");
78  }
79  }
80  }
81 
85  {
86  }
87 
88 
89  private:
90 
97  inline void flip(const T *pixel[3],
98  const int horz,
99  const int vert)
100  {
101  if (this->Init(pixel))
102  {
103  if (horz && vert)
104  this->flipHorzVert(pixel, this->Data);
105  else if (horz)
106  this->flipHorz(pixel, this->Data);
107  else if (vert)
108  this->flipVert(pixel, this->Data);
109  }
110  }
111 };
112 
113 
114 #endif
115 
116 
117 /*
118  *
119  * CVS/RCS Log:
120  * $Log: dicoflt.h,v $
121  * Revision 1.16 2011-11-17 16:13:14 joergr
122  * Minor fixes to keep XCode 4.2 on Mac OS X Lion (clang compiler) quiet.
123  *
124  * Revision 1.15 2010-10-14 13:16:29 joergr
125  * Updated copyright header. Added reference to COPYRIGHT file.
126  *
127  * Revision 1.14 2010-03-01 09:08:46 uli
128  * Removed some unnecessary include directives in the headers.
129  *
130  * Revision 1.13 2009-10-14 10:25:13 joergr
131  * Fixed minor issues in log output. Also updated copyright date (if required).
132  *
133  * Revision 1.12 2009-10-13 14:08:33 uli
134  * Switched to logging mechanism provided by the "new" oflog module
135  *
136  * Revision 1.11 2006-08-15 16:35:01 meichel
137  * Updated the code in module dcmimage to correctly compile when
138  * all standard C++ classes remain in namespace std.
139  *
140  * Revision 1.10 2005/12/08 16:01:29 meichel
141  * Changed include path schema for all DCMTK header files
142  *
143  * Revision 1.9 2004/04/21 10:00:31 meichel
144  * Minor modifications for compilation with gcc 3.4.0
145  *
146  * Revision 1.8 2004/02/06 11:18:18 joergr
147  * Distinguish more clearly between const and non-const access to pixel data.
148  *
149  * Revision 1.7 2003/12/23 11:19:40 joergr
150  * Adapted type casts to new-style typecast operators defined in ofcast.h.
151  * Removed leading underscore characters from preprocessor symbols (reserved
152  * symbols). Updated copyright header.
153  *
154  * Revision 1.6 2001/11/09 16:41:15 joergr
155  * Updated/Enhanced comments.
156  * Removed 'inline' specifier from certain methods.
157  *
158  * Revision 1.5 2001/06/01 15:49:28 meichel
159  * Updated copyright header
160  *
161  * Revision 1.4 2000/12/08 14:06:01 joergr
162  * Added new checking routines to avoid crashes when processing corrupted image
163  * data.
164  *
165  * Revision 1.3 2000/03/08 16:21:49 meichel
166  * Updated copyright header.
167  *
168  * Revision 1.2 1999/04/28 12:51:57 joergr
169  * Corrected some typos, comments and formatting.
170  *
171  * Revision 1.1 1998/11/27 14:59:36 joergr
172  * Added copyright message.
173  * Added methods and classes for flipping and rotating, changed for
174  * scaling and clipping.
175  *
176  * Revision 1.4 1998/05/11 14:53:19 joergr
177  * Added CVS/RCS header to each file.
178  *
179  *
180  */


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