lib/pixi/src/core/textures/Texture.js
function Texture(baseTexture, frame, crop, trim, rotate)
{
    EventEmitter.call(this);

    /**
     * Does this Texture have any frame data assigned to it?
     *
     * @member {boolean}
     */
    this.noFrame = false;

    if (!frame)
    {
        this.noFrame = true;
        frame = new math.Rectangle(0, 0, 1, 1);
    }

    if (baseTexture instanceof Texture)
    {
        baseTexture = baseTexture.baseTexture;
    }

  //  console.log(frame);

    /**
     * The base texture that this texture uses.
     *
     * @member {BaseTexture}
     */
    this.baseTexture = baseTexture;

    /**
     * The frame specifies the region of the base texture that this texture uses
     *
     * @member {Rectangle}
     * @private
     */
    this._frame = frame;

    /**
     * The texture trim data.
     *
     * @member {Rectangle}
     */
    this.trim = trim;

    /**
     * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.
     *
     * @member {boolean}
     */
    this.valid = false;

    /**
     * This will let a renderer know that a texture has been updated (used mainly for webGL uv updates)
     *
     * @member {boolean}
     */
    this.requiresUpdate = false;

    /**
     * The WebGL UV data cache.
     *
     * @member {TextureUvs}
     * @private
     */
    this._uvs = null;

    /**
     * The width of the Texture in pixels.
     *
     * @member {number}
     */
    this.width = 0;

    /**
     * The height of the Texture in pixels.
     *
     * @member {number}
     */
    this.height = 0;

    /**
     * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering,
     * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)
     *
     * @member {Rectangle}
     */
    this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1);

    /**
     * Indicates whether the texture should be rotated by 90 degrees
     *
     * @private
     * @member {boolean}
     */
    this.rotate = !!rotate;

    if (baseTexture.hasLoaded)
    {
        if (this.noFrame)
        {
            frame = new math.Rectangle(0, 0, baseTexture.width, baseTexture.height);

            // if there is no frame we should monitor for any base texture changes..
            baseTexture.on('update', this.onBaseTextureUpdated, this);
        }
        this.frame = frame;
    }
    else
    {
        baseTexture.once('loaded', this.onBaseTextureLoaded, this);
    }
}
function Texture(baseTexture, frame, crop, trim, rotate)
{
    EventEmitter.call(this);

    /**
     * Does this Texture have any frame data assigned to it?
     *
     * @member {boolean}
     */
    this.noFrame = false;

    if (!frame)
    {
        this.noFrame = true;
        frame = new math.Rectangle(0, 0, 1, 1);
    }

    if (baseTexture instanceof Texture)
    {
        baseTexture = baseTexture.baseTexture;
    }

  //  console.log(frame);

    /**
     * The base texture that this texture uses.
     *
     * @member {BaseTexture}
     */
    this.baseTexture = baseTexture;

    /**
     * The frame specifies the region of the base texture that this texture uses
     *
     * @member {Rectangle}
     * @private
     */
    this._frame = frame;

    /**
     * The texture trim data.
     *
     * @member {Rectangle}
     */
    this.trim = trim;

    /**
     * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.
     *
     * @member {boolean}
     */
    this.valid = false;

    /**
     * This will let a renderer know that a texture has been updated (used mainly for webGL uv updates)
     *
     * @member {boolean}
     */
    this.requiresUpdate = false;

    /**
     * The WebGL UV data cache.
     *
     * @member {TextureUvs}
     * @private
     */
    this._uvs = null;

    /**
     * The width of the Texture in pixels.
     *
     * @member {number}
     */
    this.width = 0;

    /**
     * The height of the Texture in pixels.
     *
     * @member {number}
     */
    this.height = 0;

    /**
     * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering,
     * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)
     *
     * @member {Rectangle}
     */
    this.crop = crop || frame;//new math.Rectangle(0, 0, 1, 1);

    /**
     * Indicates whether the texture should be rotated by 90 degrees
     *
     * @private
     * @member {boolean}
     */
    this.rotate = !!rotate;

    if (baseTexture.hasLoaded)
    {
        if (this.noFrame)
        {
            frame = new math.Rectangle(0, 0, baseTexture.width, baseTexture.height);

            // if there is no frame we should monitor for any base texture changes..
            baseTexture.on('update', this.onBaseTextureUpdated, this);
        }
        this.frame = frame;
    }
    else
    {
        baseTexture.once('loaded', this.onBaseTextureLoaded, this);
    }
}
function Texture ( baseTexture , frame , crop , trim , rotate ) { EventEmitter . call ( this ) ; /**
     * Does this Texture have any frame data assigned to it?
     *
     * @member {boolean}
     */ this . noFrame = false ; if ( ! frame ) { this . noFrame = true ; frame = new math . Rectangle ( 0 , 0 , 1 , 1 ) ; } if ( baseTexture instanceof Texture ) { baseTexture = baseTexture . baseTexture ; } //  console.log(frame); /**
     * The base texture that this texture uses.
     *
     * @member {BaseTexture}
     */ this . baseTexture = baseTexture ; /**
     * The frame specifies the region of the base texture that this texture uses
     *
     * @member {Rectangle}
     * @private
     */ this . _frame = frame ; /**
     * The texture trim data.
     *
     * @member {Rectangle}
     */ this . trim = trim ; /**
     * This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.
     *
     * @member {boolean}
     */ this . valid = false ; /**
     * This will let a renderer know that a texture has been updated (used mainly for webGL uv updates)
     *
     * @member {boolean}
     */ this . requiresUpdate = false ; /**
     * The WebGL UV data cache.
     *
     * @member {TextureUvs}
     * @private
     */ this . _uvs = null ; /**
     * The width of the Texture in pixels.
     *
     * @member {number}
     */ this . width = 0 ; /**
     * The height of the Texture in pixels.
     *
     * @member {number}
     */ this . height = 0 ; /**
     * This is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering,
     * irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)
     *
     * @member {Rectangle}
     */ this . crop = crop || frame ; //new math.Rectangle(0, 0, 1, 1); /**
     * Indicates whether the texture should be rotated by 90 degrees
     *
     * @private
     * @member {boolean}
     */ this . rotate = ! ! rotate ; if ( baseTexture . hasLoaded ) { if ( this . noFrame ) { frame = new math . Rectangle ( 0 , 0 , baseTexture . width , baseTexture . height ) ; // if there is no frame we should monitor for any base texture changes.. baseTexture . on ( 'update' , this . onBaseTextureUpdated , this ) ; } this . frame = frame ; } else { baseTexture . once ( 'loaded' , this . onBaseTextureLoaded , this ) ; } }
A texture stores the information that represents an image or part of an image. It cannot be added
to the display list directly. Instead use it as the texture for a Sprite. If no frame is provided then the whole image is used.

You can directly create a texture from an image and then reuse it multiple times like this :

```js
var texture = PIXI.Texture.fromImage('assets/image.png');
var sprite1 = new PIXI.Sprite(texture);
var sprite2 = new PIXI.Sprite(texture);
```

@class
@memberof PIXI
@param baseTexture {BaseTexture} The base texture source to create the texture from
@param [frame] {Rectangle} The rectangle frame of the texture to show
@param [crop] {Rectangle} The area of original texture
@param [trim] {Rectangle} Trimmed texture rectangle
@param [rotate] {boolean} indicates whether the texture should be rotated by 90 degrees ( used by texture packer )
A texture stores the information that represents an image or part of an image . It cannot be added to the display list directly . Instead use it as the texture for a Sprite . If no frame is provided then the whole image is used .