VTK  9.2.6
vtkResizingWindowToImageFilter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkResizingWindowToImageFilter.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=========================================================================*/
54#ifndef vtkResizingWindowToImageFilter_h
55#define vtkResizingWindowToImageFilter_h
56
57#include "vtkAlgorithm.h"
58#include "vtkImageData.h" // makes things a bit easier
59#include "vtkRenderingCoreModule.h" // For export macro
60
61// VTK_RGB and VTK_RGBA are defined in system includes
62#define VTK_ZBUFFER 5
63
64class vtkWindow;
65
66class vtkWTI2DHelperClass;
67class VTKRENDERINGCORE_EXPORT vtkResizingWindowToImageFilter : public vtkAlgorithm
68{
69public:
71
73 void PrintSelf(ostream& os, vtkIndent indent) override;
74
78 void SetInput(vtkWindow* input);
79
81
85 vtkGetObjectMacro(Input, vtkWindow);
87
89
92 vtkGetVector2Macro(Size, int);
93 vtkSetVector2Macro(Size, int);
95
97
102 vtkGetMacro(SizeLimit, int);
103 vtkSetMacro(SizeLimit, int);
105
107
113 vtkSetMacro(InputBufferType, int);
114 vtkGetMacro(InputBufferType, int);
115 void SetInputBufferTypeToRGB() { this->SetInputBufferType(VTK_RGB); }
116 void SetInputBufferTypeToRGBA() { this->SetInputBufferType(VTK_RGBA); }
117 void SetInputBufferTypeToZBuffer() { this->SetInputBufferType(VTK_ZBUFFER); }
119
124
130
131protected:
134
135 // vtkWindow is not a vtkDataObject, so we need our own ivar.
137 // requested size of the screenshot in pixels.
138 int Size[2];
139 // window size limit for using this filter. If the target resolution is higher we switch to
140 // vtkWindowToImageFilter with tiling
142
144
146
148
149 // see algorithm for more info
150 int FillOutputPortInformation(int port, vtkInformation* info) override;
151
159 virtual void Render();
160
176 const int requestedSize[2], int actualSize[2], int scale[2], bool* approximate);
177
178private:
180 void operator=(const vtkResizingWindowToImageFilter&) = delete;
181};
182
183#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 SetInput(vtkWindow *input)
Indicates what renderer to get the pixel data from.
void GetScaleFactorsAndSize(const int requestedSize[2], int actualSize[2], int scale[2], bool *approximate)
Compute scale factors and new size for target resolution.
virtual void Render()
Allows subclasses to customize how a request for render is handled.
void RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkImageData * GetOutput()
Get the output data object for a port on this algorithm.
void SetInputBufferTypeToZBuffer()
Set/get the window buffer from which data will be read.
void SetInputBufferTypeToRGB()
Set/get the window buffer from which data will be read.
virtual void RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkResizingWindowToImageFilter() override
static vtkResizingWindowToImageFilter * New()
vtkTypeBool ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
see vtkAlgorithm for details
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
void SetInputBufferTypeToRGBA()
Set/get the window buffer from which data will be read.
window superclass for vtkRenderWindow
Definition vtkWindow.h:39
int vtkTypeBool
Definition vtkABI.h:69
#define VTK_RGBA
#define VTK_RGB