Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
darbyjohnston committed Aug 17, 2024
1 parent 6e4b25e commit 95267fe
Show file tree
Hide file tree
Showing 51 changed files with 461 additions and 465 deletions.
22 changes: 11 additions & 11 deletions lib/toucan/BoxOp.cpp → lib/toucan/Box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,35 @@
// Copyright (c) 2024 Darby Johnston
// All rights reserved.

#include "BoxOp.h"
#include "Box.h"

#include "Util.h"

#include <OpenImageIO/imagebufalgo.h>

namespace toucan
{
BoxOp::BoxOp(
BoxNode::BoxNode(
const BoxData& data,
const std::vector<std::shared_ptr<IImageOp> >& inputs) :
IImageOp(inputs),
const std::vector<std::shared_ptr<IImageNode> >& inputs) :
IImageNode(inputs),
_data(data)
{}

BoxOp::~BoxOp()
BoxNode::~BoxNode()
{}

const BoxData& BoxOp::getData() const
const BoxData& BoxNode::getData() const
{
return _data;
}

void BoxOp::setData(const BoxData& value)
void BoxNode::setData(const BoxData& value)
{
_data = value;
}

OIIO::ImageBuf BoxOp::exec(
OIIO::ImageBuf BoxNode::exec(
const OTIO_NS::RationalTime& time,
const std::shared_ptr<Host>& host)
{
Expand Down Expand Up @@ -65,10 +65,10 @@ namespace toucan
BoxEffect::~BoxEffect()
{}

std::shared_ptr<IImageOp> BoxEffect::createOp(
const std::vector<std::shared_ptr<IImageOp> >& inputs)
std::shared_ptr<IImageNode> BoxEffect::createNode(
const std::vector<std::shared_ptr<IImageNode> >& inputs)
{
return std::make_shared<BoxOp>(_data, inputs);
return std::make_shared<BoxNode>(_data, inputs);
}

bool BoxEffect::read_from(Reader& reader)
Expand Down
16 changes: 8 additions & 8 deletions lib/toucan/BoxOp.h → lib/toucan/Box.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#pragma once

#include <toucan/ImageOp.h>
#include <toucan/ImageNode.h>

namespace toucan
{
Expand All @@ -17,15 +17,15 @@ namespace toucan
bool fill = true;
};

//! Box drawing operation.
class BoxOp : public IImageOp
//! Box drawing node.
class BoxNode : public IImageNode
{
public:
BoxOp(
BoxNode(
const BoxData& = BoxData(),
const std::vector<std::shared_ptr<IImageOp> >& = {});
const std::vector<std::shared_ptr<IImageNode> >& = {});

virtual ~BoxOp();
virtual ~BoxNode();

const BoxData& getData() const;
void setData(const BoxData&);
Expand Down Expand Up @@ -53,8 +53,8 @@ namespace toucan
std::string const& effect_name = std::string(),
OTIO_NS::AnyDictionary const& metadata = OTIO_NS::AnyDictionary());

std::shared_ptr<IImageOp> createOp(
const std::vector<std::shared_ptr<IImageOp> >& inputs) override;
std::shared_ptr<IImageNode> createNode(
const std::vector<std::shared_ptr<IImageNode> >& inputs) override;

protected:
virtual ~BoxEffect();
Expand Down
80 changes: 40 additions & 40 deletions lib/toucan/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
set(HEADERS
BoxOp.h
CheckersOp.h
ColorMapOp.h
CompOp.h
FillOp.h
FlipOp.h
FlopOp.h
Box.h
Checkers.h
ColorMap.h
Comp.h
Fill.h
Flip.h
Flop.h
Host.h
ImageOp.h
ImageNode.h
Init.h
InvertOp.h
LineOp.h
LinearTimeWarpOp.h
NoiseOp.h
Invert.h
Line.h
LinearTimeWarp.h
Noise.h
Plugin.h
PowOp.h
Pow.h
PropertySet.h
ReadOp.h
ResizeOp.h
RotateOp.h
SaturateOp.h
SequenceReadOp.h
TextOp.h
Read.h
Resize.h
Rotate.h
Saturate.h
SequenceRead.h
Text.h
TimelineTraverse.h
TransitionOp.h
Transition.h
Util.h)
set(HEADERS_PRIVATE)
set(SOURCE
BoxOp.cpp
CheckersOp.cpp
ColorMapOp.cpp
CompOp.cpp
FillOp.cpp
FlipOp.cpp
FlopOp.cpp
Box.cpp
Checkers.cpp
ColorMap.cpp
Comp.cpp
Fill.cpp
Flip.cpp
Flop.cpp
Host.cpp
ImageOp.cpp
ImageNode.cpp
Init.cpp
InvertOp.cpp
LineOp.cpp
LinearTimeWarpOp.cpp
NoiseOp.cpp
Invert.cpp
Line.cpp
LinearTimeWarp.cpp
Noise.cpp
Plugin.cpp
PowOp.cpp
Pow.cpp
PropertySet.cpp
ReadOp.cpp
ResizeOp.cpp
RotateOp.cpp
SaturateOp.cpp
SequenceReadOp.cpp
TextOp.cpp
Read.cpp
Resize.cpp
Rotate.cpp
Saturate.cpp
SequenceRead.cpp
Text.cpp
TimelineTraverse.cpp
TransitionOp.cpp
Transition.cpp
Util.cpp)
if(WIN32)
list(APPEND SOURCE
Expand Down
22 changes: 11 additions & 11 deletions lib/toucan/CheckersOp.cpp → lib/toucan/Checkers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,35 @@
// Copyright (c) 2024 Darby Johnston
// All rights reserved.

#include "CheckersOp.h"
#include "Checkers.h"

#include "Util.h"

#include <OpenImageIO/imagebufalgo.h>

namespace toucan
{
CheckersOp::CheckersOp(
CheckersNode::CheckersNode(
const CheckersData& data,
const std::vector<std::shared_ptr<IImageOp> >& inputs) :
IImageOp(inputs),
const std::vector<std::shared_ptr<IImageNode> >& inputs) :
IImageNode(inputs),
_data(data)
{}

CheckersOp::~CheckersOp()
CheckersNode::~CheckersNode()
{}

const CheckersData& CheckersOp::getData() const
const CheckersData& CheckersNode::getData() const
{
return _data;
}

void CheckersOp::setData(const CheckersData& value)
void CheckersNode::setData(const CheckersData& value)
{
_data = value;
}

OIIO::ImageBuf CheckersOp::exec(
OIIO::ImageBuf CheckersNode::exec(
const OTIO_NS::RationalTime& time,
const std::shared_ptr<Host>& host)
{
Expand Down Expand Up @@ -77,10 +77,10 @@ namespace toucan
CheckersEffect::~CheckersEffect()
{}

std::shared_ptr<IImageOp> CheckersEffect::createOp(
const std::vector<std::shared_ptr<IImageOp> >& inputs)
std::shared_ptr<IImageNode> CheckersEffect::createNode(
const std::vector<std::shared_ptr<IImageNode> >& inputs)
{
return std::make_shared<CheckersOp>(_data, inputs);
return std::make_shared<CheckersNode>(_data, inputs);
}

bool CheckersEffect::read_from(Reader& reader)
Expand Down
16 changes: 8 additions & 8 deletions lib/toucan/CheckersOp.h → lib/toucan/Checkers.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#pragma once

#include <toucan/ImageOp.h>
#include <toucan/ImageNode.h>

namespace toucan
{
Expand All @@ -17,15 +17,15 @@ namespace toucan
IMATH_NAMESPACE::V4f color2 = IMATH_NAMESPACE::V4f(0.F, 0.F, 0.F, 1.F);
};

//! Checkers operation.
class CheckersOp : public IImageOp
//! Checkers node.
class CheckersNode : public IImageNode
{
public:
CheckersOp(
CheckersNode(
const CheckersData& = CheckersData(),
const std::vector<std::shared_ptr<IImageOp> >& = {});
const std::vector<std::shared_ptr<IImageNode> >& = {});

virtual ~CheckersOp();
virtual ~CheckersNode();

const CheckersData& getData() const;
void setData(const CheckersData&);
Expand Down Expand Up @@ -53,8 +53,8 @@ namespace toucan
std::string const& effect_name = std::string(),
OTIO_NS::AnyDictionary const& metadata = OTIO_NS::AnyDictionary());

std::shared_ptr<IImageOp> createOp(
const std::vector<std::shared_ptr<IImageOp> >& inputs) override;
std::shared_ptr<IImageNode> createNode(
const std::vector<std::shared_ptr<IImageNode> >& inputs) override;

protected:
virtual ~CheckersEffect();
Expand Down
22 changes: 11 additions & 11 deletions lib/toucan/ColorMapOp.cpp → lib/toucan/ColorMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@
// Copyright (c) 2024 Darby Johnston
// All rights reserved.

#include "ColorMapOp.h"
#include "ColorMap.h"

#include <OpenImageIO/imagebufalgo.h>

namespace toucan
{
ColorMapOp::ColorMapOp(
ColorMapNode::ColorMapNode(
const ColorMapData& data,
const std::vector<std::shared_ptr<IImageOp> >& inputs) :
IImageOp(inputs),
const std::vector<std::shared_ptr<IImageNode> >& inputs) :
IImageNode(inputs),
_data(data)
{}

ColorMapOp::~ColorMapOp()
ColorMapNode::~ColorMapNode()
{}

const ColorMapData& ColorMapOp::getData() const
const ColorMapData& ColorMapNode::getData() const
{
return _data;
}

void ColorMapOp::setData(const ColorMapData& value)
void ColorMapNode::setData(const ColorMapData& value)
{
_data = value;
}

OIIO::ImageBuf ColorMapOp::exec(
OIIO::ImageBuf ColorMapNode::exec(
const OTIO_NS::RationalTime& time,
const std::shared_ptr<Host>& host)
{
Expand Down Expand Up @@ -64,10 +64,10 @@ namespace toucan
ColorMapEffect::~ColorMapEffect()
{}

std::shared_ptr<IImageOp> ColorMapEffect::createOp(
const std::vector<std::shared_ptr<IImageOp> >& inputs)
std::shared_ptr<IImageNode> ColorMapEffect::createNode(
const std::vector<std::shared_ptr<IImageNode> >& inputs)
{
return std::make_shared<ColorMapOp>(_data, inputs);
return std::make_shared<ColorMapNode>(_data, inputs);
}

bool ColorMapEffect::read_from(Reader& reader)
Expand Down
16 changes: 8 additions & 8 deletions lib/toucan/ColorMapOp.h → lib/toucan/ColorMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#pragma once

#include <toucan/ImageOp.h>
#include <toucan/ImageNode.h>

namespace toucan
{
Expand All @@ -14,15 +14,15 @@ namespace toucan
std::string mapName;
};

//! Color map operation.
class ColorMapOp : public IImageOp
//! Color map node.
class ColorMapNode : public IImageNode
{
public:
ColorMapOp(
ColorMapNode(
const ColorMapData& = ColorMapData(),
const std::vector<std::shared_ptr<IImageOp> >& = {});
const std::vector<std::shared_ptr<IImageNode> >& = {});

virtual ~ColorMapOp();
virtual ~ColorMapNode();

const ColorMapData& getData() const;
void setData(const ColorMapData&);
Expand Down Expand Up @@ -50,8 +50,8 @@ namespace toucan
std::string const& effect_name = std::string(),
OTIO_NS::AnyDictionary const& metadata = OTIO_NS::AnyDictionary());

std::shared_ptr<IImageOp> createOp(
const std::vector<std::shared_ptr<IImageOp> >& inputs) override;
std::shared_ptr<IImageNode> createNode(
const std::vector<std::shared_ptr<IImageNode> >& inputs) override;

protected:
virtual ~ColorMapEffect();
Expand Down
Loading

0 comments on commit 95267fe

Please sign in to comment.