/// <summary>
 /// Writes out the generated, uncompressed image to the provided <see cref="ObservationWriter"/>.
 /// </summary>
 /// <param name="writer">Where the observation is written to.</param>
 /// <returns></returns>
 public int Write(ObservationWriter writer)
 {
     using (TimerStack.Instance.Scoped("CameraSensor.WriteToTensor"))
     {
         ObservationToTexture(m_Camera, m_Texture, m_Width, m_Height);
         var numWritten = writer.WriteTexture(m_Texture, m_Grayscale);
         return(numWritten);
     }
 }
Esempio n. 2
0
 /// <inheritdoc/>
 public int Write(ObservationWriter writer)
 {
     using (TimerStack.Instance.Scoped("RenderTextureSensor.Write"))
     {
         ObservationToTexture(m_RenderTexture, m_Texture);
         var numWritten = writer.WriteTexture(m_Texture, m_Grayscale);
         return(numWritten);
     }
 }