shadow$provide.module$node_modules$pixi_DOT_js$lib$rendering$renderers$shared$extract$GenerateTextureSystem = function(global, require, module, exports) {
  var Color = require("module$node_modules$pixi_DOT_js$lib$color$Color");
  global = require("module$node_modules$pixi_DOT_js$lib$extensions$Extensions");
  var Matrix = require("module$node_modules$pixi_DOT_js$lib$maths$matrix$Matrix");
  module = require("module$node_modules$pixi_DOT_js$lib$maths$shapes$Rectangle");
  var Bounds = require("module$node_modules$pixi_DOT_js$lib$scene$container$bounds$Bounds"), getLocalBounds = require("module$node_modules$pixi_DOT_js$lib$scene$container$bounds$getLocalBounds"), Container = require("module$node_modules$pixi_DOT_js$lib$scene$container$Container"), RenderTexture = require("module$node_modules$pixi_DOT_js$lib$rendering$renderers$shared$texture$RenderTexture");
  "use strict";
  const tempRect = new module.Rectangle(), tempBounds = new Bounds.Bounds(), noColor = [0, 0, 0, 0];
  class GenerateTextureSystem {
    constructor(renderer) {
      this._renderer = renderer;
    }
    generateTexture(options) {
      options instanceof Container.Container && (options = {target:options, frame:void 0, textureSourceOptions:{}, resolution:void 0});
      const resolution = options.resolution || this._renderer.resolution, antialias = options.antialias || this._renderer.view.antialias, container = options.target;
      let clearColor = options.clearColor;
      clearColor = clearColor ? Array.isArray(clearColor) && 4 === clearColor.length ? clearColor : Color.Color.shared.setValue(clearColor).toArray() : noColor;
      var region = options.frame?.copyTo(tempRect) || getLocalBounds.getLocalBounds(container, tempBounds).rectangle;
      const textureOptions = options.defaultAnchor && {defaultAnchor:options.defaultAnchor};
      region.width = Math.max(region.width, 1 / resolution) | 0;
      region.height = Math.max(region.height, 1 / resolution) | 0;
      options = RenderTexture.RenderTexture.create({...options.textureSourceOptions, width:region.width, height:region.height, resolution, antialias, textureOptions});
      region = Matrix.Matrix.shared.translate(-region.x, -region.y);
      this._renderer.render({container, transform:region, target:options, clearColor});
      options.source.updateMipmaps();
      return options;
    }
    destroy() {
      this._renderer = null;
    }
  }
  GenerateTextureSystem.extension = {type:[global.ExtensionType.WebGLSystem, global.ExtensionType.WebGPUSystem, global.ExtensionType.CanvasSystem], name:"textureGenerator"};
  exports.GenerateTextureSystem = GenerateTextureSystem;
};

//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$rendering$renderers$shared$extract$GenerateTextureSystem.js.map
