/// <summary> /// Initializes the grid. /// </summary> /// <param name="shape">The grid's observation shape.</param> /// <param name="name">The name of the grid instance.</param> public ChannelGrid(GridShape shape, string name = "Grid") { m_Shape = shape; m_Name = name; Allocate(); }
/// <summary> /// Initializes the grid. /// </summary> /// <param name="channels">The number of channels.</param> /// <param name="width">The width of the grid.</param> /// <param name="height">The height of the grid.</param> /// <param name="name">The name of the grid instance.</param> public ChannelGrid(int channels, int width, int height, string name = "Grid") { m_Shape = new GridShape(channels, width, height); m_Name = name; Allocate(); }
protected void Allocate() { m_Shape = m_Grid.Shape; if (m_Compression == SensorCompressionType.PNG) { m_Texture2D = new Texture2D(m_Shape.Width, m_Shape.Height, TextureFormat.RGB24, false); m_Bytes = new List <byte>(); } }
/// <inheritdoc/> public override ISensor[] CreateSensors() { if (GridBuffer == null) { // Create GridBuffer if none was provided. // The ColorGridBuffer supports PNG compression. GridShape.Validate(); GridBuffer = new ColorGridBuffer(GridShape); } return(base.CreateSensors()); }
/// <summary> /// Initializes the grid. /// </summary> /// <param name="shape">The grid's observation shape.</param> /// <param name="name">The name of the grid instance.</param> public PixelGrid(GridShape shape, string name = "PixelGrid") : base(shape, name) { }