ParaView
vtkSMAnimationSceneImageWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkSMAnimationSceneImageWriter.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
31 #ifndef vtkSMAnimationSceneImageWriter_h
32 #define vtkSMAnimationSceneImageWriter_h
33 
34 #include "vtkPVAnimationModule.h" //needed for exports
36 
37 class vtkGenericMovieWriter;
38 class vtkImageData;
39 class vtkImageWriter;
40 class vtkSMViewProxy;
41 
42 class VTKPVANIMATION_EXPORT vtkSMAnimationSceneImageWriter : public vtkSMAnimationSceneWriter
43 {
44 public:
47  void PrintSelf(ostream& os, vtkIndent indent);
48 
50 
53  vtkSetClampMacro(Magnification, int, 1, VTK_INT_MAX);
54  vtkGetMacro(Magnification, int);
56 
58 
64  vtkSetClampMacro(Quality, int, 0, 2);
65  vtkGetMacro(Quality, int);
67 
69 
74  vtkSetMacro(Compression, bool);
75  vtkGetMacro(Compression, bool);
76  vtkBooleanMacro(Compression, bool);
78 
80 
86  vtkSetMacro(Subsampling, int);
87  vtkGetMacro(Subsampling, int);
88  vtkBooleanMacro(Subsampling, int);
90 
92 
96  vtkGetMacro(ErrorCode, int);
98 
100 
104  vtkSetVector3Macro(BackgroundColor, double);
105  vtkGetVector3Macro(BackgroundColor, double);
107 
108  // Get/Set the frame rate to use for saving the animation.
109  // This frame rate is the frame rate that gets saved in the movie
110  // file generated, if applicable. If does not affect the FrameRate
111  // set on the animation scene at all. In other words, this is the
112  // playback frame rate and not the animation generation frame rate.
113  // Default value is 1.
114  vtkSetMacro(FrameRate, double);
115  vtkGetMacro(FrameRate, double);
116 
118 
123  static void Merge(vtkImageData* dest, vtkImageData* src);
124 
125 protected:
129 
133  virtual bool SaveInitialize(int startCount);
134 
138  virtual bool SaveFrame(double time);
139 
143  virtual bool SaveFinalize();
144 
145  // Creates the writer based on file type.
146  bool CreateWriter();
147 
148  // Updates the ActualSize which is the
149  // resolution of the generated animation frame.
150  void UpdateImageSize();
151 
158  virtual vtkImageData* CaptureViewImage(vtkSMViewProxy*, int magnification);
159 
160  vtkImageData* NewFrame();
161 
162  vtkSetVector2Macro(ActualSize, int);
163  int ActualSize[2];
164  int Quality;
170 
171  char* Prefix;
172  char* Suffix;
173  vtkSetStringMacro(Prefix);
174  vtkSetStringMacro(Suffix);
175 
176  double BackgroundColor[3];
177  double FrameRate;
178 
179  vtkImageWriter* ImageWriter;
180  vtkGenericMovieWriter* MovieWriter;
181 
182  void SetImageWriter(vtkImageWriter*);
183  void SetMovieWriter(vtkGenericMovieWriter*);
184 
185 private:
187  void operator=(const vtkSMAnimationSceneImageWriter&) VTK_DELETE_FUNCTION;
188 };
189 
190 #endif
Superclass for all view proxies.
virtual bool SaveInitialize(int countStart)=0
Subclasses should override this method.
helper class used to write animations.
void PrintSelf(ostream &os, vtkIndent indent)
virtual bool SaveFrame(double time)=0
Subclasses should override this method.
helper class to write animation images/movies.
virtual bool SaveFinalize()=0
Subclasses should override this method.
static vtkSMSessionObject * New()