VTK  9.2.6
vtkWindowToImageFilter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkWindowToImageFilter.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm 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=========================================================================*/
64#ifndef vtkWindowToImageFilter_h
65#define vtkWindowToImageFilter_h
66
67#include "vtkAlgorithm.h"
68#include "vtkImageData.h" // makes things a bit easier
69#include "vtkRenderingCoreModule.h" // For export macro
70
71// VTK_RGB and VTK_RGBA are defined in system includes
72#define VTK_ZBUFFER 5
73
74class vtkWindow;
75
76class vtkWTI2DHelperClass;
77class VTKRENDERINGCORE_EXPORT vtkWindowToImageFilter : public vtkAlgorithm
78{
79public:
81
83 void PrintSelf(ostream& os, vtkIndent indent) override;
84
88 void SetInput(vtkWindow* input);
89
91
95 vtkGetObjectMacro(Input, vtkWindow);
97
99
102 vtkSetVector2Macro(Scale, int);
103 vtkGetVector2Macro(Scale, int);
105
110 void SetScale(int scale) { this->SetScale(scale, scale); }
111
113
118 vtkSetMacro(FixBoundary, bool);
119 vtkGetMacro(FixBoundary, bool);
120 vtkBooleanMacro(FixBoundary, bool);
122
124
128 vtkBooleanMacro(ReadFrontBuffer, vtkTypeBool);
129 vtkGetMacro(ReadFrontBuffer, vtkTypeBool);
130 vtkSetMacro(ReadFrontBuffer, vtkTypeBool);
132
134
138 vtkBooleanMacro(ShouldRerender, vtkTypeBool);
139 vtkSetMacro(ShouldRerender, vtkTypeBool);
140 vtkGetMacro(ShouldRerender, vtkTypeBool);
142
144
148 void SetViewport(double, double, double, double);
149 void SetViewport(double*);
150 vtkGetVectorMacro(Viewport, double, 4);
152
154
160 vtkSetMacro(InputBufferType, int);
161 vtkGetMacro(InputBufferType, int);
162 void SetInputBufferTypeToRGB() { this->SetInputBufferType(VTK_RGB); }
163 void SetInputBufferTypeToRGBA() { this->SetInputBufferType(VTK_RGBA); }
164 void SetInputBufferTypeToZBuffer() { this->SetInputBufferType(VTK_ZBUFFER); }
166
171
177
178protected:
181
182 // vtkWindow is not a vtkDataObject, so we need our own ivar.
184 int Scale[2];
187 double Viewport[4];
190
192
194
195 // see algorithm for more info
196 int FillOutputPortInformation(int port, vtkInformation* info) override;
197
205 virtual void Render();
206
207 // The following was extracted from vtkRenderLargeImage, and patch to handle viewports
209 void Shift2DActors(int x, int y);
211 vtkWTI2DHelperClass* StoredData;
212
213private:
215 void operator=(const vtkWindowToImageFilter&) = delete;
216};
217
218#endif
Superclass for all sources, filters, and sinks in VTK.
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Use a vtkWindow as input to image pipeline.
void SetViewport(double *)
Set/get the extents to be used to generate the image.
vtkTypeBool ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
see vtkAlgorithm for details
void SetInput(vtkWindow *input)
Indicates what renderer to get the pixel data from.
virtual void Render()
Allows subclasses to customize how a request for render is handled.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetViewport(double, double, double, double)
Set/get the extents to be used to generate the image.
vtkImageData * GetOutput()
Get the output data object for a port on this algorithm.
void SetInputBufferTypeToRGB()
Set/get the window buffer from which data will be read.
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
vtkWTI2DHelperClass * StoredData
void Shift2DActors(int x, int y)
void SetInputBufferTypeToRGBA()
Set/get the window buffer from which data will be read.
void RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
virtual void RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
void SetScale(int scale)
Convenience method to set same scale factors for x and y.
void SetInputBufferTypeToZBuffer()
Set/get the window buffer from which data will be read.
~vtkWindowToImageFilter() override
static vtkWindowToImageFilter * New()
window superclass for vtkRenderWindow
Definition vtkWindow.h:39
int vtkTypeBool
Definition vtkABI.h:69
#define VTK_RGBA
#define VTK_RGB