src/render/Render.js
/**
 * Wrapper around native image, stores additional parameters that define a part of the original image
 * and a padding space around that part.
 * 
 * @param image The image.
 * @param x is the position coordinate in the image, in pixels
 * @param y is the position coordinate in the image, in pixels
 * @param width is image region space in pixels
 * @param height is image region space in pixels
 * @param xOffset is padding offset in pixels, defaults to 0
 * @param yOffset is padding offset in pixels, defaults to 0
 * @param textureWidth is target texture width in pixels, defaults to width
 * @param textureHeight is target texture height in pixels, defaults to height
 * @returns {EMBImage}
 */
Wrapper around native image, stores additional parameters that define a part of the original image
and a padding space around that part.

@param image The image.
Wrapper around native image stores additional parameters that define a part of the original image and a padding space around that part . @param image The image .
function EMBImage(image, x, y, width, height, xOffset, yOffset, textureWidth, textureHeight) {
    assert(image != null && x >=0 && y >= 0 && width >=0 && height >= 0, "illegal image description");
    assert(image instanceof HTMLImageElement || image instanceof HTMLCanvasElement, "invalid image");
    this.image = image;
    this.x = x;
    this.y = y;
    this.width = width;
    this.height = height;
    this.xOffset = xOffset == null? 0 : xOffset;
    this.yOffset = yOffset == null? 0 : yOffset;
    this.textureWidth = textureWidth == null? width : textureWidth;
    this.textureHeight = textureHeight == null? height : textureHeight;
    assert(this.xOffset >= 0 && this.yOffset >= 0, "offset in pixels is expected");
    assert(this.xOffset + this.width <= this.textureWidth && this.yOffset + this.height <= this.textureHeight, "illegal padding");
    this.hasPaddingSpace = (xOffset > 0) || (yOffset > 0) || (textureWidth > width) || (textureHeight > height);
}
function EMBImage ( image , x , y , width , height , xOffset , yOffset , textureWidth , textureHeight ) { assert ( image != null && x >= 0 && y >= 0 && width >= 0 && height >= 0 , "illegal image description" ) ; assert ( image instanceof HTMLImageElement || image instanceof HTMLCanvasElement , "invalid image" ) ; this . image = image ; this . x = x ; this . y = y ; this . width = width ; this . height = height ; this . xOffset = xOffset == null ? 0 : xOffset ; this . yOffset = yOffset == null ? 0 : yOffset ; this . textureWidth = textureWidth == null ? width : textureWidth ; this . textureHeight = textureHeight == null ? height : textureHeight ; assert ( this . xOffset >= 0 && this . yOffset >= 0 , "offset in pixels is expected" ) ; assert ( this . xOffset + this . width <= this . textureWidth && this . yOffset + this . height <= this . textureHeight , "illegal padding" ) ; this . hasPaddingSpace = ( xOffset > 0 ) || ( yOffset > 0 ) || ( textureWidth > width ) || ( textureHeight > height ) ; }
Wrapper around native image, stores additional parameters that define a part of the original image
 and a padding space around that part.
Wrapper around native image stores additional parameters that define a part of the original image and a padding space around that part .