Package 

Interface CoverService

  • All Implemented Interfaces:
    org.readium.r2.shared.publication.Publication.Service , org.readium.r2.shared.util.Closeable

    
    public interface CoverService
     implements Publication.Service
                        

    Provides an easy access to a bitmap version of the publication cover.

    While at first glance, getting the cover could be seen as a helper, the implementation actually depends on the publication format:

    • Some might allow vector images or even HTML pages, in which case they need to be converted to bitmaps.

    • Others require to render the cover from a specific file format, e.g. PDF.

    Furthermore, a reading app might want to use a custom strategy to choose the cover image, for example by:

    • iterating through the images collection for a publication parsed from an OPDS 2 feed

    • generating a bitmap from scratch using the publication's title

    • using a cover selected by the user.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Bitmap cover() Returns the publication cover as a Bitmap at its maximum size.
      Bitmap coverFitting(Size maxSize) Returns the publication cover as a Bitmap, scaled down to fit the given maxSize.
      • Methods inherited from class org.readium.r2.shared.publication.Publication.Service

        close, get, getLinks
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • cover

         abstract Bitmap cover()

        Returns the publication cover as a Bitmap at its maximum size.

        If the cover is not a bitmap format (e.g. SVG), it should be scaled down to fit the screen.