Adds an axis-aligned quad to the current render operation. {@code left, top, right, bottom}
define the bounds of the quad. {@code sl, st, sr, sb} define the texture coordinates.
339517
public void addQuad(float m00, float m01, float m10, float m11, float tx, float ty,
                      float left, float top, float right, float bottom,
                      float sl, float st, float sr, float sb) {
    texCore.addQuad(m00, m01, m10, m11, tx, ty,
                    left,  top,    sl, st,
                    right, top,    sr, st,
                    left,  bottom, sl, sb,
                    right, bottom, sr, sb);
    if (GLContext.STATS_ENABLED) ctx.stats.quadsRendered++;
  }
617567
@Override
    public void addPixels(int[] pixels, int offset, int count) {
        for (int i = 0; i < count; i++) {
            insertColor(pixels[i + offset]);
            if (colors > reduceColors)
                reduceTree(reduceColors);
        }
    }
294737
@Override
    public void renderReference( PositionedText canvas, double x, double y, String target, String name )
    {
        canvas.add( x, y, "|" + name + "|" );
    }
69527
@Override
    public void renderLine( PositionedText target, double x, double y,
                            Size size, List<Diagram.Figure> sequence, boolean forward )
    {
        throw new UnsupportedOperationException( "not implemented" );
    }
377353
public void addQuad (Texture tex, int tint, AffineTransform xf,
                       float x, float y, float w, float h) {
    setTexture(tex);
    float sr = tex.config.repeatX ? w/tex.displayWidth : 1;
    float sb = tex.config.repeatY ? h/tex.displayHeight : 1;
    addQuad(tint, xf, x, y, x+w, y+h, 0, 0, sr, sb);
  }
1129187
void addToHistogram(int cellX, int cellY, int orientationIndex, double magnitude) {
		// see if it's being applied to a valid cell in the histogram
		if( cellX < 0 || cellX >= cellsPerBlockX)
			return;
		if( cellY < 0 || cellY >= cellsPerBlockY)
			return;

		int index = (cellY*cellsPerBlockX + cellX)*orientationBins + orientationIndex;
		histogram[index] += magnitude;
	}
295964
function (projection) {
    var el = this.el;
    var size;
    var camera;
    var cubeCamera;
    // Configure camera.
    if (projection === 'perspective') {
      // Quad is only used in equirectangular mode. Hide it in this case.
      this.quad.visible = false;
      // Use scene camera.
      camera = (this.data.camera && this.data.camera.components.camera.camera) || el.camera;
      size = {width: this.data.width, height: this.data.height};
    } else {
      // Use ortho camera.
      camera = this.camera;
      // Create cube camera and copy position from scene camera.
      cubeCamera = new THREE.CubeCamera(el.camera.near, el.camera.far,
                                        Math.min(this.cubeMapSize, 2048));
      // Copy camera position into cube camera;
      el.camera.getWorldPosition(cubeCamera.position);
      el.camera.getWorldQuaternion(cubeCamera.quaternion);
      // Render scene with cube camera.
      cubeCamera.update(el.renderer, el.object3D);
      this.quad.material.uniforms.map.value = cubeCamera.renderTarget.texture;
      size = {width: this.data.width, height: this.data.height};
      // Use quad to project image taken by the cube camera.
      this.quad.visible = true;
    }
    return {
      camera: camera,
      size: size,
      projection: projection
    };
  }
708495
function Quad(gl)
{
    /*
     * the current WebGL drawing context
     *
     * @member {WebGLRenderingContext}
     */
    this.gl = gl;

//    this.textures = new TextureUvs();

    /**
     * An array of vertices
     *
     * @member {Float32Array}
     */
    this.vertices = new Float32Array([
        0,0,
        200,0,
        200,200,
        0,200
    ]);

    /**
     * The Uvs of the quad
     *
     * @member {Float32Array}
     */
    this.uvs = new Float32Array([
        0,0,
        1,0,
        1,1,
        0,1
    ]);

//    var white = (0xFFFFFF >> 16) + (0xFFFFFF & 0xff00) + ((0xFFFFFF & 0xff) << 16) + (1 * 255 << 24);
    //TODO convert this to a 32 unsigned int array
    /**
     * The color components of the triangles
     *
     * @member {Float32Array}
     */
    this.colors = new Float32Array([
        1,1,1,1,
        1,1,1,1,
        1,1,1,1,
        1,1,1,1
    ]);

    /*
     * @member {Uint16Array} An array containing the indices of the vertices
     */
    this.indices = new Uint16Array([
        0, 1, 2, 0, 3, 2
    ]);

    /*
     * @member {WebGLBuffer} The vertex buffer
     */
    this.vertexBuffer = gl.createBuffer();

    /*
     * @member {WebGLBuffer} The index buffer
     */
    this.indexBuffer = gl.createBuffer();

    gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    gl.bufferData(gl.ARRAY_BUFFER, (8 + 8 + 16) * 4, gl.DYNAMIC_DRAW);

    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);

    this.upload();
}
171941
function(shader) {
		var gl = this.gl;

		var offset = 0;
		var stride = this.vertexStride;

		//bind and update our vertex data before binding attributes
		this._updateBuffers();

		//for each attribtue
		for (var i=0; i<this._vertexAttribs.length; i++) {
			var a = this._vertexAttribs[i];

			//location of the attribute
			var loc = a.location === null 
					? shader.getAttributeLocation(a.name)
					: a.location;

			//TODO: We may want to skip unfound attribs
			// if (loc!==0 && !loc)
			// 	console.warn("WARN:", a.name, "is not enabled");

			//first, enable the vertex array
			gl.enableVertexAttribArray(loc);

			//then specify our vertex format
			gl.vertexAttribPointer(loc, a.numComponents, a.type || gl.FLOAT, 
								   a.normalize, stride, offset);

			//and increase the offset...
			offset += a.offsetCount * 4; //in bytes
		}
	}
263490
public void addQuad (int tint, float m00, float m01, float m10, float m11, float tx, float ty,
                       float left, float top, float right, float bottom,
                       float sl, float st, float sr, float sb) {
    addQuad(tint, m00, m01, m10, m11, tx, ty,
            left,  top,    sl, st,
            right, top,    sr, st,
            left,  bottom, sl, sb,
            right, bottom, sr, sb);
  }
839762
public void add (IRectangle r) {
        int x1 = Math.min(x, r.x());
        int x2 = Math.max(x + width, r.x() + r.width());
        int y1 = Math.min(y, r.y());
        int y2 = Math.max(y + height, r.y() + r.height());
        setBounds(x1, y1, x2 - x1, y2 - y1);
    }
636572
private GeoPackageTile drawTile(TileMatrix tileMatrix,
			TileResultSet tileResults, BoundingBox requestProjectedBoundingBox,
			int tileWidth, int tileHeight) {

		// Draw the resulting bitmap with the matching tiles
		GeoPackageTile geoPackageTile = null;
		Graphics graphics = null;
		while (tileResults.moveToNext()) {

			// Get the next tile
			TileRow tileRow = tileResults.getRow();
			BufferedImage tileDataImage;
			try {
				tileDataImage = tileRow.getTileDataImage();
			} catch (IOException e) {
				throw new GeoPackageException(
						"Failed to read the tile row image data", e);
			}

			// Get the bounding box of the tile
			BoundingBox tileBoundingBox = TileBoundingBoxUtils.getBoundingBox(
					tileSetBoundingBox, tileMatrix, tileRow.getTileColumn(),
					tileRow.getTileRow());

			// Get the bounding box where the requested image and
			// tile overlap
			BoundingBox overlap = requestProjectedBoundingBox
					.overlap(tileBoundingBox);

			// If the tile overlaps with the requested box
			if (overlap != null) {

				// Get the rectangle of the tile image to draw
				ImageRectangle src = TileBoundingBoxJavaUtils.getRectangle(
						tileMatrix.getTileWidth(), tileMatrix.getTileHeight(),
						tileBoundingBox, overlap);

				// Get the rectangle of where to draw the tile in
				// the resulting image
				ImageRectangle dest = TileBoundingBoxJavaUtils.getRectangle(
						tileWidth, tileHeight, requestProjectedBoundingBox,
						overlap);

				if (src.isValid() && dest.isValid()) {

					if (imageFormat != null) {

						// Create the bitmap first time through
						if (geoPackageTile == null) {
							BufferedImage bufferedImage = ImageUtils
									.createBufferedImage(tileWidth, tileHeight,
											imageFormat);
							graphics = bufferedImage.getGraphics();
							geoPackageTile = new GeoPackageTile(tileWidth,
									tileHeight, bufferedImage);
						}

						// Draw the tile to the image
						graphics.drawImage(tileDataImage, dest.getLeft(),
								dest.getTop(), dest.getRight(),
								dest.getBottom(), src.getLeft(), src.getTop(),
								src.getRight(), src.getBottom(), null);
					} else {

						// Verify only one image was found and
						// it lines up perfectly
						if (geoPackageTile != null || !src.equals(dest)) {
							throw new GeoPackageException(
									"Raw image only supported when the images are aligned with the tile format requiring no combining and cropping");
						}

						geoPackageTile = new GeoPackageTile(tileWidth,
								tileHeight, tileRow.getTileData());
					}
				}
			}
		}

		// Check if the entire image is transparent
		if (geoPackageTile != null && geoPackageTile.getImage() != null
				&& ImageUtils.isFullyTransparent(geoPackageTile.getImage())) {
			geoPackageTile = null;
		}

		return geoPackageTile;
	}
271432
private void setPosition() {
		switch (getAlignment()) {
			case LEFT:
				canvas.setLeft(getHorizontalOffset());
				break;
			case RIGHT:
				canvas.setLeft(mapWidget.getVectorContext().getWidth() - getWidth() - getHorizontalOffset());
				break;
		}
		switch (getVerticalAlignment()) {
			case TOP:
				canvas.setTop(getVerticalOffset());
				break;
			case BOTTOM:
				canvas.setTop(mapWidget.getVectorContext().getHeight() - getHeight() - getVerticalOffset());
				break;
		}
	}
78390
@Override
	public void transform(Transform3D transform) {
		if (transform!=null) {
			Point3D p = new Point3f();
			for(int i=0; i<this.numCoords;) {
				p.set(this.coords[i], this.coords[i+1], this.coords[i+2]);
				transform.transform(p);
				this.coords[i++] = p.getX();
				this.coords[i++] = p.getY();
				this.coords[i++] = p.getZ();
			}
			this.graphicalBounds = null;
			this.logicalBounds = null;
		}
	}
1221029
protected void defineSmallRectangles(ZoomableGraphicsContext gc, T element) {
		final double ptsSize = element.getPointSize() / 2.;
		final Rectangle2afp<?, ?, ?, ?, ?, ?> visibleArea = gc.getVisibleArea();
		for (final Point2d point : element.points()) {
			if (visibleArea.contains(point)) {
				final double x = point.getX() - ptsSize;
				final double y = point.getY() - ptsSize;
				final double mx = point.getX() + ptsSize;
				final double my = point.getY() + ptsSize;
				gc.moveTo(x, y);
				gc.lineTo(mx, y);
				gc.lineTo(mx, my);
				gc.lineTo(x, my);
				gc.closePath();
			}
		}
	}
1110474
public void setPadding(float padding, Layout.Axis axis) {
        OrientedLayout layout = null;
        switch(axis) {
            case X:
                layout = mShiftLayout;
                break;
            case Y:
                layout = mShiftLayout;
                break;
            case Z:
                layout = mStackLayout;
                break;
        }
        if (layout != null) {
            if (!equal(layout.getDividerPadding(axis), padding)) {
                layout.setDividerPadding(padding, axis);

                if (layout.getOrientationAxis() == axis) {
                    requestLayout();
                }
            }
        }

    }
16264
private void setDestPixel(int[] dstImage, int x, int y, int p)
    {
        dstImage[x + y * width * SCALE] = p;
    }