Class AWTImageViewport

    • Field Detail

      • image

        protected Image image
      • imageHeight

        protected int imageHeight
      • imageWidth

        protected int imageWidth
      • pixelScale

        protected Coord2d pixelScale
    • Constructor Detail

      • AWTImageViewport

        public AWTImageViewport()
    • Method Detail

      • render

        public void render​(IPainter painter)
        Description copied from interface: IImageViewport
        Renders the picture into the window, according to the viewport settings. If the picture is bigger than the viewport, it is simply centered in it, otherwise, it is scaled in order to fit into the viewport.
        Specified by:
        render in interface IImageViewport
      • renderImage

        protected void renderImage​(IPainter painter,
                                   ByteBuffer imageBuffer,
                                   int imageWidth,
                                   int imageHeight,
                                   int screenWidth,
                                   int screenHeight,
                                   float z)
      • updatePixelScale

        protected void updatePixelScale​(Coord2d pixelScale)
        Update internal pixel scale knowledge. Called by render loop and provided by painter's view. May be overrided to update the image.
      • setImage

        public void setImage​(Image image,
                             int width,
                             int height)
        Set the Image that will be displayed by the layer.
        Parameters:
        image -
      • setImage

        public void setImage​(Image image,
                             int width,
                             int height,
                             ByteBuffer buffer)
      • setImage

        public void setImage​(Image image)
      • setMargin

        public void setMargin​(Dimension margin)