|
| 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 |
|
| DataOutport (std::string_view identifier, Document help={}) |
|
virtual glm::uvec3 | getColorCode () const override |
|
virtual std::shared_ptr< const Image > | getData () const |
|
virtual void | setData (const Image *data) |
|
void | setData (Image &&data) |
|
virtual bool | hasData () const override |
|
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 () |
|
| 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 |
|
virtual const_iterator | begin () const override |
|
virtual const_iterator | end () const override |
|
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. (
- See also
- ImageExport,
-
CanvasProcessorWidget)
-
BaseImageInport
-
ResizeEvent