class_docstr: Render context superclass for offscreen and window rendering.
class_docstr_tok: ["Render","context","superclass","for","offscreen","and","window","rendering","."]
code: def __init__(self, model, data, offscreen=True):
      self.model = model
      self.data = data
      self.offscreen = offscreen
      self.offwidth = model.vis.global_.offwidth
      self.offheight = model.vis.global_.offheight
      max_geom = 1000
  
      mujoco.mj_forward(self.model, self.data)
  
      self.scn = mujoco.MjvScene(self.model, max_geom)
      self.cam = mujoco.MjvCamera()
      self.vopt = mujoco.MjvOption()
      self.pert = mujoco.MjvPerturb()
      self.con = mujoco.MjrContext(
          self.model, mujoco.mjtFontScale.mjFONTSCALE_150
      )
  
      self._markers = []
      self._overlays = {}
  
      self._init_camera()
      self._set_mujoco_buffers()
  
imports: import collections
  import os
  import time
  from threading import Lock
  import glfw
  import imageio
  import mujoco
  import numpy
label_desc: Use image node_id 1 to create a new RenderContext object  with example: obj = RenderContext(model, data, offscreen)