Ejemplo n.º 1
0
        /// <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();
        }
Ejemplo n.º 2
0
        /// <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();
        }
Ejemplo n.º 3
0
        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>();
            }
        }
Ejemplo n.º 4
0
        /// <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());
        }
Ejemplo n.º 5
0
 /// <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)
 {
 }