Class ImageRenderer

java.lang.Object
se.datadosen.jalbum.ImageRenderer

public class ImageRenderer
extends java.lang.Object
  • Constructor Details

  • Method Details

    • getAndResetIntermediateImage

      public java.awt.image.BufferedImage getAndResetIntermediateImage()
      Returns:
      Scaled image to be passed to the thumbnail processing stage
    • getCloseupRenditions

      public java.util.List<Rendition> getCloseupRenditions()
      Returns:
      Closeup (image) renditions, from largest to smallest. Includes the typical/base rendition too
    • getThumbRenditions

      public java.util.List<Rendition> getThumbRenditions()
      Returns:
      Thumbnail renditions, from largest to smallest. Includes the typical/base rendition too
    • getCloseupRenditions

      public java.util.List<Rendition> getCloseupRenditions​(OutputFormat format)
      Parameters:
      format - Specific image format to filter list on
      Returns:
      Closeup (image) renditions, from largest to smallest. Includes the typical/base rendition too
    • getThumbRenditions

      public java.util.List<Rendition> getThumbRenditions​(OutputFormat format)
      Parameters:
      format - Specific image format to filter list on
      Returns:
      Thumbnail renditions, from largest to smallest. Includes the typical/base rendition too
    • getTypical

      public static Rendition getTypical​(java.util.List<Rendition> renditions)
    • stripTypical

      public static java.util.List<Rendition> stripTypical​(java.util.List<Rendition> renditions)
    • buildSrcset

      public static java.lang.String buildSrcset​(java.util.List<Rendition> renditions, java.lang.String typicalPath)
      Generate a srcset attribute value for given list of renditions
      Parameters:
      renditions - Valid list or null
      typicalPath -
      Returns:
      srcset string or null if renditions argument is null
    • isVariant

      public static boolean isVariant​(java.lang.String testName, java.lang.String typicalName)
      Test if passed test file is a variant of typicalFile, i.e.follows the -nnnw pattern where nnn is the image width
      Parameters:
      testName -
      typicalName -
      Returns:
    • isVariant

      public static boolean isVariant​(java.lang.String testName, AlbumObject typicalAO)
    • isSameBase

      public static boolean isSameBase​(java.lang.String testName, AlbumObject typicalAO)
    • isSameRoot

      public static boolean isSameRoot​(java.lang.String testName, java.lang.String typicalName)
    • nameRoot

      public static java.lang.String nameRoot​(java.lang.String name)
    • nameSuffix

      public static java.lang.String nameSuffix​(java.lang.String name)