IPlatformRenderInterface.cs 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // Copyright (c) The Perspex Project. All rights reserved.
  2. // Licensed under the MIT license. See licence.md file in the project root for full license information.
  3. using System.IO;
  4. using Perspex.Media;
  5. namespace Perspex.Platform
  6. {
  7. /// <summary>
  8. /// Defines the main platform-specific interface for the rendering subsystem.
  9. /// </summary>
  10. public interface IPlatformRenderInterface
  11. {
  12. /// <summary>
  13. /// Creates a bitmap implementation.
  14. /// </summary>
  15. /// <param name="width">The width of the bitmap.</param>
  16. /// <param name="height">The height of the bitmap.</param>
  17. /// <returns>An <see cref="IBitmapImpl"/>.</returns>
  18. IBitmapImpl CreateBitmap(int width, int height);
  19. /// <summary>
  20. /// Creates a formatted text implementation.
  21. /// </summary>
  22. /// <param name="text">The text.</param>
  23. /// <param name="fontFamilyName">The font family.</param>
  24. /// <param name="fontSize">The font size.</param>
  25. /// <param name="fontStyle">The font style.</param>
  26. /// <param name="textAlignment">The text alignment.</param>
  27. /// <param name="fontWeight">The font weight.</param>
  28. /// <returns>An <see cref="IFormattedTextImpl"/>.</returns>
  29. IFormattedTextImpl CreateFormattedText(
  30. string text,
  31. string fontFamilyName,
  32. double fontSize,
  33. FontStyle fontStyle,
  34. TextAlignment textAlignment,
  35. FontWeight fontWeight);
  36. /// <summary>
  37. /// Creates a stream geometry implementation.
  38. /// </summary>
  39. /// <returns>An <see cref="IStreamGeometryImpl"/>.</returns>
  40. IStreamGeometryImpl CreateStreamGeometry();
  41. /// <summary>
  42. /// Creates a renderer.
  43. /// </summary>
  44. /// <param name="handle">The platform handle for the renderer.</param>
  45. /// <param name="width">The initial width of the render.</param>
  46. /// <param name="height">The initial height of the render.</param>
  47. /// <returns>An <see cref="IRenderer"/>.</returns>
  48. IRenderer CreateRenderer(IPlatformHandle handle, double width, double height);
  49. /// <summary>
  50. /// Creates a render target bitmap implementation.
  51. /// </summary>
  52. /// <param name="width">The width of the bitmap.</param>
  53. /// <param name="height">The height of the bitmap.</param>
  54. /// <returns>An <see cref="IRenderTargetBitmapImpl"/>.</returns>
  55. IRenderTargetBitmapImpl CreateRenderTargetBitmap(int width, int height);
  56. /// <summary>
  57. /// Loads a bitmap implementation from a file..
  58. /// </summary>
  59. /// <param name="fileName">The filename of the bitmap.</param>
  60. /// <returns>An <see cref="IBitmapImpl"/>.</returns>
  61. IBitmapImpl LoadBitmap(string fileName);
  62. /// <summary>
  63. /// Loads a bitmap implementation from a file..
  64. /// </summary>
  65. /// <param name="stream">The stream to read the bitmap from.</param>
  66. /// <returns>An <see cref="IBitmapImpl"/>.</returns>
  67. IBitmapImpl LoadBitmap(Stream stream);
  68. }
  69. }