class EposImage
extends XMLElement

An ePOS <image> element. Embeds an image into the output.

A bit of a work-in-progress.

Constructors

new
EposImage(image: EposImageData)

Properties

brightness: number

The gamma correction to use.

The image's color=. See EposImageColour.

Only colour1 is tested, due to the model I have not supporting any other value.

No-op when EposImage.prototype.mode === EposImageMode.Grayscale

The image's mode= and encoding function. See EposImageMode.

Only monochrome is tested, due to the model I have not supporting any other value.

protected
readonly
imageDataChild: XMLBinaryText

The raw child used for the pure image data. It's contents are replaced in the toString() function.

Methods

setBrightness(brightness: number): this

Chainable helper for setting this.brightness.

Chainable helper for setting this.halftone.

No-op when EposImage.prototype.mode === EposImageMode.Grayscale

toEposImageData(): Uint8Array

Returns a Uint8Array of the image data.

In Monochrome mode, this uses toMonoImage. In EposImageMode.Grayscale mode, this uses toGrayImage.

toString(): string

Converts this <image> to an XML String.

Calls EposImage.updateAttributes.

protected
updateAttributes(): void

Sets the mode=, width=, height= and color= XML attributes.