Class ImagePool

java.lang.Object
dev.prozilla.pine.common.asset.pool.AssetPool<Image>
dev.prozilla.pine.common.asset.pool.ImagePool
All Implemented Interfaces:
MultiAssetLoader<Image>, Destructible

public final class ImagePool extends AssetPool<Image> implements MultiAssetLoader<Image>
  • Constructor Details

    • ImagePool

      public ImagePool()
  • Method Details

    • load

      public Image load(String path)
      Description copied from class: AssetPool
      Loads an asset from a path or retrieves it from the pool if it has already been loaded once.

      This method is protected because some subclasses may require additional parameters to load an asset.

      Specified by:
      load in interface MultiAssetLoader<Image>
      Overrides:
      load in class AssetPool<Image>
      Parameters:
      path - The path of the asset
      Returns:
      The asset, or null if it failed to load.
    • createAsset

      protected Image createAsset(String path)
      Description copied from class: AssetPool
      Creates a new asset from a normalized path.
      Specified by:
      createAsset in class AssetPool<Image>
      Parameters:
      path - The normalized path
      Returns:
      The new asset, or null if the asset creation failed.
    • printInfo

      public void printInfo(Logger logger)
      Logs the amount of images in the resource pool per resolution.
      Overrides:
      printInfo in class AssetPool<Image>
    • getImageWidth

      public int getImageWidth(String path)
    • getImageHeight

      public int getImageHeight(String path)
    • getImageChannels

      public int getImageChannels(String path)