Blender  V2.93
COM_PreviewOperation.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * Copyright 2011, Blender Foundation.
17  */
18 
19 #pragma once
20 
21 #include "BKE_global.h"
22 #include "BLI_rect.h"
23 #include "COM_NodeOperation.h"
24 #include "DNA_color_types.h"
25 #include "DNA_image_types.h"
26 
27 namespace blender::compositor {
28 
30  protected:
31  unsigned char *m_outputBuffer;
32 
38  float m_divider;
39  unsigned int m_defaultWidth;
40  unsigned int m_defaultHeight;
41 
44 
45  public:
46  PreviewOperation(const ColorManagedViewSettings *viewSettings,
47  const ColorManagedDisplaySettings *displaySettings,
48  unsigned int defaultWidth,
49  unsigned int defaultHeight);
51 
52  bool isOutputOperation(bool /*rendering*/) const override
53  {
54  return !G.background;
55  }
56  void initExecution() override;
57  void deinitExecution() override;
58  eCompositorPriority getRenderPriority() const override;
59 
60  void executeRegion(rcti *rect, unsigned int tileNumber) override;
61  void determineResolution(unsigned int resolution[2],
62  unsigned int preferredResolution[2]) override;
64  ReadBufferOperation *readOperation,
65  rcti *output) override;
66 };
67 
68 } // namespace blender::compositor
#define output
NodeOperation contains calculation logic.
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) override
determine the resolution of this node
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) override
PreviewOperation(const ColorManagedViewSettings *viewSettings, const ColorManagedDisplaySettings *displaySettings, unsigned int defaultWidth, unsigned int defaultHeight)
bNodePreview * m_preview
holds reference to the SDNA bNode, where this nodes will render the preview image for
const ColorManagedDisplaySettings * m_displaySettings
void executeRegion(rcti *rect, unsigned int tileNumber) override
when a chunk is executed by a CPUDevice, this method is called
eCompositorPriority getRenderPriority() const override
get the render priority of this node.
const ColorManagedViewSettings * m_viewSettings
void verifyPreview(bNodeInstanceHash *previews, bNodeInstanceKey key)
bool isOutputOperation(bool) const override
isOutputOperation determines whether this operation is an output of the ExecutionSystem during render...
eCompositorPriority
Possible priority settings.
Definition: COM_Enums.h:45
#define G(x, y, z)