<commit_before>/**
 * Copyright 2012 Adobe Systems Incorporated
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package com.pender;

import javax.microedition.khronos.opengles.GL10;
import android.opengl.GLES10;

import com.pender.glaid.Image;
import com.pender.glaid.Polygon;


public class PenderCanvas {
	//========================================================================== 
	public PenderCanvas( PenderRenderer renderer ) {
		float vert[] = { 
	  		      100.0f, 300f, 0.0f,
	  		      100.0f, 428.0f, 0.0f,
	  		      228.0f, 428.0f, 0.0f,
	  		      228.0f, 300.0f, 0.0f,
	  	};

	  	short[] ind = { 0, 1, 2, 0, 2, 3 };

		mPoly = new Polygon( vert, ind );
		mRenderer = renderer;
	}
	//==========================================================================
	//==========================================================================
	/**
	 * 
	 * @param img
	 * @param dx
	 * @param dy
	 */
    public void drawImage( Image img, float dx, float dy) {
    	GLES10.glMatrixMode (GLES10.GL_MODELVIEW);
    	GLES10.glPushMatrix ();
    	GLES10.glTranslatef (dx, dy, 0.0f);
    	this.glDrawImage (img);
    	GLES10.glPopMatrix();
   } 
   //========================================================================== 
    /**
     * 
     * @param image integer reference to the image
     * @param dx x coordinate of top right corner 
     * @param dy y coordinate of top right corner
     * @param dw image width
     * @param dh image height
     */
    public void drawImage( Image img, float dx, float dy, float dw, float dh) {
		float vert[] = { 
	  		      dw, 0.0f, 0.0f,
	  		      dw,   dh, 0.0f,
	  		      0.0f, dh, 0.0f,
	  		      0.0f, 0.0f, 0.0f,
	  	};
	  	short[] ind = { 0, 1, 2, 0, 2, 3 };
	  	
	  	Polygon poly = new Polygon (vert,ind);
	  	img.setPoly(poly);
	  	
    	GLES10.glMatrixMode (GLES10.GL_MODELVIEW);
    	GLES10.glPushMatrix ();
    	GLES10.glTranslatef (dx, dy, 0.0f);
    	this.glDrawImage (img);
    	GLES10.glPopMatrix ();
    }
    //========================================================================== 
    /**
     * 
     * @param image integer reference to the image
     * @param sx
     * @param sy
     * @param sw
     * @param sh
     * @param dx x coordinate of top right corner 
     * @param dy y coordinate of top right corner
     * @param dw image width
     * @param dh image height
     */
    public void drawImage (Image img, float sx, float sy, float sw, float sh, 
                                      float dx, float dy, float dw, float dh) {
		float vert[] = { 
	  		      dw, 0.0f, 0.0f,
	  		      dw,   dh, 0.0f,
	  		      0.0f, dh, 0.0f,
	  		      0.0f, 0.0f, 0.0f,
	  	};
	  	short[] ind = { 0, 1, 2, 0, 2, 3 };
	  	<commit_msg>license correction<commit_after>/**
 * Copyright 2012 Adobe Systems Incorporated
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package com.pender;

import javax.microedition.khronos.opengles.GL10;
import android.opengl.GLES10;

import com.pender.glaid.Image;
import com.pender.glaid.Polygon;


public class PenderCanvas {
	//========================================================================== 
	public PenderCanvas( PenderRenderer renderer ) {
		float vert[] = { 
	  		      100.0f, 300f, 0.0f,
	  		      100.0f, 428.0f, 0.0f,
	  		      228.0f, 428.0f, 0.0f,
	  		      228.0f, 300.0f, 0.0f,
	  	};

	  	short[] ind = { 0, 1, 2, 0, 2, 3 };

		mPoly = new Polygon( vert, ind );
		mRenderer = renderer;
	}
	//==========================================================================
	//==========================================================================
	/**
	 * 
	 * @param img
	 * @param dx
	 * @param dy
	 */
    public void drawImage( Image img, float dx, float dy) {
    	GLES10.glMatrixMode (GLES10.GL_MODELVIEW);
    	GLES10.glPushMatrix ();
    	GLES10.glTranslatef (dx, dy, 0.0f);
    	this.glDrawImage (img);
    	GLES10.glPopMatrix();
   } 
   //========================================================================== 
    /**
     * 
     * @param image integer reference to the image
     * @param dx x coordinate of top right corner 
     * @param dy y coordinate of top right corner
     * @param dw image width
     * @param dh image height
     */
    public void drawImage( Image img, float dx, float dy, float dw, float dh) {
		float vert[] = { 
	  		      dw, 0.0f, 0.0f,
	  		      dw,   dh, 0.0f,
	  		      0.0f, dh, 0.0f,
	  		      0.0f, 0.0f, 0.0f,
	  	};
	  	short[] ind = { 0, 1, 2, 0, 2, 3 };
	  	
	  	Polygon poly = new Polygon (vert,ind);
	  	img.setPoly(poly);
	  	
    	GLES10.glMatrixMode (GLES10.GL_MODELVIEW);
    	GLES10.glPushMatrix ();
    	GLES10.glTranslatef (dx, dy, 0.0f);
    	this.glDrawImage (img);
    	GLES10.glPopMatrix ();
    }
    //========================================================================== 
    /**
     * 
     * @param image integer reference to the image
     * @param sx
     * @param sy
     * @param sw
     * @param sh
     * @param dx x coordinate of top right corner 
     * @param dy y coordinate of top right corner
     * @param dw image width
     * @param dh image height
     */
    
    public void drawImage (Image img, float sx, float sy, float sw, float sh, 
                                      float dx, float dy, float dw, float dh) {
		float vert[] = { 
	  		      dw, 0.0f, 0.0f,
	  		      dw,   dh, 0.0f,
	  		      0.0f, dh, 0.0f,
	  		      0.0f, 0.0f, 0.0f,
	  	};
	  	short[] ind = { 0, 1, 2, 0, 2, 3 };
	  	
{'fraction_non_alphanumeric': 0.21714990746452806, 'fraction_numerical': 0.038556446637877856, 'mean_word_length': 2.4257791864764924, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '342507', 'n_tokens_mistral': 2382, 'n_tokens_neox': 2047, 'n_words': 639}