1
0

profile.go 971 B

12345678910111213141516171819202122232425262728
  1. // Package device holds the output settings for the target e-readers.
  2. package device
  3. // Profile describes how images are prepared for a reading device.
  4. type Profile struct {
  5. // MaxImageWidth and MaxImageHeight bound every image; larger images
  6. // are scaled down to fit, keeping their aspect ratio.
  7. MaxImageWidth, MaxImageHeight int
  8. // CoverWidth and CoverHeight are the size of the generated cover.
  9. CoverWidth, CoverHeight int
  10. // GrayLevels is the number of shades the panel shows. Line art is
  11. // quantized to this many levels.
  12. GrayLevels int
  13. // JPEGQuality is used for photos.
  14. JPEGQuality int
  15. }
  16. // EInk targets the reMarkable 2 (1404×1872) and the Kobo Clara HD
  17. // (1072×1448). Both are 3:4 grayscale panels with 16 shades, so images are
  18. // sized for the larger screen and the Kobo scales them down.
  19. var EInk = Profile{
  20. MaxImageWidth: 1404,
  21. MaxImageHeight: 1872,
  22. CoverWidth: 1404,
  23. CoverHeight: 1872,
  24. GrayLevels: 16,
  25. JPEGQuality: 80,
  26. }