VexFlowMusicSheetDrawer.d.ts 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import { MusicSheetDrawer } from "../MusicSheetDrawer";
  2. import { RectangleF2D } from "../../../Common/DataObjects/RectangleF2D";
  3. import { VexFlowMeasure } from "./VexFlowMeasure";
  4. import { PointF2D } from "../../../Common/DataObjects/PointF2D";
  5. import { GraphicalLabel } from "../GraphicalLabel";
  6. export declare class VexFlowMusicSheetDrawer extends MusicSheetDrawer {
  7. private renderer;
  8. private vfctx;
  9. private ctx;
  10. private titles;
  11. private zoom;
  12. constructor(titles: HTMLElement, canvas: HTMLCanvasElement, isPreviewImageDrawer?: boolean);
  13. /**
  14. * Zoom the rendering areas
  15. * @param k is the zoom factor
  16. */
  17. scale(k: number): void;
  18. /**
  19. * Resize the rendering areas
  20. * @param x
  21. * @param y
  22. */
  23. resize(x: number, y: number): void;
  24. translate(x: number, y: number): void;
  25. /**
  26. * Converts a distance from unit to pixel space.
  27. * @param unitDistance the distance in units
  28. * @returns {number} the distance in pixels
  29. */
  30. calculatePixelDistance(unitDistance: number): number;
  31. protected drawMeasure(measure: VexFlowMeasure): void;
  32. /**
  33. * Renders a Label to the screen (e.g. Title, composer..)
  34. * @param graphicalLabel holds the label string, the text height in units and the font parameters
  35. * @param layer is the current rendering layer. There are many layers on top of each other to which can be rendered. Not needed for now.
  36. * @param bitmapWidth Not needed for now.
  37. * @param bitmapHeight Not needed for now.
  38. * @param heightInPixel the height of the text in screen coordinates
  39. * @param screenPosition the position of the lower left corner of the text in screen coordinates
  40. */
  41. protected renderLabel(graphicalLabel: GraphicalLabel, layer: number, bitmapWidth: number, bitmapHeight: number, heightInPixel: number, screenPosition: PointF2D): void;
  42. /**
  43. * Renders a rectangle with the given style to the screen.
  44. * It is given in screen coordinates.
  45. * @param rectangle the rect in screen coordinates
  46. * @param layer is the current rendering layer. There are many layers on top of each other to which can be rendered. Not needed for now.
  47. * @param styleId the style id
  48. */
  49. protected renderRectangle(rectangle: RectangleF2D, layer: number, styleId: number): void;
  50. /**
  51. * Converts a point from unit to pixel space.
  52. * @param point
  53. * @returns {PointF2D}
  54. */
  55. protected applyScreenTransformation(point: PointF2D): PointF2D;
  56. /**
  57. * Converts a rectangle from unit to pixel space.
  58. * @param rectangle
  59. * @returns {RectangleF2D}
  60. */
  61. protected applyScreenTransformationForRect(rectangle: RectangleF2D): RectangleF2D;
  62. }