From 3d6822435ebb3e432597b3ca52155a2e63223ccb Mon Sep 17 00:00:00 2001 From: trillos Date: Mon, 16 Nov 2009 08:53:42 +0000 Subject: [PATCH] Changed transparency to transparencyBox --- .../src/bbPackRecalageTransparencyBox.cxx | 40 +++++++++++++++++ .../src/bbPackRecalageTransparencyBox.h | 43 +++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 PackRecalage/src/bbPackRecalageTransparencyBox.cxx create mode 100644 PackRecalage/src/bbPackRecalageTransparencyBox.h diff --git a/PackRecalage/src/bbPackRecalageTransparencyBox.cxx b/PackRecalage/src/bbPackRecalageTransparencyBox.cxx new file mode 100644 index 0000000..bfb6004 --- /dev/null +++ b/PackRecalage/src/bbPackRecalageTransparencyBox.cxx @@ -0,0 +1,40 @@ +#include "bbPackRecalageTransparencyBox.h" +#include "bbPackRecalagePackage.h" +namespace bbPackRecalage +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(PackRecalage,TransparencyBox) +BBTK_BLACK_BOX_IMPLEMENTATION(TransparencyBox,bbtk::AtomicBlackBox); +void TransparencyBox::Process() +{ + transparency->setImage1(bbGetInputIn1()); + transparency->setImage2(bbGetInputIn2()); + transparency->setPercent(bbGetInputPercent()); + transparency->calculateImage(); + + bbSetOutputOut(transparency->getImage()); +} +void TransparencyBox::bbUserSetDefaultValues() +{ + bbSetInputIn1(NULL); + bbSetInputIn2(NULL); + bbSetInputPercent(-1); + bbSetOutputOut(NULL); +} +void TransparencyBox::bbUserInitializeProcessing() +{ + transparency = new Transparency(); +} +void TransparencyBox::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbPackRecalage + + diff --git a/PackRecalage/src/bbPackRecalageTransparencyBox.h b/PackRecalage/src/bbPackRecalageTransparencyBox.h new file mode 100644 index 0000000..8eb228d --- /dev/null +++ b/PackRecalage/src/bbPackRecalageTransparencyBox.h @@ -0,0 +1,43 @@ +#ifndef __bbPackRecalageTransparencyV2_h_INCLUDED__ +#define __bbPackRecalageTransparencyV2_h_INCLUDED__ +#include "bbPackRecalage_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "vtkImageData.h" +#include "Transparency.h" + +namespace bbPackRecalage +{ + +class bbPackRecalage_EXPORT TransparencyBox + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(TransparencyBox,bbtk::AtomicBlackBox); + BBTK_DECLARE_INPUT(In1,vtkImageData*); + BBTK_DECLARE_INPUT(In2,vtkImageData*); + BBTK_DECLARE_INPUT(Percent,int); + BBTK_DECLARE_OUTPUT(Out,vtkImageData*); + BBTK_PROCESS(Process); + void Process(); + + private: + Transparency *transparency; +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(TransparencyBox,bbtk::AtomicBlackBox); +BBTK_NAME("TransparencyBox"); +BBTK_AUTHOR("jn.trillos44@uniandes.edu.co"); +BBTK_DESCRIPTION("Transparency between two images"); +BBTK_CATEGORY("filter"); +BBTK_INPUT(TransparencyBox,In1,"First image for transparency",vtkImageData*,""); +BBTK_INPUT(TransparencyBox,In2,"Second image for transparency",vtkImageData*,""); +BBTK_INPUT(TransparencyBox,Percent,"Percent of transparency for the second image",int,""); +BBTK_OUTPUT(TransparencyBox,Out,"Output Image",vtkImageData*,""); +BBTK_END_DESCRIBE_BLACK_BOX(TransparencyBox); +} +// EO namespace bbPackRecalage + +#endif // __bbPackRecalageTransparencyV2_h_INCLUDED__ + -- 2.47.1