VTK: Rendering/Core/vtkResizingWindowToImageFilter.h Source File

| VTK 9.3.1

vtkResizingWindowToImageFilter.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
42 #ifndef vtkResizingWindowToImageFilter_h
43 #define vtkResizingWindowToImageFilter_h
44
45 #include "vtkAlgorithm.h"
46 #include "vtkImageData.h" // makes things a bit easier
47 #include "vtkRenderingCoreModule.h" // For export macro
48
49 // VTK_RGB and VTK_RGBA are defined in system includes
50 #define VTK_ZBUFFER 5
51
52 VTK_ABI_NAMESPACE_BEGIN
53 class vtkWindow;
54
55 class vtkWTI2DHelperClass;
56 class VTKRENDERINGCORE_EXPORT vtkResizingWindowToImageFilter : public vtkAlgorithm
57 {
58 public:
59 static vtkResizingWindowToImageFilter* New();
60
61 vtkTypeMacro(vtkResizingWindowToImageFilter, vtkAlgorithm);
62 void PrintSelf(ostream& os, vtkIndent indent) override;
63
67 void SetInput(vtkWindow* input);
68
70
74 vtkGetObjectMacro(Input, vtkWindow);
76
78
81 vtkGetVector2Macro(Size, int);
82 vtkSetVector2Macro(Size, int);
84
86
91 vtkGetMacro(SizeLimit, int);
92 vtkSetMacro(SizeLimit, int);
94
96
102 vtkSetMacro(InputBufferType, int);
103 vtkGetMacro(InputBufferType, int);
104 void SetInputBufferTypeToRGB() { this->SetInputBufferType(VTK_RGB); }
105 void SetInputBufferTypeToRGBA() { this->SetInputBufferType(VTK_RGBA); }
106 void SetInputBufferTypeToZBuffer() { this->SetInputBufferType(VTK_ZBUFFER); }
108
112 vtkImageData* GetOutput();
113
117 vtkTypeBool ProcessRequest(
118 vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
119
120 protected:
121 vtkResizingWindowToImageFilter();
122 ~vtkResizingWindowToImageFilter() override;
123
124 // vtkWindow is not a vtkDataObject, so we need our own ivar.
125 vtkWindow* Input;
126 // requested size of the screenshot in pixels.
127 int Size[2];
128 // window size limit for using this filter. If the target resolution is higher we switch to
129 // vtkWindowToImageFilter with tiling
130 int SizeLimit;
131
132 int InputBufferType;
133
134 void RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
135
136 virtual void RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
137
138 // see algorithm for more info
139 int FillOutputPortInformation(int port, vtkInformation* info) override;
140
148 virtual void Render();
149
164 void GetScaleFactorsAndSize(
165 const int requestedSize[2], int actualSize[2], int scale[2], bool* approximate);
166
167 private:
168 vtkResizingWindowToImageFilter(const vtkResizingWindowToImageFilter&) = delete;
169 void operator=(const vtkResizingWindowToImageFilter&) = delete;
170 };
171
172 VTK_ABI_NAMESPACE_END
173 #endif
vtkAlgorithm
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:61
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:52
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkResizingWindowToImageFilter
Use a vtkWindow as input to image pipeline.
Definition: vtkResizingWindowToImageFilter.h:57
vtkResizingWindowToImageFilter::New
static vtkResizingWindowToImageFilter * New()
vtkResizingWindowToImageFilter::SetInput
void SetInput(vtkWindow *input)
Indicates what renderer to get the pixel data from.
vtkResizingWindowToImageFilter::GetScaleFactorsAndSize
void GetScaleFactorsAndSize(const int requestedSize[2], int actualSize[2], int scale[2], bool *approximate)
Compute scale factors and new size for target resolution.
vtkResizingWindowToImageFilter::Render
virtual void Render()
Allows subclasses to customize how a request for render is handled.
vtkResizingWindowToImageFilter::RequestData
void RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkResizingWindowToImageFilter::SetInputBufferTypeToZBuffer
void SetInputBufferTypeToZBuffer()
Set/get the window buffer from which data will be read.
Definition: vtkResizingWindowToImageFilter.h:106
vtkResizingWindowToImageFilter::GetOutput
vtkImageData * GetOutput()
Get the output data object for a port on this algorithm.
vtkResizingWindowToImageFilter::SetInputBufferTypeToRGB
void SetInputBufferTypeToRGB()
Set/get the window buffer from which data will be read.
Definition: vtkResizingWindowToImageFilter.h:104
vtkResizingWindowToImageFilter::InputBufferType
int InputBufferType
Definition: vtkResizingWindowToImageFilter.h:132
vtkResizingWindowToImageFilter::RequestInformation
virtual void RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkResizingWindowToImageFilter::vtkResizingWindowToImageFilter
vtkResizingWindowToImageFilter()
vtkResizingWindowToImageFilter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkResizingWindowToImageFilter::SizeLimit
int SizeLimit
Definition: vtkResizingWindowToImageFilter.h:130
vtkResizingWindowToImageFilter::~vtkResizingWindowToImageFilter
~vtkResizingWindowToImageFilter() override
vtkResizingWindowToImageFilter::ProcessRequest
vtkTypeBool ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
see vtkAlgorithm for details
vtkResizingWindowToImageFilter::Input
vtkWindow * Input
Definition: vtkResizingWindowToImageFilter.h:125
vtkResizingWindowToImageFilter::FillOutputPortInformation
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
vtkResizingWindowToImageFilter::SetInputBufferTypeToRGBA
void SetInputBufferTypeToRGBA()
Set/get the window buffer from which data will be read.
Definition: vtkResizingWindowToImageFilter.h:105
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkX3D::scale
@ scale
Definition: vtkX3D.h:229
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkAlgorithm.h
vtkImageData.h
VTK_ZBUFFER
#define VTK_ZBUFFER
Definition: vtkResizingWindowToImageFilter.h:50
VTK_RGBA
#define VTK_RGBA
Definition: vtkSystemIncludes.h:75
VTK_RGB
#define VTK_RGB
Definition: vtkSystemIncludes.h:74