I am working on implementing a kind of vision sensor where the picture should only be rendered into a buffer from which I can read it out and send it to OpenCV. While the general setup works, I am a little bit confused cause it seems I can only create a texture buffer (which I use because of its get_ram_image() method) after having created an output buffer. Even though I do not need the latter one if I want to run without visual output. In detail, my code looks like this:
frame_buffer_properties = FrameBufferProperties.get_default() window_properties = WindowProperties.size(1, 1) graphics_engine = GraphicsEngine.get_global_ptr() selection = GraphicsPipeSelection.get_global_ptr() graphics_pipe = selection.make_default_pipe() buffer_stupid = graphics_engine.makeOutput( pipe=graphics_pipe, name='test camera', sort=0, fb_prop=frame_buffer_properties, win_prop=window_properties, flags=GraphicsPipe.BFRefuseWindow) buffer = buffer_stupid.make_texture_buffer( name='test', x_size=100, y_size=100, tex=Texture(), to_ram=True) display_region = self.buffer.make_display_region() self.cam = Camera('test camera') self.camera = self.world.render.attach_new_node(self.cam)
so later on, I can call
texture = self.buffer.get_texture() ram = texture.get_ram_image()
My question is, whether I really need the buffer_stupid object and - if yes - why?
Thanks again for your help!