index.d.ts 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  1. /**
  2. * How to treat textures with premultiplied alpha
  3. * @name ALPHA_MODES
  4. * @memberof PIXI
  5. * @static
  6. * @enum {number}
  7. * @property {number} NO_PREMULTIPLIED_ALPHA - Source is not premultiplied, leave it like that.
  8. * Option for compressed and data textures that are created from typed arrays.
  9. * @property {number} PREMULTIPLY_ON_UPLOAD - Source is not premultiplied, premultiply on upload.
  10. * Default option, used for all loaded images.
  11. * @property {number} PREMULTIPLIED_ALPHA - Source is already premultiplied
  12. * Example: spine atlases with `_pma` suffix.
  13. * @property {number} NPM - Alias for NO_PREMULTIPLIED_ALPHA.
  14. * @property {number} UNPACK - Default option, alias for PREMULTIPLY_ON_UPLOAD.
  15. * @property {number} PMA - Alias for PREMULTIPLIED_ALPHA.
  16. */
  17. export declare enum ALPHA_MODES {
  18. NPM = 0,
  19. UNPACK = 1,
  20. PMA = 2,
  21. NO_PREMULTIPLIED_ALPHA = 0,
  22. PREMULTIPLY_ON_UPLOAD = 1,
  23. PREMULTIPLY_ALPHA = 2,
  24. PREMULTIPLIED_ALPHA = 2
  25. }
  26. /**
  27. * Various blend modes supported by PIXI.
  28. *
  29. * IMPORTANT - The WebGL renderer only supports the NORMAL, ADD, MULTIPLY and SCREEN blend modes.
  30. * Anything else will silently act like NORMAL.
  31. * @memberof PIXI
  32. * @name BLEND_MODES
  33. * @enum {number}
  34. * @property {number} NORMAL -
  35. * @property {number} ADD -
  36. * @property {number} MULTIPLY -
  37. * @property {number} SCREEN -
  38. * @property {number} OVERLAY -
  39. * @property {number} DARKEN -
  40. * @property {number} LIGHTEN -
  41. * @property {number} COLOR_DODGE -
  42. * @property {number} COLOR_BURN -
  43. * @property {number} HARD_LIGHT -
  44. * @property {number} SOFT_LIGHT -
  45. * @property {number} DIFFERENCE -
  46. * @property {number} EXCLUSION -
  47. * @property {number} HUE -
  48. * @property {number} SATURATION -
  49. * @property {number} COLOR -
  50. * @property {number} LUMINOSITY -
  51. * @property {number} NORMAL_NPM -
  52. * @property {number} ADD_NPM -
  53. * @property {number} SCREEN_NPM -
  54. * @property {number} NONE -
  55. * @property {number} SRC_IN -
  56. * @property {number} SRC_OUT -
  57. * @property {number} SRC_ATOP -
  58. * @property {number} DST_OVER -
  59. * @property {number} DST_IN -
  60. * @property {number} DST_OUT -
  61. * @property {number} DST_ATOP -
  62. * @property {number} SUBTRACT -
  63. * @property {number} SRC_OVER -
  64. * @property {number} ERASE -
  65. * @property {number} XOR -
  66. */
  67. export declare enum BLEND_MODES {
  68. NORMAL = 0,
  69. ADD = 1,
  70. MULTIPLY = 2,
  71. SCREEN = 3,
  72. OVERLAY = 4,
  73. DARKEN = 5,
  74. LIGHTEN = 6,
  75. COLOR_DODGE = 7,
  76. COLOR_BURN = 8,
  77. HARD_LIGHT = 9,
  78. SOFT_LIGHT = 10,
  79. DIFFERENCE = 11,
  80. EXCLUSION = 12,
  81. HUE = 13,
  82. SATURATION = 14,
  83. COLOR = 15,
  84. LUMINOSITY = 16,
  85. NORMAL_NPM = 17,
  86. ADD_NPM = 18,
  87. SCREEN_NPM = 19,
  88. NONE = 20,
  89. SRC_OVER = 0,
  90. SRC_IN = 21,
  91. SRC_OUT = 22,
  92. SRC_ATOP = 23,
  93. DST_OVER = 24,
  94. DST_IN = 25,
  95. DST_OUT = 26,
  96. DST_ATOP = 27,
  97. ERASE = 26,
  98. SUBTRACT = 28,
  99. XOR = 29
  100. }
  101. /**
  102. * Bitwise OR of masks that indicate the buffers to be cleared.
  103. * @static
  104. * @memberof PIXI
  105. * @name BUFFER_BITS
  106. * @enum {number}
  107. * @property {number} COLOR - Indicates the buffers currently enabled for color writing.
  108. * @property {number} DEPTH - Indicates the depth buffer.
  109. * @property {number} STENCIL - Indicates the stencil buffer.
  110. */
  111. export declare enum BUFFER_BITS {
  112. COLOR = 16384,
  113. DEPTH = 256,
  114. STENCIL = 1024
  115. }
  116. /**
  117. * Constants for various buffer types in Pixi
  118. * @see PIXI.BUFFER_TYPE
  119. * @name BUFFER_TYPE
  120. * @memberof PIXI
  121. * @static
  122. * @enum {number}
  123. * @property {number} ELEMENT_ARRAY_BUFFER - buffer type for using as an index buffer
  124. * @property {number} ARRAY_BUFFER - buffer type for using attribute data
  125. * @property {number} UNIFORM_BUFFER - the buffer type is for uniform buffer objects
  126. */
  127. export declare enum BUFFER_TYPE {
  128. ELEMENT_ARRAY_BUFFER = 34963,
  129. ARRAY_BUFFER = 34962,
  130. UNIFORM_BUFFER = 35345
  131. }
  132. /**
  133. * Configure whether filter textures are cleared after binding.
  134. *
  135. * Filter textures need not be cleared if the filter does not use pixel blending. {@link CLEAR_MODES.BLIT} will detect
  136. * this and skip clearing as an optimization.
  137. * @name CLEAR_MODES
  138. * @memberof PIXI
  139. * @static
  140. * @enum {number}
  141. * @property {number} BLEND - Do not clear the filter texture. The filter's output will blend on top of the output texture.
  142. * @property {number} CLEAR - Always clear the filter texture.
  143. * @property {number} BLIT - Clear only if {@link FilterSystem.forceClear} is set or if the filter uses pixel blending.
  144. * @property {number} NO - Alias for BLEND, same as `false` in earlier versions
  145. * @property {number} YES - Alias for CLEAR, same as `true` in earlier versions
  146. * @property {number} AUTO - Alias for BLIT
  147. */
  148. export declare enum CLEAR_MODES {
  149. NO = 0,
  150. YES = 1,
  151. AUTO = 2,
  152. BLEND = 0,
  153. CLEAR = 1,
  154. BLIT = 2
  155. }
  156. /**
  157. * Bitwise OR of masks that indicate the color channels that are rendered to.
  158. * @static
  159. * @memberof PIXI
  160. * @name COLOR_MASK_BITS
  161. * @enum {number}
  162. * @property {number} RED - Red channel.
  163. * @property {number} GREEN - Green channel
  164. * @property {number} BLUE - Blue channel.
  165. * @property {number} ALPHA - Alpha channel.
  166. */
  167. export declare enum COLOR_MASK_BITS {
  168. RED = 1,
  169. GREEN = 2,
  170. BLUE = 4,
  171. ALPHA = 8
  172. }
  173. /**
  174. * Various webgl draw modes. These can be used to specify which GL drawMode to use
  175. * under certain situations and renderers.
  176. * @memberof PIXI
  177. * @static
  178. * @name DRAW_MODES
  179. * @enum {number}
  180. * @property {number} POINTS -
  181. * @property {number} LINES -
  182. * @property {number} LINE_LOOP -
  183. * @property {number} LINE_STRIP -
  184. * @property {number} TRIANGLES -
  185. * @property {number} TRIANGLE_STRIP -
  186. * @property {number} TRIANGLE_FAN -
  187. */
  188. export declare enum DRAW_MODES {
  189. POINTS = 0,
  190. LINES = 1,
  191. LINE_LOOP = 2,
  192. LINE_STRIP = 3,
  193. TRIANGLES = 4,
  194. TRIANGLE_STRIP = 5,
  195. TRIANGLE_FAN = 6
  196. }
  197. /**
  198. * Different types of environments for WebGL.
  199. * @static
  200. * @memberof PIXI
  201. * @name ENV
  202. * @enum {number}
  203. * @property {number} WEBGL_LEGACY - Used for older v1 WebGL devices. PixiJS will aim to ensure compatibility
  204. * with older / less advanced devices. If you experience unexplained flickering prefer this environment.
  205. * @property {number} WEBGL - Version 1 of WebGL
  206. * @property {number} WEBGL2 - Version 2 of WebGL
  207. */
  208. export declare enum ENV {
  209. WEBGL_LEGACY = 0,
  210. WEBGL = 1,
  211. WEBGL2 = 2
  212. }
  213. /**
  214. * Various GL texture/resources formats.
  215. * @memberof PIXI
  216. * @static
  217. * @name FORMATS
  218. * @enum {number}
  219. * @property {number} [RGBA=6408] -
  220. * @property {number} [RGB=6407] -
  221. * @property {number} [RG=33319] -
  222. * @property {number} [RED=6403] -
  223. * @property {number} [RGBA_INTEGER=36249] -
  224. * @property {number} [RGB_INTEGER=36248] -
  225. * @property {number} [RG_INTEGER=33320] -
  226. * @property {number} [RED_INTEGER=36244] -
  227. * @property {number} [ALPHA=6406] -
  228. * @property {number} [LUMINANCE=6409] -
  229. * @property {number} [LUMINANCE_ALPHA=6410] -
  230. * @property {number} [DEPTH_COMPONENT=6402] -
  231. * @property {number} [DEPTH_STENCIL=34041] -
  232. */
  233. export declare enum FORMATS {
  234. RGBA = 6408,
  235. RGB = 6407,
  236. RG = 33319,
  237. RED = 6403,
  238. RGBA_INTEGER = 36249,
  239. RGB_INTEGER = 36248,
  240. RG_INTEGER = 33320,
  241. RED_INTEGER = 36244,
  242. ALPHA = 6406,
  243. LUMINANCE = 6409,
  244. LUMINANCE_ALPHA = 6410,
  245. DEPTH_COMPONENT = 6402,
  246. DEPTH_STENCIL = 34041
  247. }
  248. /**
  249. * The gc modes that are supported by pixi.
  250. *
  251. * The {@link PIXI.settings.GC_MODE} Garbage Collection mode for PixiJS textures is AUTO
  252. * If set to GC_MODE, the renderer will occasionally check textures usage. If they are not
  253. * used for a specified period of time they will be removed from the GPU. They will of course
  254. * be uploaded again when they are required. This is a silent behind the scenes process that
  255. * should ensure that the GPU does not get filled up.
  256. *
  257. * Handy for mobile devices!
  258. * This property only affects WebGL.
  259. * @name GC_MODES
  260. * @enum {number}
  261. * @static
  262. * @memberof PIXI
  263. * @property {number} AUTO - Garbage collection will happen periodically automatically
  264. * @property {number} MANUAL - Garbage collection will need to be called manually
  265. */
  266. export declare enum GC_MODES {
  267. AUTO = 0,
  268. MANUAL = 1
  269. }
  270. /**
  271. * Constants for mask implementations.
  272. * We use `type` suffix because it leads to very different behaviours
  273. * @name MASK_TYPES
  274. * @memberof PIXI
  275. * @static
  276. * @enum {number}
  277. * @property {number} NONE - Mask is ignored
  278. * @property {number} SCISSOR - Scissor mask, rectangle on screen, cheap
  279. * @property {number} STENCIL - Stencil mask, 1-bit, medium, works only if renderer supports stencil
  280. * @property {number} SPRITE - Mask that uses SpriteMaskFilter, uses temporary RenderTexture
  281. * @property {number} COLOR - Color mask (RGBA)
  282. */
  283. export declare enum MASK_TYPES {
  284. NONE = 0,
  285. SCISSOR = 1,
  286. STENCIL = 2,
  287. SPRITE = 3,
  288. COLOR = 4
  289. }
  290. /**
  291. * Mipmap filtering modes that are supported by pixi.
  292. *
  293. * The {@link PIXI.settings.MIPMAP_TEXTURES} affects default texture filtering.
  294. * Mipmaps are generated for a baseTexture if its `mipmap` field is `ON`,
  295. * or its `POW2` and texture dimensions are powers of 2.
  296. * Due to platform restriction, `ON` option will work like `POW2` for webgl-1.
  297. *
  298. * This property only affects WebGL.
  299. * @name MIPMAP_MODES
  300. * @memberof PIXI
  301. * @static
  302. * @enum {number}
  303. * @property {number} OFF - No mipmaps
  304. * @property {number} POW2 - Generate mipmaps if texture dimensions are pow2
  305. * @property {number} ON - Always generate mipmaps
  306. * @property {number} ON_MANUAL - Use mipmaps, but do not auto-generate them; this is used with a resource
  307. * that supports buffering each level-of-detail.
  308. */
  309. export declare enum MIPMAP_MODES {
  310. OFF = 0,
  311. POW2 = 1,
  312. ON = 2,
  313. ON_MANUAL = 3
  314. }
  315. /**
  316. * Constants for multi-sampling antialiasing.
  317. * @see PIXI.Framebuffer#multisample
  318. * @name MSAA_QUALITY
  319. * @memberof PIXI
  320. * @static
  321. * @enum {number}
  322. * @property {number} NONE - No multisampling for this renderTexture
  323. * @property {number} LOW - Try 2 samples
  324. * @property {number} MEDIUM - Try 4 samples
  325. * @property {number} HIGH - Try 8 samples
  326. */
  327. export declare enum MSAA_QUALITY {
  328. NONE = 0,
  329. LOW = 2,
  330. MEDIUM = 4,
  331. HIGH = 8
  332. }
  333. /**
  334. * Constants that specify float precision in shaders.
  335. * @name PRECISION
  336. * @memberof PIXI
  337. * @constant
  338. * @static
  339. * @enum {string}
  340. * @property {string} [LOW='lowp'] -
  341. * @property {string} [MEDIUM='mediump'] -
  342. * @property {string} [HIGH='highp'] -
  343. */
  344. export declare enum PRECISION {
  345. LOW = "lowp",
  346. MEDIUM = "mediump",
  347. HIGH = "highp"
  348. }
  349. /**
  350. * Constant to identify the Renderer Type.
  351. * @static
  352. * @memberof PIXI
  353. * @name RENDERER_TYPE
  354. * @enum {number}
  355. * @property {number} UNKNOWN - Unknown render type.
  356. * @property {number} WEBGL - WebGL render type.
  357. * @property {number} CANVAS - Canvas render type.
  358. */
  359. export declare enum RENDERER_TYPE {
  360. UNKNOWN = 0,
  361. WEBGL = 1,
  362. CANVAS = 2
  363. }
  364. /**
  365. * Various sampler types. Correspond to `sampler`, `isampler`, `usampler` GLSL types respectively.
  366. * WebGL1 works only with FLOAT.
  367. * @memberof PIXI
  368. * @static
  369. * @name SAMPLER_TYPES
  370. * @enum {number}
  371. * @property {number} [FLOAT=0] -
  372. * @property {number} [INT=1] -
  373. * @property {number} [UINT=2] -
  374. */
  375. export declare enum SAMPLER_TYPES {
  376. FLOAT = 0,
  377. INT = 1,
  378. UINT = 2
  379. }
  380. /**
  381. * The scale modes that are supported by pixi.
  382. *
  383. * The {@link PIXI.settings.SCALE_MODE} scale mode affects the default scaling mode of future operations.
  384. * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability.
  385. * @memberof PIXI
  386. * @static
  387. * @name SCALE_MODES
  388. * @enum {number}
  389. * @property {number} LINEAR Smooth scaling
  390. * @property {number} NEAREST Pixelating scaling
  391. */
  392. export declare enum SCALE_MODES {
  393. NEAREST = 0,
  394. LINEAR = 1
  395. }
  396. /**
  397. * Various GL target types.
  398. * @memberof PIXI
  399. * @static
  400. * @name TARGETS
  401. * @enum {number}
  402. * @property {number} [TEXTURE_2D=3553] -
  403. * @property {number} [TEXTURE_CUBE_MAP=34067] -
  404. * @property {number} [TEXTURE_2D_ARRAY=35866] -
  405. * @property {number} [TEXTURE_CUBE_MAP_POSITIVE_X=34069] -
  406. * @property {number} [TEXTURE_CUBE_MAP_NEGATIVE_X=34070] -
  407. * @property {number} [TEXTURE_CUBE_MAP_POSITIVE_Y=34071] -
  408. * @property {number} [TEXTURE_CUBE_MAP_NEGATIVE_Y=34072] -
  409. * @property {number} [TEXTURE_CUBE_MAP_POSITIVE_Z=34073] -
  410. * @property {number} [TEXTURE_CUBE_MAP_NEGATIVE_Z=34074] -
  411. */
  412. export declare enum TARGETS {
  413. TEXTURE_2D = 3553,
  414. TEXTURE_CUBE_MAP = 34067,
  415. TEXTURE_2D_ARRAY = 35866,
  416. TEXTURE_CUBE_MAP_POSITIVE_X = 34069,
  417. TEXTURE_CUBE_MAP_NEGATIVE_X = 34070,
  418. TEXTURE_CUBE_MAP_POSITIVE_Y = 34071,
  419. TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072,
  420. TEXTURE_CUBE_MAP_POSITIVE_Z = 34073,
  421. TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074
  422. }
  423. /**
  424. * Various GL data format types.
  425. * @memberof PIXI
  426. * @static
  427. * @name TYPES
  428. * @enum {number}
  429. * @property {number} [UNSIGNED_BYTE=5121] -
  430. * @property {number} [UNSIGNED_SHORT=5123] -
  431. * @property {number} [UNSIGNED_SHORT_5_6_5=33635] -
  432. * @property {number} [UNSIGNED_SHORT_4_4_4_4=32819] -
  433. * @property {number} [UNSIGNED_SHORT_5_5_5_1=32820] -
  434. * @property {number} [UNSIGNED_INT=5125] -
  435. * @property {number} [UNSIGNED_INT_10F_11F_11F_REV=35899] -
  436. * @property {number} [UNSIGNED_INT_2_10_10_10_REV=33640] -
  437. * @property {number} [UNSIGNED_INT_24_8=34042] -
  438. * @property {number} [UNSIGNED_INT_5_9_9_9_REV=35902] -
  439. * @property {number} [BYTE=5120] -
  440. * @property {number} [SHORT=5122] -
  441. * @property {number} [INT=5124] -
  442. * @property {number} [FLOAT=5126] -
  443. * @property {number} [FLOAT_32_UNSIGNED_INT_24_8_REV=36269] -
  444. * @property {number} [HALF_FLOAT=36193] -
  445. */
  446. export declare enum TYPES {
  447. UNSIGNED_BYTE = 5121,
  448. UNSIGNED_SHORT = 5123,
  449. UNSIGNED_SHORT_5_6_5 = 33635,
  450. UNSIGNED_SHORT_4_4_4_4 = 32819,
  451. UNSIGNED_SHORT_5_5_5_1 = 32820,
  452. UNSIGNED_INT = 5125,
  453. UNSIGNED_INT_10F_11F_11F_REV = 35899,
  454. UNSIGNED_INT_2_10_10_10_REV = 33640,
  455. UNSIGNED_INT_24_8 = 34042,
  456. UNSIGNED_INT_5_9_9_9_REV = 35902,
  457. BYTE = 5120,
  458. SHORT = 5122,
  459. INT = 5124,
  460. FLOAT = 5126,
  461. FLOAT_32_UNSIGNED_INT_24_8_REV = 36269,
  462. HALF_FLOAT = 36193
  463. }
  464. /**
  465. * The wrap modes that are supported by pixi.
  466. *
  467. * The {@link PIXI.settings.WRAP_MODE} wrap mode affects the default wrapping mode of future operations.
  468. * It can be re-assigned to either CLAMP or REPEAT, depending upon suitability.
  469. * If the texture is non power of two then clamp will be used regardless as WebGL can
  470. * only use REPEAT if the texture is po2.
  471. *
  472. * This property only affects WebGL.
  473. * @name WRAP_MODES
  474. * @memberof PIXI
  475. * @static
  476. * @enum {number}
  477. * @property {number} CLAMP - The textures uvs are clamped
  478. * @property {number} REPEAT - The texture uvs tile and repeat
  479. * @property {number} MIRRORED_REPEAT - The texture uvs tile and repeat with mirroring
  480. */
  481. export declare enum WRAP_MODES {
  482. CLAMP = 33071,
  483. REPEAT = 10497,
  484. MIRRORED_REPEAT = 33648
  485. }
  486. export { }