Class SerializingLayer

Inheritance Relationships

Base Type

Class Documentation

class cpphots::SerializingLayer : public cpphots::interfaces::Clonable<SerializingLayer, interfaces::EventRemapper>

Changes the output of a Layer to a single dimension.

If added to a Layer, output events will be remapped to a single dimension, as follows: {t, w*h*k + w*y + x, 0, 0} where k is the clustering output and w,h are the dimensions of the context.

Public Functions

inline SerializingLayer()

Construct a new SerializingLayer modifier.

This constructor should not be used explicitly, it is provided only to load this modifier from a stream.

SerializingLayer(uint16_t width, uint16_t height)

Construct a new SerializingLayer modifier.

Parameters
  • width – horizontal size of the context

  • height – vertical size of the context

virtual event remapEvent(event ev, uint16_t k) override

Remap event.

Parameters
  • ev – event

  • k – cluster id

Returns

remapped event

std::pair<uint16_t, uint16_t> getSize() const

Returns the size of the context.

Returns

{width, height}

virtual void toStream(std::ostream &out) const override

Insert to stream.

Parameters

out – stream where to insert to

virtual void fromStream(std::istream &in) override

Extract from stream.

Parameters/current state is expected to be overwritten or invalidated.

Parameters

in – stream where to extract from