CoverService class abstract

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.
Inheritance
Implementers

Constructors

CoverService()

Properties

hashCode int
The hash code for this object.
no setterinherited
Links which will be added to Publication.links. It can be used to expose a web API for the service, through Publication.get.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serviceType Type
This is the supertype of the service that the subclass is implementing
no setteroverride

Methods

close() → void
Closes any opened file handles, removes temporary files, etc.
inherited
cover() Future<Image?>
Returns the publication cover as a Bitmap at its maximum size.
coverFitting(ImageSize maxSize) Future<Image?>
Returns the publication cover as a Bitmap, scaled down to fit the given maxSize.
get(Link link) Resource?
A service can return a Resource to:
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited