Skip to content

Commit c279b2b

Browse files
committed
Changed VirtualPixelMethod enum into a const and type.
1 parent 1787ebd commit c279b2b

File tree

2 files changed

+22
-20
lines changed

2 files changed

+22
-20
lines changed

src/enums/virtual-pixel-method.ts

+21-19
Original file line numberDiff line numberDiff line change
@@ -6,89 +6,91 @@
66
/**
77
* Specifies the types of virtual pixel methods.
88
*/
9-
export enum VirtualPixelMethod {
9+
export const VirtualPixelMethod = {
1010
/**
1111
* Undefined.
1212
*/
13-
Undefined,
13+
Undefined: 0,
1414

1515
/**
1616
* Background.
1717
*/
18-
Background,
18+
Background: 1,
1919

2020
/**
2121
* Dither.
2222
*/
23-
Dither,
23+
Dither: 2,
2424

2525
/**
2626
* Edge.
2727
*/
28-
Edge,
28+
Edge: 3,
2929

3030
/**
3131
* Mirror.
3232
*/
33-
Mirror,
33+
Mirror: 4,
3434

3535
/**
3636
* Random.
3737
*/
38-
Random,
38+
Random: 5,
3939

4040
/**
4141
* Tile.
4242
*/
43-
Tile,
43+
Tile: 6,
4444

4545
/**
4646
* Transparent.
4747
*/
48-
Transparent,
48+
Transparent: 7,
4949

5050
/**
5151
* Mask.
5252
*/
53-
Mask,
53+
Mask: 8,
5454

5555
/**
5656
* Black.
5757
*/
58-
Black,
58+
Black: 9,
5959

6060
/**
6161
* Gray.
6262
*/
63-
Gray,
63+
Gray: 10,
6464

6565
/**
6666
* White.
6767
*/
68-
White,
68+
White: 11,
6969

7070
/**
7171
* Horizontal tile.
7272
*/
73-
HorizontalTile,
73+
HorizontalTile: 12,
7474

7575
/**
7676
* Vertical tile.
7777
*/
78-
VerticalTile,
78+
VerticalTile: 13,
7979

8080
/**
8181
* Horizontal tile edge.
8282
*/
83-
HorizontalTileEdge,
83+
HorizontalTileEdge: 14,
8484

8585
/**
8686
* Vertical tile edge.
8787
*/
88-
VerticalTileEdge,
88+
VerticalTileEdge: 15,
8989

9090
/**
9191
* Checker tile.
9292
*/
93-
CheckerTile
94-
}
93+
CheckerTile: 16
94+
} as const;
95+
96+
export type VirtualPixelMethod = typeof VirtualPixelMethod[keyof typeof VirtualPixelMethod];

src/magick-image.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2296,7 +2296,7 @@ export class MagickImage extends NativeInstance implements IMagickImage {
22962296
}
22972297

22982298
get virtualPixelMethod(): VirtualPixelMethod {
2299-
return ImageMagick._api._MagickImage_VirtualPixelMethod_Get(this._instance);
2299+
return <VirtualPixelMethod>ImageMagick._api._MagickImage_VirtualPixelMethod_Get(this._instance);
23002300
}
23012301
set virtualPixelMethod(value: VirtualPixelMethod) {
23022302
this.useExceptionPointer(exception => {

0 commit comments

Comments
 (0)