Blender  V3.3
COM_MaskOperation.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2012 Blender Foundation. */
3 
4 #pragma once
5 
6 #include "BLI_listbase.h"
8 #include "DNA_mask_types.h"
9 #include "IMB_imbuf_types.h"
10 
11 /* Forward declarations. */
12 struct MaskRasterHandle;
13 
14 namespace blender::compositor {
15 
20  protected:
22 
23  /* NOTE: these are used more like aspect,
24  * but they _do_ impact on mask detail */
27  float mask_width_inv_; /* `1 / mask_width_` */
28  float mask_height_inv_; /* `1 / mask_height_` */
29  float mask_px_ofs_[2];
30 
33 
35 
38 
42  void determine_canvas(const rcti &preferred_area, rcti &r_area) override;
43 
44  public:
45  MaskOperation();
46 
47  void init_execution() override;
48  void deinit_execution() override;
49 
51  {
52  mask_ = mask;
53  }
55  {
57  mask_width_inv_ = 1.0f / (float)width;
58  mask_px_ofs_[0] = mask_width_inv_ * 0.5f;
59  }
61  {
63  mask_height_inv_ = 1.0f / (float)height;
64  mask_px_ofs_[1] = mask_height_inv_ * 0.5f;
65  }
66  void set_framenumber(int frame_number)
67  {
68  frame_number_ = frame_number;
69  }
70  void set_feather(bool feather)
71  {
72  do_feather_ = feather;
73  }
74 
75  void set_motion_blur_samples(int samples)
76  {
78  }
79  void set_motion_blur_shutter(float shutter)
80  {
81  frame_shutter_ = shutter;
82  }
83 
84  void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override;
85 
87  const rcti &area,
88  Span<MemoryBuffer *> inputs) override;
89 
90  private:
91  Vector<MaskRasterHandle *> get_non_null_handles() const;
92 };
93 
94 } // namespace blender::compositor
typedef float(TangentPoint)[2]
#define MAX2(a, b)
#define MIN2(a, b)
#define CMP_NODE_MASK_MBLUR_SAMPLES_MAX
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
Contains defines and structs used throughout the imbuf module.
struct MaskRasterHandle * raster_mask_handles_[CMP_NODE_MASK_MBLUR_SAMPLES_MAX]
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void set_motion_blur_shutter(float shutter)
void update_memory_buffer_partial(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override
void set_framenumber(int frame_number)
void determine_canvas(const rcti &preferred_area, rcti &r_area) override
a MemoryBuffer contains access to the data of a chunk
depth_tx sampler(1, ImageType::FLOAT_2D, "combined_tx") .sampler(2
ccl_global KernelShaderEvalInput ccl_global float * output
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
Definition: math_float4.h:513
static void area(int d1, int d2, int e1, int e2, float weights[2])
static bNodeSocketTemplate inputs[]