vendor/imagine/imagine/src/Image/ImagineInterface.php line 36

Open in your IDE?
  1. <?php
  2. /*
  3. * This file is part of the Imagine package.
  4. *
  5. * (c) Bulat Shakirzyanov <mallluhuct@gmail.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Imagine\Image;
  11. use Imagine\Factory\ClassFactoryAwareInterface;
  12. use Imagine\Image\Metadata\MetadataReaderInterface;
  13. use Imagine\Image\Palette\Color\ColorInterface;
  14. /**
  15. * The imagine interface.
  16. */
  17. interface ImagineInterface extends ClassFactoryAwareInterface
  18. {
  19. const VERSION = '1.3.4';
  20. /**
  21. * Creates a new empty image with an optional background color.
  22. *
  23. * @param \Imagine\Image\BoxInterface $size
  24. * @param \Imagine\Image\Palette\Color\ColorInterface $color
  25. *
  26. * @throws \Imagine\Exception\InvalidArgumentException
  27. * @throws \Imagine\Exception\RuntimeException
  28. *
  29. * @return \Imagine\Image\ImageInterface
  30. */
  31. public function create(BoxInterface $size, ColorInterface $color = null);
  32. /**
  33. * Opens an existing image from $path.
  34. *
  35. * @param string|\Imagine\File\LoaderInterface|mixed $path the file path, a LoaderInterface instance, or an object whose string representation is the image path
  36. *
  37. * @throws \Imagine\Exception\RuntimeException
  38. *
  39. * @return \Imagine\Image\ImageInterface
  40. */
  41. public function open($path);
  42. /**
  43. * Loads an image from a binary $string.
  44. *
  45. * @param string $string
  46. *
  47. * @throws \Imagine\Exception\RuntimeException
  48. *
  49. * @return \Imagine\Image\ImageInterface
  50. */
  51. public function load($string);
  52. /**
  53. * Loads an image from a resource $resource.
  54. *
  55. * @param resource $resource
  56. *
  57. * @throws \Imagine\Exception\RuntimeException
  58. *
  59. * @return \Imagine\Image\ImageInterface
  60. */
  61. public function read($resource);
  62. /**
  63. * Constructs a font with specified $file, $size and $color.
  64. *
  65. * The font size is to be specified in points (e.g. 10pt means 10)
  66. *
  67. * @param string $file
  68. * @param int $size
  69. * @param \Imagine\Image\Palette\Color\ColorInterface $color
  70. *
  71. * @return \Imagine\Image\FontInterface
  72. */
  73. public function font($file, $size, ColorInterface $color);
  74. /**
  75. * Set the object to be used to read image metadata.
  76. *
  77. * @param \Imagine\Image\Metadata\MetadataReaderInterface $metadataReader
  78. *
  79. * @return $this
  80. */
  81. public function setMetadataReader(MetadataReaderInterface $metadataReader);
  82. /**
  83. * Get the object to be used to read image metadata.
  84. *
  85. * @return \Imagine\Image\Metadata\MetadataReaderInterface
  86. */
  87. public function getMetadataReader();
  88. }