org.rrd4j.graph

## Class ImageWorker

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

- Direct Known Subclasses:
    BufferedImageWorker, SVGImageWorker

      public abstract class ImageWorker
      extends Object

  Abstract base class for image workers in RRD graphs. Provides drawing operations for creating graph images with various output formats.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ImageWorker()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `(package private) void` | `clip(int x, int y, int width, int height)`
    `(package private) void` | `dispose()`
    `(package private) void` | `drawLine(int x1, int y1, int x2, int y2, Paint paint, Stroke stroke)`
    `(package private) void` | `drawPolyline(double[] x, double[] y, Paint paint, Stroke stroke)`
    `(package private) void` | `drawString(String text, int x, int y, Font font, Paint paint)`
    `(package private) void` | `fillPolygon(double[] x, double[] yBottom, double[] yTop, Paint paint)`
    `(package private) void` | `fillPolygon(double[] x, double yBottom, double[] yTop, Paint paint)`
    `(package private) void` | `fillRect(int x, int y, int width, int height, Paint paint)`
    `(package private) double` | `getFontAscent(Font font)`
    `(package private) double` | `getFontHeight(Font font)`
    `(package private) byte[]` | `getImageBytes()`
    `(package private) double` | `getStringWidth(String text, Font font)`
    `(package private) void` | `loadImage(RrdGraphDef.ImageSource imageSource, int x, int y, int w, int h)`
    `(package private) abstract void` | `makeImage(OutputStream os)`
    `(package private) void` | `makeImage(Path path)`
    `(package private) void` | `reset()`
    `protected abstract void` | `reset(Graphics2D g2d)`
    `(package private) abstract void` | `resize(int width, int height)`
    `(package private) void` | `saveImage(String path)`
    `(package private) void` | `setAntiAliasing(boolean enable)`
    `protected void` | `setG2d(Graphics2D g2d)` Sets the graphics context for drawing operations.
    `(package private) void` | `setTextAntiAliasing(boolean enable)`
    `(package private) void` | `transform(int x, int y, double angle)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ImageWorker

          public ImageWorker()

  - ### Method Detail

    - #### clip

          void clip(int x,
                    int y,
                    int width,
                    int height)

    - #### dispose

          void dispose()

    - #### drawLine

          void drawLine(int x1,
                        int y1,
                        int x2,
                        int y2,
                        Paint paint,
                        Stroke stroke)

    - #### drawPolyline

          void drawPolyline(double[] x,
                            double[] y,
                            Paint paint,
                            Stroke stroke)

    - #### drawString

          void drawString(String text,
                          int x,
                          int y,
                          Font font,
                          Paint paint)

    - #### fillPolygon

          void fillPolygon(double[] x,
                           double[] yBottom,
                           double[] yTop,
                           Paint paint)

    - #### fillPolygon

          void fillPolygon(double[] x,
                           double yBottom,
                           double[] yTop,
                           Paint paint)

    - #### fillRect

          void fillRect(int x,
                        int y,
                        int width,
                        int height,
                        Paint paint)

    - #### getFontAscent

          double getFontAscent(Font font)

    - #### getFontHeight

          double getFontHeight(Font font)

    - #### getImageBytes

          byte[] getImageBytes()
                        throws IOException

      Throws:
        `IOException`

    - #### getStringWidth

          double getStringWidth(String text,
                                Font font)

    - #### loadImage

          void loadImage(RrdGraphDef.ImageSource imageSource,
                         int x,
                         int y,
                         int w,
                         int h)
                  throws IOException

      Throws:
        `IOException`

    - #### makeImage

          abstract void makeImage(OutputStream os)
                           throws IOException

      Throws:
        `IOException`

    - #### makeImage

          void makeImage(Path path)
                  throws IOException

      Throws:
        `IOException`

    - #### reset

          void reset()

    - #### reset

          protected abstract void reset(Graphics2D g2d)

    - #### resize

          abstract void resize(int width,
                               int height)

    - #### saveImage

          void saveImage(String path)
                  throws IOException

      Throws:
        `IOException`

    - #### setAntiAliasing

          void setAntiAliasing(boolean enable)

    - #### setG2d

          protected void setG2d(Graphics2D g2d)

      Sets the graphics context for drawing operations. Disposes of previous context if exists.
      Parameters:
        `g2d` - new graphics context

    - #### setTextAntiAliasing

          void setTextAntiAliasing(boolean enable)

    - #### transform

          void transform(int x,
                         int y,
                         double angle)