[]
        
(Showing Draft Content)

BilevelBitmap

DsPdfJS API v9.1.0


DsPdfJS API / BilevelBitmap

Class: BilevelBitmap

Represents a bi-level transparency mask or an image containing two colors: black and white in either a white-is-zero or black-is-zero format.

Extends

Constructors

Constructor

new BilevelBitmap(width, height, bbProperties?): BilevelBitmap

Creates a BilevelBitmap instance with optionally initialized pixels.

Parameters

width

number

The bi-level bitmap width, in pixels.

height

number

The bi-level bitmap height, in pixels.

bbProperties?

BilevelBitmapProperties

The settings for creating a bi-level bitmap.

Returns

BilevelBitmap

Overrides

ObjectBase.constructor

Constructor

new BilevelBitmap(om, width, height, bbProperties?): BilevelBitmap

Creates a BilevelBitmap instance with optionally initialized pixels.

Parameters

om

ObjectManager

An object manager that controls the lifetime of the BilevelBitmap object.

width

number

The bi-level bitmap width, in pixels.

height

number

The bi-level bitmap height, in pixels.

bbProperties?

BilevelBitmapProperties

The settings for creating a bi-level bitmap.

Returns

BilevelBitmap

Overrides

ObjectBase.constructor

Accessors

height

Get Signature

get height(): number

Gets the height of the BilevelBitmap, in pixels.

Returns

number


id

Get Signature

get id(): number

Gets the reference to the object.

Returns

number

Inherited from

ObjectBase.id


lowerBitsFirst

Get Signature

get lowerBitsFirst(): boolean

Gets or sets a value specifying whether pixels with lower column indices are stored in the lower-order bits of the byte.

Returns

boolean

Set Signature

set lowerBitsFirst(value): void

Gets or sets a value specifying whether pixels with lower column indices are stored in the lower-order bits of the byte.

Parameters
value

boolean

Returns

void


om

Get Signature

get om(): ObjectManager

Gets the owner ObjectManager instance.

Returns

ObjectManager

Inherited from

ObjectBase.om


transparencyMask

Get Signature

get transparencyMask(): boolean

Gets or sets a value indicating whether the image is used to define an alpha mask of another image.

Returns

boolean

Set Signature

set transparencyMask(value): void

Gets or sets a value indicating whether the image is used to define an alpha mask of another image.

Parameters
value

boolean

Returns

void


whiteIsZero

Get Signature

get whiteIsZero(): boolean

Gets or sets a value indicating whether 0 represents white and 1 represents black (if true) or vice versa (if false).

Returns

boolean

Set Signature

set whiteIsZero(value): void

Gets or sets a value indicating whether 0 represents white and 1 represents black (if true) or vice versa (if false).

Parameters
value

boolean

Returns

void


width

Get Signature

get width(): number

Gets the width of the BilevelBitmap, in pixels.

Returns

number

Methods

clear()

clear(value, bounds?): void

Clears the BilevelBitmap with the specified value (true is 1, false is 0).

Parameters

value

boolean

The value to fill the image (true is 1, false is 0).

bounds?

The target rectangle of the BilevelBitmap.

Bounds | null

Returns

void


clip()

clip(bounds, metadataOnly?): BilevelBitmap

Creates a new BilevelBitmap with a fragment of the image.

Parameters

bounds

Bounds

A clipping rectangle to be extracted as a new BilevelBitmap.

metadataOnly?

boolean = false

Specifies whether to copy the image metadata only, not actual pixel data.

Returns

BilevelBitmap

A new instance of the BilevelBitmap.


clone()

clone(metadataOnly?): BilevelBitmap

Creates a new BilevelBitmap with a copy of the image.

Parameters

metadataOnly?

boolean = false

specifies whether to copy the image metadata only, not actual pixel data.

Returns

BilevelBitmap

A new instance of the BilevelBitmap.


free()

free(): void

Detaches the object from the ObjectManager and deallocates its memory, if possible.

Returns

void

Inherited from

ObjectBase.free


invertColors()

invertColors(): void

Inverts all black pixels to white and all white pixels to black.

Returns

void


rebind()

rebind(omTo): void

Rebinds the object from the current ObjectManager to the specified one.

Parameters

omTo

ObjectManager

The new ObjectManager for the object.

Returns

void

Inherited from

ObjectBase.rebind


toBitmap()

toBitmap(): Bitmap

Creates a Bitmap instance from the current BilevelBitmap.

Returns

Bitmap

A new instance of the Bitmap class.