VTK  9.1.0
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 =========================================================================*/
51 #ifndef vtkResizingWindowToImageFilter_h
52 #define vtkResizingWindowToImageFilter_h
53 
54 #include "vtkAlgorithm.h"
55 #include "vtkImageData.h" // makes things a bit easier
56 #include "vtkRenderingCoreModule.h" // For export macro
57 
58 // VTK_RGB and VTK_RGBA are defined in system includes
59 #define VTK_ZBUFFER 5
60 
61 class vtkWindow;
62 
63 class vtkWTI2DHelperClass;
64 class VTKRENDERINGCORE_EXPORT vtkResizingWindowToImageFilter : public vtkAlgorithm
65 {
66 public:
68 
70  void PrintSelf(ostream& os, vtkIndent indent) override;
71 
75  void SetInput(vtkWindow* input);
76 
78 
82  vtkGetObjectMacro(Input, vtkWindow);
84 
86 
89  vtkGetVector2Macro(Size, int);
90  vtkSetVector2Macro(Size, int);
92 
94 
99  vtkGetMacro(SizeLimit, int);
100  vtkSetMacro(SizeLimit, int);
102 
104 
110  vtkSetMacro(InputBufferType, int);
111  vtkGetMacro(InputBufferType, int);
112  void SetInputBufferTypeToRGB() { this->SetInputBufferType(VTK_RGB); }
113  void SetInputBufferTypeToRGBA() { this->SetInputBufferType(VTK_RGBA); }
114  void SetInputBufferTypeToZBuffer() { this->SetInputBufferType(VTK_ZBUFFER); }
116 
121 
127 
128 protected:
131 
132  // vtkWindow is not a vtkDataObject, so we need our own ivar.
134  // requested size of the screenshot in pixels.
135  int Size[2];
136  // window size limit for using this filter. If the target resolution is higher we switch to
137  // vtkWindowToImageFilter with tiling
139 
141 
143 
145 
146  // see algorithm for more info
148 
156  virtual void Render();
157 
173  const int requestedSize[2], int actualSize[2], int scale[2], bool* approximate);
174 
175 private:
177  void operator=(const vtkResizingWindowToImageFilter&) = delete;
178 };
179 
180 #endif
vtkImageData.h
vtkResizingWindowToImageFilter::GetOutput
vtkImageData * GetOutput()
Get the output data object for a port on this algorithm.
vtkResizingWindowToImageFilter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkResizingWindowToImageFilter::ProcessRequest
vtkTypeBool ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
see vtkAlgorithm for details
vtkResizingWindowToImageFilter::SetInput
void SetInput(vtkWindow *input)
Indicates what renderer to get the pixel data from.
vtkResizingWindowToImageFilter::Input
vtkWindow * Input
Definition: vtkResizingWindowToImageFilter.h:133
vtkX3D::scale
@ scale
Definition: vtkX3D.h:235
vtkAlgorithm
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:123
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkResizingWindowToImageFilter::InputBufferType
int InputBufferType
Definition: vtkResizingWindowToImageFilter.h:140
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.
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
vtkResizingWindowToImageFilter::vtkResizingWindowToImageFilter
vtkResizingWindowToImageFilter()
vtkAlgorithm.h
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkResizingWindowToImageFilter::RequestData
void RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkResizingWindowToImageFilter::~vtkResizingWindowToImageFilter
~vtkResizingWindowToImageFilter() override
VTK_RGB
#define VTK_RGB
Definition: vtkSystemIncludes.h:86
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkResizingWindowToImageFilter::New
static vtkResizingWindowToImageFilter * New()
vtkResizingWindowToImageFilter::RequestInformation
virtual void RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkResizingWindowToImageFilter::SetInputBufferTypeToRGB
void SetInputBufferTypeToRGB()
Set/get the window buffer from which data will be read.
Definition: vtkResizingWindowToImageFilter.h:112
vtkX3D::info
@ info
Definition: vtkX3D.h:382
VTK_ZBUFFER
#define VTK_ZBUFFER
Definition: vtkResizingWindowToImageFilter.h:59
vtkResizingWindowToImageFilter::SetInputBufferTypeToRGBA
void SetInputBufferTypeToRGBA()
Set/get the window buffer from which data will be read.
Definition: vtkResizingWindowToImageFilter.h:113
vtkResizingWindowToImageFilter
Use a vtkWindow as input to image pipeline.
Definition: vtkResizingWindowToImageFilter.h:65
VTK_RGBA
#define VTK_RGBA
Definition: vtkSystemIncludes.h:87
vtkResizingWindowToImageFilter::FillOutputPortInformation
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
vtkResizingWindowToImageFilter::SizeLimit
int SizeLimit
Definition: vtkResizingWindowToImageFilter.h:138
vtkResizingWindowToImageFilter::Render
virtual void Render()
Allows subclasses to customize how a request for render is handled.
vtkResizingWindowToImageFilter::SetInputBufferTypeToZBuffer
void SetInputBufferTypeToZBuffer()
Set/get the window buffer from which data will be read.
Definition: vtkResizingWindowToImageFilter.h:114
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69