de.caff.vic

## Class PhysicalSizeImageConverter

- java.lang.Object
- - de.caff.vic.PhysicalSizeImageConverter

-     public class PhysicalSizeImageConverter
      extends java.lang.Object

  Helper class allowing to provide an icon in a given physical size for a given graphics configuration.

  This class will only provide useful output if the graphics configuration is able to provide correct physical size information.

  Author:
    Rammi

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PhysicalSizeImageConverter(java.awt.GraphicsConfiguration graphicsConfig)` Constructor.
    `PhysicalSizeImageConverter(java.awt.GraphicsDevice graphicsDevice)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `javax.swing.Icon` | `getIcon(VectorImage image, double pointSize)` Get a square icon with the given physical size.
    `javax.swing.Icon` | `getIcon(VectorImage image, double pointWidth, double pointHeight)` Get an icon with the given physical width and height.
    `java.awt.Image` | `getImage(VectorImage icon, double pointSize)` Get a square image with the given physical size.
    `java.awt.Image` | `getImage(VectorImage icon, double pointWidth, double pointHeight)` Get an image for the given point width and height.

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

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

- - ### Constructor Detail

    - #### PhysicalSizeImageConverter

          public PhysicalSizeImageConverter(@NotNull
                                            java.awt.GraphicsConfiguration graphicsConfig)

      Constructor.
      Parameters:
        `graphicsConfig` - graphics config for which physically correctly sized images are requested

    - #### PhysicalSizeImageConverter

          public PhysicalSizeImageConverter(@NotNull
                                            java.awt.GraphicsDevice graphicsDevice)

      Constructor.
      Parameters:
        `graphicsDevice` - graphics device for which's default configuration physically correctly sized images are requested

  - ### Method Detail

    - #### getImage

          @NotNull
          public java.awt.Image getImage(@NotNull
                                                  VectorImage icon,
                                                  double pointSize)

      Get a square image with the given physical size.
      Parameters:
        `icon` - vector image
        `pointSize` - size of target image in points (i.e. 1/72 inch)
      Returns:
        image which which will be rendered to the given physical size as good as possible for the underlying graphics configuration

    - #### getImage

          @NotNull
          public java.awt.Image getImage(@NotNull
                                                  VectorImage icon,
                                                  double pointWidth,
                                                  double pointHeight)

      Get an image for the given point width and height.
      Parameters:
        `icon` - vector image
        `pointWidth` - width of target image in points (1/72 inch)
        `pointHeight` - height of target image in points (1/72 inch)
      Returns:
        image which will be rendered in the given physical size for the underlying graphics configuration as good as possible

    - #### getIcon

          public javax.swing.Icon getIcon(@NotNull
                                          VectorImage image,
                                          double pointSize)

      Get a square icon with the given physical size.
      Parameters:
        `image` - vector image
        `pointSize` - size of target icon in points (i.e. 1/72 inch)
      Returns:
        icon which will render in the given physical size for the underlying graphics configuration as good as possible

    - #### getIcon

          @NotNull
          public javax.swing.Icon getIcon(@NotNull
                                                   VectorImage image,
                                                   double pointWidth,
                                                   double pointHeight)

      Get an icon with the given physical width and height.
      Parameters:
        `image` - vector image
        `pointWidth` - width of target image in points (1/72 inch)
        `pointHeight` - height of target image in points (1/72 inch)
      Returns:
        icon which will render in the given physical size for the underlying graphics configuration as good as possible