This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/compositor/operations/COM_TrackPositionOperation.h
Campbell Barton c434782e3a File headers: SPDX License migration
Use a shorter/simpler license convention, stops the header taking so
much space.

Follow the SPDX license specification: https://spdx.org/licenses

- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile

While most of the source tree has been included

- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
  use different header conventions.

doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.

See P2788 for the script that automated these edits.

Reviewed By: brecht, mont29, sergey

Ref D14069
2022-02-11 09:14:36 +11:00

90 lines
1.9 KiB
C++

/* SPDX-License-Identifier: GPL-2.0-or-later
* Copyright 2012 Blender Foundation. */
#pragma once
#include <string.h>
#include "COM_ConstantOperation.h"
#include "DNA_movieclip_types.h"
#include "DNA_tracking_types.h"
#include "BLI_listbase.h"
#include "BLI_string.h"
namespace blender::compositor {
/**
* Class with implementation of green screen gradient rasterization
*/
class TrackPositionOperation : public ConstantOperation {
protected:
MovieClip *movie_clip_;
int framenumber_;
char tracking_object_name_[64];
char track_name_[64];
int axis_;
int position_;
int relative_frame_;
bool speed_output_;
int width_, height_;
float marker_pos_[2];
float relative_pos_[2];
float track_position_;
bool is_track_position_calculated_;
/**
* Determine the output resolution. The resolution is retrieved from the Renderer
*/
void determine_canvas(const rcti &preferred_area, rcti &r_area) override;
public:
TrackPositionOperation();
void set_movie_clip(MovieClip *clip)
{
movie_clip_ = clip;
}
void set_tracking_object(char *object)
{
BLI_strncpy(tracking_object_name_, object, sizeof(tracking_object_name_));
}
void set_track_name(char *track)
{
BLI_strncpy(track_name_, track, sizeof(track_name_));
}
void set_framenumber(int framenumber)
{
framenumber_ = framenumber;
}
void set_axis(int value)
{
axis_ = value;
}
void set_position(int value)
{
position_ = value;
}
void set_relative_frame(int value)
{
relative_frame_ = value;
}
void set_speed_output(bool speed_output)
{
speed_output_ = speed_output;
}
void init_execution() override;
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override;
const float *get_constant_elem() override;
private:
void calc_track_position();
};
} // namespace blender::compositor