![]() |
Inviwo 0.9.12-pre
Inviwo documentation
|
#include <imageport.h>
Public Member Functions | |
| ImageOutport (std::string_view identifier, Document help, const DataFormatBase *format=DataVec4UInt8::get(), HandleResizeEvents value=HandleResizeEvents::Yes) | |
| ImageOutport (std::string_view identifier, const DataFormatBase *format=DataVec4UInt8::get(), bool handleResizeEvents=true) | |
| ImageOutport (std::string_view identifier, bool handleResizeEvents) | |
| virtual std::string_view | getClassIdentifier () const override |
| virtual void | setData (std::shared_ptr< const Image >) override |
| virtual void | setData (const Image *data) override |
| void | setData (std::shared_ptr< Image >) |
| void | setData (Image *data) |
| virtual std::shared_ptr< const Image > | detachData () override |
| virtual void | clear () override |
| bool | hasEditableData () const |
| std::shared_ptr< Image > | getEditableData () const |
| std::shared_ptr< const Image > | getDataForPort (const Inport *port) const |
| void | propagateEvent (Event *event, Inport *source) override |
| const DataFormatBase * | getDataFormat () const |
| size2_t | getDimensions () const |
| void | setDimensions (const size2_t &newDimension) |
| void | setHandleResizeEvents (bool handleResizeEvents) |
| bool | isHandlingResizeEvents () const |
| virtual void | invalidate (InvalidationLevel invalidationLevel) override |
| virtual void | disconnectFrom (Inport *port) override |
| virtual void | connectTo (Inport *port) override |
| virtual Document | getInfo () const override |
| Public Member Functions inherited from inviwo::DataOutport< Image > | |
| DataOutport (std::string_view identifier, Document help={}) | |
| virtual glm::uvec3 | getColorCode () const override |
| virtual std::shared_ptr< const Image > | getData () const |
| virtual bool | hasData () const override |
| Public Member Functions inherited from inviwo::Outport | |
| virtual bool | isConnected () const override |
| virtual bool | isReady () const override |
| virtual InvalidationLevel | getInvalidationLevel () const |
| bool | isConnectedTo (const Inport *port) const |
| const std::vector< Inport * > & | getConnectedInports () const |
| const BaseCallBack * | onConnect (std::function< void()> lambda) |
| const BaseCallBack * | onDisconnect (std::function< void()> lambda) |
| void | removeOnConnect (const BaseCallBack *callback) |
| void | removeOnDisconnect (const BaseCallBack *callback) |
| virtual void | setValid () |
| Public Member Functions inherited from inviwo::Port | |
| Port (const Port &)=delete | |
| Port & | operator= (const Port &)=delete |
| Port (Port &&)=delete | |
| Port & | operator= (Port &&)=delete |
| const std::string & | getIdentifier () const |
| void | setIdentifier (const std::string &name) |
| Processor * | getProcessor () const |
| std::string | getPath () const |
| Get the port path i.e. <processor identifier>.<port identifier>. | |
| void | getPath (std::pmr::string &out) const |
| const Document & | getHelp () const |
| Document & | getHelp () |
| Port & | setHelp (Document help) |
| virtual void | serialize (Serializer &s) const override |
| virtual void | deserialize (Deserializer &d) override |
| Public Member Functions inherited from inviwo::OutportIterableImpl< DataOutport< Image >, Image > | |
| virtual const_iterator | begin () const override |
| virtual const_iterator | end () const override |
Friends | |
| template<size_t N> | |
| class | BaseImageInport |
Additional Inherited Members | |
| Public Types inherited from inviwo::DataOutport< Image > | |
| using | type |
| Public Types inherited from inviwo::OutportIterableImpl< DataOutport< Image >, Image > | |
| using | Container |
| using | const_iterator |
| Protected Member Functions inherited from inviwo::Outport | |
| Outport (std::string_view identifier, Document help) | |
| Protected Member Functions inherited from inviwo::Port | |
| Port (std::string_view identifier, Document help) | |
| void | setProcessor (Processor *processor) |
| Static Protected Member Functions inherited from inviwo::Outport | |
| static Document | getDefaultPortInfo (const Outport *port, std::string_view portname) |
| Protected Attributes inherited from inviwo::DataOutport< Image > | |
| std::shared_ptr< const Image > | data_ |
| Protected Attributes inherited from inviwo::Outport | |
| StateCoordinator< bool > | isReady_ |
| InvalidationLevel | invalidationLevel_ |
| std::vector< Inport * > | connectedInports_ |
| CallBackList | onConnectCallback_ |
| CallBackList | onDisconnectCallback_ |
| Protected Attributes inherited from inviwo::Port | |
| std::string | identifier_ |
| Processor * | processor_ |
| Document | help_ |
ImageOutport extends DataOutport<Image> with extra functionality for handing ResizeEvents. The following table explains the behaviors:
* ImageOutport * isHandlingResizeEvents() * * True (default) False * ┌──────────────────────────────────┬──────────────────────────────────┐ * │ Outport::Size = max(Inports │ Outport::Size = Outport::size │ * │ requested sizes) │ (no resize of data) │ * │ (resize the data in the outport │ │ * False │ if needed) │ │ * (default)│ │ │ * │ Inport::Size = Inport requested │ Inport::Size = Inport requested │ * │ size │ size │ * ImageInport │ (return a resized copy if │ (return a resized copy if │ * │ needed) │ needed) │ * isOutport- │ │ │ * Determining- ├──────────────────────────────────┼──────────────────────────────────┤ * Size() │ Outport::Size = max(all inports │ Outport::Size = Outport::Size │ * │ requested sizes) │ (no resize of data) │ * │ (resize the data in the outport │ │ * True │ if needed) │ │ * │ │ │ * │ Inport::Size = Outport::size │ Inport::Size = Outport::size │ * │ (no copy) │ (no copy) │ * │ │ │ * │ │ │ * └──────────────────────────────────┴──────────────────────────────────┘ *
The ImageOutport records all the requested sizes from all its connected inports. If the outport 'isHandlingResizeEvents', the port will resize its data to the largest the requested size and propagate that size and a new event upwards in the network. If it does not handle resize events, it will propagate the resize events but not resize its data.
When an inport is disconnected from a outport, the port will remove its requested size and propagate a new resize event upwards with the new largest size, given that the port handles resize events.
As soon as the network adds or removes a connection, all the image sinks (processors that consume images) are responsible for pushing a new resize event to the network to make sure that all the image ports in the network above have an up-to-date view on which image sizes to use. (
|
overridevirtual |
Clear the outport of any data
Reimplemented from inviwo::DataOutport< Image >.
|
overridevirtual |
Reimplemented from inviwo::Outport.
|
overridevirtual |
Return data and release ownership. Data in the port will be nullptr after call.
Reimplemented from inviwo::DataOutport< Image >.
|
overridevirtual |
Reimplemented from inviwo::Outport.
|
overridevirtual |
Reimplemented from inviwo::DataOutport< Image >.
|
overridevirtual |
This function should describe the state of the port and the data it holds. Derived ports should extend this function and add information about their state. The port help is usually included in this information. The description is usually shown as a tooltip in the GUI.
Reimplemented from inviwo::DataOutport< Image >.
|
overridevirtual |
Called by Processor::invalidate, will invalidate its connected inports.
Reimplemented from inviwo::Outport.
Handle resize event
Reimplemented from inviwo::Outport.
|
overridevirtual |
Reimplemented from inviwo::DataOutport< Image >.
| void inviwo::ImageOutport::setDimensions | ( | const size2_t & | newDimension | ) |
Set the dimensions of this port without propagating the size through the network. Will call setDimensions on the image contained within the port. This is a destructive operation. The image port has to own it's data for this to work.
| void inviwo::ImageOutport::setHandleResizeEvents | ( | bool | handleResizeEvents | ) |
Determine if the image data should be resized during a resize event. We will only resize if we own the data in the port.
| handleResizeEvents | True if data should be resized during a resize propagation, otherwise false |