java.lang.Object
org.rrd4j.graph.ImageWorker
org.rrd4j.graph.BufferedImageWorker

class BufferedImageWorkerextends ImageWorker
Image worker implementation that creates buffered images for RRD graphs. Provides functionality to create, manipulate, and save graph images in various formats.
  • Field Details

    • img

      private BufferedImage img
      The image being written out.
    • imgWidth

      private int imgWidth
      Width of the image.
    • imgHeight

      private int imgHeight
      Height of the image.
    • initialAffineTransform

      private AffineTransform initialAffineTransform
      Initial affine transform
    • writer

      private final ImageWriter writer
      Writer that writes the image out.
    • iwp

      private final ImageWriteParam iwp
      Parameters given to the writer.
  • Constructor Details

    • BufferedImageWorker

      private BufferedImageWorker(BufferedImageWorker.Builder builder)
      Builds the worker from its builder.
      Parameters:
      builder - the builder holding the image and parameters
    • BufferedImageWorker

      BufferedImageWorker(int width, int height)
      Not for use, only for tests
      Parameters:
      width - the width in pixels
      height - the height in pixels
  • Method Details

    • getBuilder

      public static BufferedImageWorker.Builder getBuilder()
      Creates a new builder for BufferedImageWorker.
      Returns:
      A new builder instance.
    • resize

      void resize(int width, int height)
      Resizes the worker to the specified dimensions.
      Specified by:
      resize in class ImageWorker
      Parameters:
      width - The new width in pixels.
      height - The new height in pixels.
    • reset

      protected void reset(Graphics2D g2d)
      Reset the allocator state
      Specified by:
      reset in class ImageWorker
      Parameters:
      g2d - the graphics context
    • makeImage

      void makeImage(OutputStream stream) throws IOException
      Creates and writes the image to the specified output stream.
      Specified by:
      makeImage in class ImageWorker
      Parameters:
      stream - The output stream to write the image to.
      Throws:
      IOException - If an I/O error occurs during writing.