File

src/lib/myScript/rendering/imageRenderer.ts

Description

Represent the Image Renderer. It's used to calculate the Image ink rendering in HTML5 canvas

Extends

AbstractRenderer

Constructor

constructor(context: CanvasRenderingContext2D)

Methods

drawComponents
drawComponents(components: any)

Draw components

Parameters :
  • components
Returns: void
drawRecognitionResult
drawRecognitionResult(components: AbstractComponent[], recognitionResult: Object)

Draw recognition result on HTML5 canvas.

Parameters :
  • components : Array
  • recognitionResult : Object
Returns: void
import { AbstractRenderer } from './abstractRenderer';
import { AbstractComponent } from '../input/generic/components/abstractComponent';

/**
 * Represent the Image Renderer. It's used to calculate the Image ink rendering in HTML5 canvas
 * 
 * @export
 * @class ImageRenderer
 * @extends {AbstractRenderer}
 */
export class ImageRenderer extends AbstractRenderer {
	constructor(context: CanvasRenderingContext2D) {
		super(context);
	}

	/**
	 * Draw components
	 *
	 * @method drawComponents
	 * @param {AbstractComponent[]} components
	 */
	drawComponents(components) {
		for (let i in components) {
			let component = components[i];
			if (component instanceof AbstractComponent) {
				super.drawComponent(components);
			} else {
				throw new Error('not implemented');
			}
		}
	};

	/**
	 * Draw recognition result on HTML5 canvas.
	 * 
	 * @param {Array<AbstractComponent>} components 
	 * @param {Object} recognitionResult 
	 * 
	 * @memberof ImageRenderer
	 */
	drawRecognitionResult(components: Array<AbstractComponent>, recognitionResult: Object) {
		throw new Error('not implemented');
	}
}

results matching ""

    No results matching ""