Class RenderUtility


  • public class RenderUtility
    extends Object
    Creation-Date: 12.05.2007, 15:58:43
    Author:
    Thomas Morgner
    • Method Detail

      • getEncoderQuality

        public static float getEncoderQuality​(ReportAttributeMap attributeMap)
      • encodeImage

        public static byte[] encodeImage​(Image image)
                                  throws org.pentaho.reporting.libraries.base.encoder.UnsupportedEncoderException,
                                         IOException
        Encodes the given image as PNG, stores the image in the generated file and returns the name of the new image file.
        Parameters:
        image - the image to be encoded
        Returns:
        the name of the image, never null.
        Throws:
        IOException - if an IO error occurred.
        org.pentaho.reporting.libraries.base.encoder.UnsupportedEncoderException
      • encodeImage

        public static byte[] encodeImage​(Image image,
                                         String mimeType,
                                         float quality,
                                         boolean alpha)
                                  throws org.pentaho.reporting.libraries.base.encoder.UnsupportedEncoderException,
                                         IOException
        Throws:
        org.pentaho.reporting.libraries.base.encoder.UnsupportedEncoderException
        IOException
      • encodeImage

        public static void encodeImage​(OutputStream outputStream,
                                       Image image,
                                       String mimeType,
                                       float quality,
                                       boolean alpha)
                                throws org.pentaho.reporting.libraries.base.encoder.UnsupportedEncoderException,
                                       IOException
        Throws:
        org.pentaho.reporting.libraries.base.encoder.UnsupportedEncoderException
        IOException
      • scaleImage

        public static Image scaleImage​(Image img,
                                       int targetWidth,
                                       int targetHeight,
                                       Object hintValue,
                                       boolean higherQuality)
      • computeHorizontalAlignment

        public static long computeHorizontalAlignment​(ElementAlignment alignment,
                                                      long width,
                                                      long imageWidth)
      • computeVerticalAlignment

        public static long computeVerticalAlignment​(ElementAlignment alignment,
                                                    long height,
                                                    long imageHeight)