Skip to content

Commit

Permalink
Chore: Cleanup constructor and options docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bigtimebuddy committed Mar 7, 2024
1 parent 932a5b9 commit c92302c
Show file tree
Hide file tree
Showing 38 changed files with 284 additions and 81 deletions.
82 changes: 77 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
"devDependencies": {
"@pixi/eslint-config": "^4.0.1",
"@pixi/extension-scripts": "^2.4.0",
"@pixi/webdoc-template": "^1.5.5",
"@pixi/webdoc-template": "^2.2.3",
"@types/gradient-parser": "^0.1.2",
"@webdoc/cli": "^2.2.0",
"base64-to-image": "^1.0.2",
Expand Down
5 changes: 4 additions & 1 deletion src/adjustment/AdjustmentFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { vertex, wgslVertex } from '../defaults';
import fragment from './adjustment.frag';
import source from './adjustment.wgsl';

/** Options for the AdjustmentFilter constructor */
export interface AdjustmentFilterOptions
{
/**
Expand Down Expand Up @@ -56,7 +57,6 @@ export interface AdjustmentFilterOptions
*
* @class
* @extends Filter
* @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}
*/
export class AdjustmentFilter extends Filter
{
Expand All @@ -80,6 +80,9 @@ export class AdjustmentFilter extends Filter
uColor: Float32Array;
};

/**
* @param options - The options of the adjustment filter.
*/
constructor(options?: AdjustmentFilterOptions)
{
options = { ...AdjustmentFilter.DEFAULT_OPTIONS, ...options };
Expand Down
5 changes: 4 additions & 1 deletion src/advanced-bloom/AdvancedBloomFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import fragment from './advanced-bloom.frag';
import source from './advanced-bloom.wgsl';
import { ExtractBrightnessFilter } from './ExtractBrightnessFilter';

/** Options for the AdvancedBloomFilter constructor. */
export interface AdvancedBloomFilterOptions
{
/**
Expand Down Expand Up @@ -54,7 +55,6 @@ export interface AdvancedBloomFilterOptions
*
* @class
* @extends Filter
* @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}
*/
export class AdvancedBloomFilter extends Filter
{
Expand Down Expand Up @@ -82,6 +82,9 @@ export class AdvancedBloomFilter extends Filter
private _extractFilter: ExtractBrightnessFilter;
private _blurFilter: KawaseBlurFilter;

/**
* @param options - Options for the AdvancedBloomFilter constructor.
*/
constructor(options?: AdvancedBloomFilterOptions)
{
options = { ...AdvancedBloomFilter.DEFAULT_OPTIONS, ...options };
Expand Down
7 changes: 6 additions & 1 deletion src/ascii/AsciiFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import source from './ascii.wgsl';

// This WebGPU filter has been ported from the WebGL renderer that was originally created by Vico (@vicocotea)

/** Options for AsciiFilter constructor. */
export interface AsciiFilterOptions
{
/**
Expand Down Expand Up @@ -34,7 +35,6 @@ export interface AsciiFilterOptions
*
* @class
* @extends Filter
* @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}
*/
export class AsciiFilter extends Filter
{
Expand All @@ -53,13 +53,18 @@ export class AsciiFilter extends Filter

private _color!: Color;

/**
* Constructor.
* @param {AsciiFilterOptions} options - The options of the ASCII filter.
*/
constructor(options?: AsciiFilterOptions);
/**
* @deprecated since 6.0.0
*
* @param {number} [size=8] - Size of the font
*/
constructor(size: number);
/** @ignore */
constructor(...args: [AsciiFilterOptions?] | [number])
{
let options = args[0] ?? {};
Expand Down
11 changes: 3 additions & 8 deletions src/backdrop-blur/BackdropBlurFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,21 @@ import { vertex, wgslVertex } from '../defaults';
import fragment from './backdrop-blur-blend.frag';
import wgslFragment from './backdrop-blur-blend.wgsl';

export type BackdropBlurFilterOptions = BlurFilterOptions;

/**
* The BackdropBlurFilter applies a Gaussian blur to everything behind an object, and then draws the object on top of it.
* The BackdropBlurFilter applies a Gaussian blur to everything behind an object, and then draws the object on top of it.<br>
* ![original](../screenshots/original.png)![filter](../screenshots/backdrop-blur.png)
*
* @class
* @extends BlurFilter
* @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}
*/
export class BackdropBlurFilter extends BlurFilter
{
private _blendPass: Filter;

/**
* @param options - The options of the blur filter.
* @param options.strength - The strength of the blur filter.
* @param options.quality - The quality of the blur filter.
* @param options.kernelSize - The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15.
*/
constructor(options?: BackdropBlurFilterOptions)
constructor(options?: BlurFilterOptions)
{
super(options);

Expand Down
5 changes: 4 additions & 1 deletion src/bevel/BevelFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { vertex, wgslVertex } from '../defaults';
import fragment from './bevel.frag';
import source from './bevel.wgsl';

/** Options for the BevelFilter constructor. */
export interface BevelFilterOptions
{
/**
Expand Down Expand Up @@ -45,7 +46,6 @@ export interface BevelFilterOptions
*
* @class
* @extends Filter
* @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}
*/
export class BevelFilter extends Filter
{
Expand All @@ -72,6 +72,9 @@ export class BevelFilter extends Filter
private _lightColor: Color;
private _shadowColor: Color;

/**
* @param options - Options for the BevelFilter constructor.
*/
constructor(options?: BevelFilterOptions)
{
options = { ...BevelFilter.DEFAULT_OPTIONS, ...options };
Expand Down
9 changes: 8 additions & 1 deletion src/bloom/BloomFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {

type DeprecatedBlurValue = number | PointData | number[];

/** Options for the BloomFilter constructor. */
export interface BloomFilterOptions
{
/**
Expand Down Expand Up @@ -43,7 +44,6 @@ export interface BloomFilterOptions
*
* @class
* @extends Filter
* @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}
*/
export class BloomFilter extends AlphaFilter
{
Expand All @@ -59,6 +59,9 @@ export class BloomFilter extends AlphaFilter
private _blurYFilter: BlurFilterPass;
private _strength: PointData;

/**
* @param {BloomFilterOptions} options - Options for the BloomFilter constructor.
*/
constructor(options?: BloomFilterOptions);
/**
* @deprecated since 6.0.0
Expand All @@ -69,6 +72,7 @@ export class BloomFilter extends AlphaFilter
* @param {number} [kernelSize=5] - The kernelSize of the blurX & blurY filter.Options: 5, 7, 9, 11, 13, 15.
*/
constructor(blur?: DeprecatedBlurValue, quality?: number, resolution?: number, kernelSize?: number);
/** @ignore */
constructor(...args: [BloomFilterOptions?] | [DeprecatedBlurValue?, number?, number?, number?])
{
let options = args[0] ?? {};
Expand Down Expand Up @@ -191,6 +195,7 @@ export class BloomFilter extends AlphaFilter
*
* The strength of both the blurX and blurY properties simultaneously
* @default 2
* @see BloomFilter#strength
*/
get blur(): number
{
Expand All @@ -210,6 +215,7 @@ export class BloomFilter extends AlphaFilter
*
* The strength of the blurX property
* @default 2
* @see BloomFilter#strengthX
*/
get blurX(): number
{
Expand All @@ -229,6 +235,7 @@ export class BloomFilter extends AlphaFilter
*
* The strength of the blurY property
* @default 2
* @see BloomFilter#strengthY
*/
get blurY(): number
{
Expand Down
5 changes: 4 additions & 1 deletion src/bulge-pinch/BulgePinchFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type { FilterSystem, PointData, RenderSurface, Texture } from 'pixi.js';

// This WebGPU filter has been ported from the WebGL renderer that was originally created by Julien CLEREL (@JuloxRox)

/** Options for the BulgePinchFilter constructor. */
export interface BulgePinchFilterOptions
{
/**
Expand All @@ -32,7 +33,6 @@ export interface BulgePinchFilterOptions
*
* @class
* @extends Filter
* @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}
*/
export class BulgePinchFilter extends Filter
{
Expand All @@ -50,6 +50,9 @@ export class BulgePinchFilter extends Filter
uStrength: number;
};

/**
* @param options - Options for the BulgePinchFilter constructor.
*/
constructor(options?: BulgePinchFilterOptions)
{
options = { ...BulgePinchFilter.DEFAULT_OPTIONS, ...options };
Expand Down
Loading

0 comments on commit c92302c

Please sign in to comment.