Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8092041

Write Only Image / Accumulation Buffer


    • Type: Enhancement
    • Status: Closed
    • Priority: P3
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: javafx
    • Labels:


      I want the ability to draw a node (or graph of nodes) into a buffer. This can currently be done by calling paint on the underlying SGNode with a BufferedImage's graphics context. I'd like a real API for this that can be easily hardware accelerated.

      * paints a node into an image. can paint a graph of nodes by nesting nodes inside of a group
      * not required to paint a whole scene into an image
      * not required to paint nodes which are already in a scene. can be restricted only to headless nodes
      * can draw into the image multiple times, compositing against current contents
      * can set a blend mode to use when compositing against current contents
      * can be cleared
      * does not allow direct access to the pixels (no getPixel(x,y) function), this allows for better hw acceleration since all operations can be done in the card with no texture readbacks.
      * images should be independent so we can swap them in and out of ImageViews (for use with creating live trails and other time based effects)

      API proposal:

      javafx.scene.image.WriteOnlyImage extends Image {
      public-init var width:Integer;
      public-init var height:Integer;
      // make fully transparent. erase all pixels.
      public function clear():Void;
      // draw node into buffer
      public function draw(node:Node):Void;
      // draw node using blend mode
      public function draw(node:Node, mode:BlendMode):Void;

      example usage:

      var nodes = Group { content: [ Rectangle { }, ImageView{image:Image{}}, Circle{} ] };
      var buffer = WriteOnlyImage { width: 100 height: 100 };
      var view = ImageView { image: buffer };

      Stage {
      scene: Scene {
      content: view




            • Assignee:
              kcr Kevin Rushforth
              jmarinacsunw Joshua Marinacci (Inactive)
            • Votes:
              1 Vote for this issue
              3 Start watching this issue


              • Created: