<commit_before>// Skin locations are based on the work of Confuser
// https://github.com/confuser/serverless-mc-skin-viewer
// Permission to use & distribute https://github.com/confuser/serverless-mc-skin-viewer/blob/master/LICENSE

var helpers = require('./helpers');
var logging = require('./logging');
var fs = require('fs');

var exp = {};

var Canvas = require('canvas');
var Image = Canvas.Image;

exp.draw_helmet = function(skin_canvas, model_ctx, scale) {
  //Helmet - Front
  model_ctx.setTransform(1,-0.5,0,1.2,0,0);
  model_ctx.drawImage(skin_canvas, 40*scale, 8*scale, 8*scale, 8*scale, 10*scale, 13/1.2*scale, 8*scale, 8*scale);
  //Helmet - Right
  model_ctx.setTransform(1,0.5,0,1.2,0,0);
  model_ctx.drawImage(skin_canvas, 32*scale, 8*scale, 8*scale, 8*scale, 2*scale, 3/1.2*scale, 8*scale, 8*scale);
  //Helmet - Top
  model_ctx.setTransform(-1,0.5,1,0.5,0,0);
  model_ctx.scale(-1,1);
  model_ctx.drawImage(skin_canvas, 40*scale, 0, 8*scale, 8*scale, -3.4*scale, 5.14*scale, 8*scale, 8*scale);
};

exp.draw_head = function(skin_canvas, model_ctx, scale) {
  //Head - Front
  model_ctx.setTransform(1,-0.5,0,1.2,0,0);
  model_ctx.drawImage(skin_canvas, 8*scale, 8*scale, 8*scale, 8*scale, 10*scale, 13/1.2*scale, 8*scale, 8*scale);
  //Head - Right
  model_ctx.setTransform(1,0.5,0,1.2,0,0);
  model_ctx.drawImage(skin_canvas, 0, 8*scale, 8*scale, 8*scale, 2*scale, 3/1.2*scale, 8*scale, 8*scale);
  //Head - Top
  model_ctx.setTransform(-1,0.5,1,0.5,0,0);
  model_ctx.scale(-1,1);
  model_ctx.drawImage(skin_canvas, 8*scale, 0, 8*scale, 8*scale, -3.35*scale, 5.16*scale, 8.3*scale, 8*scale);
};

exp.draw_body = function(skin_canvas, model_ctx, scale) {
  //Left Leg
  //Left Leg - Front
  model_ctx.setTransform(1,-0.5,0,1.2,0,0);
  model_ctx.scale(-1,1);
  model_ctx.drawImage(skin_canvas, 4*scale, 20*scale, 4*scale, 12*scale, -16*scale, 34.4/1.2*scale, 4*scale, 12*scale);

  //Right Leg
  //Right Leg - Right
  model_ctx.setTransform(1,0.5,0,1.2,0,0);
  model_ctx.drawImage(skin_canvas, 0*scale, 20*scale, 4*scale, 12*scale, 4*scale, 26.4/1.2*scale, 4*scale, 12*scale);
  //Right Leg - Front
  model_ctx.setTransform(1,-0.5,0,1.2,0,0);
  model_ctx.drawImage(skin_canvas, 4*scale, 20*scale, 4*scale, 12*scale, 8*scale, 34.4/1.2*scale, 4*scale, 12*scale);

  //Arm Left
  //Arm Left - Front
  model_ctx.setTransform(1,-0.5,0,1.2,0,0);
  model_ctx.scale(-1,1);
  model_ctx.drawImage(skin_canvas, 44*scale, 20*scale, 4*scale, 12*scale, -20*scale, 20/1.2*scale, 4*scale, 12*scale);
  //Arm Left - Top
  model_ctx.setTransform(-1,0.5,1,0.5,0,0);
  model_ctx.drawImage(skin_canvas, 44*scale, 16*scale, 4*scale, 4*scale, 0, 16*scale, 4*scale, 4*scale);

  //Body
  //Body - Front
  model_ctx.setTransform(1,-0.5,0,1.2,0,0);
  model_ctx.drawImage(skin_canvas, 20*scale, 20*scale, 8*scale, 12*scale, 8*scale, 20/1.2*scale, 8*scale, 12*scale);

  //Arm Right
  //Arm Right - Right
  model_ctx.setTransform(1,0.5,0,1.2,0,0);
  model_ctx.drawImage(skin_canvas, 40*scale, 20*scale, 4*scale, 12*scale, 0, 16/1.2*scale, 4*scale, 12*scale);
  //Arm Right - Front
  model_ctx.setTransform(1,-0.5,0,1.2,0,0);
  model_ctx.drawImage(skin_canvas, 44*scale, 20*scale, 4*scale, 12*scale, 4*scale, 20/1.2*scale, 4*scale, 12*scale);
  //Arm Right - Top
  model_ctx.setTransform(-1,0.5,1,0.5,0,0);
  model_ctx.scale(-1,1);
  model_ctx.drawImage(skin_canvas, 44*scale, 16*scale, 4*scale, 4*scale, -16*scale, 16*scale, 4*scale, 4*scale);
};<commit_msg>Fix shoulder rendering<commit_after>// Skin locations are based on the work of Confuser
// https://github.com/confuser/serverless-mc-skin-viewer
// Permission to use & distribute https://github.com/confuser/serverless-mc-skin-viewer/blob/master/LICENSE

var helpers = require('./helpers');
var logging = require('./logging');
var fs = require('fs');

var exp = {};

var Canvas = require('canvas');
var Image = Canvas.Image;

exp.draw_helmet = function(skin_canvas, model_ctx, scale) {
  //Helmet - Front
  model_ctx.setTransform(1,-0.5,0,1.2,0,0);
  model_ctx.drawImage(skin_canvas, 40*scale, 8*scale, 8*scale, 8*scale, 10*scale, 13/1.2*scale, 8*scale, 8*scale);
  //Helmet - Right
  model_ctx.setTransform(1,0.5,0,1.2,0,0);
  model_ctx.drawImage(skin_canvas, 32*scale, 8*scale, 8*scale, 8*scale, 2*scale, 3/1.2*scale, 8*scale, 8*scale);
  //Helmet - Top
  model_ctx.setTransform(-1,0.5,1,0.5,0,0);
  model_ctx.scale(-1,1);
  model_ctx.drawImage(skin_canvas, 40*scale, 0, 8*scale, 8*scale, -3.4*scale, 5.14*scale, 8*scale, 8*scale);
};

exp.draw_head = function(skin_canvas, model_ctx, scale) {
  //Head - Front
  model_ctx.setTransform(1,-0.5,0,1.2,0,0);
  model_ctx.drawImage(skin_canvas, 8*scale, 8*scale, 8*scale, 8*scale, 10*scale, 13/1.2*scale, 8*scale, 8*scale);
  //Head - Right
  model_ctx.setTransform(1,0.5,0,1.2,0,0);
  model_ctx.drawImage(skin_canvas, 0, 8*scale, 8*scale, 8*scale, 2*scale, 3/1.2*scale, 8*scale, 8*scale);
  //Head - Top
  model_ctx.setTransform(-1,0.5,1,0.5,0,0);
  model_ctx.scale(-1,1);
  model_ctx.drawImage(skin_canvas, 8*scale, 0, 8*scale, 8*scale, -3.35*scale, 5.16*scale, 8.3*scale, 8*scale);
};

exp.draw_body = function(skin_canvas, model_ctx, scale) {
  //Left Leg
  //Left Leg - Front
  model_ctx.setTransform(1,-0.5,0,1.2,0,0);
  model_ctx.scale(-1,1);
  model_ctx.drawImage(skin_canvas, 4*scale, 20*scale, 4*scale, 12*scale, -16*scale, 34.4/1.2*scale, 4*scale, 12*scale);

  //Right Leg
  //Right Leg - Right
  model_ctx.setTransform(1,0.5,0,1.2,0,0);
  model_ctx.drawImage(skin_canvas, 0*scale, 20*scale, 4*scale, 12*scale, 4*scale, 26.4/1.2*scale, 4*scale, 12*scale);
  //Right Leg - Front
  model_ctx.setTransform(1,-0.5,0,1.2,0,0);
  model_ctx.drawImage(skin_canvas, 4*scale, 20*scale, 4*scale, 12*scale, 8*scale, 34.4/1.2*scale, 4*scale, 12*scale);

  //Arm Left
  //Arm Left - Front
  model_ctx.setTransform(1,-0.5,0,1.2,0,0);
  model_ctx.scale(-1,1);
  model_ctx.drawImage(skin_canvas, 44*scale, 20*scale, 4*scale, 12*scale, -20*scale, 20/1.2*scale, 4*scale, 12*scale);
  //Arm Left - Top
  model_ctx.setTransform(-1,0.5,1,0.5,0,0);
  model_ctx.drawImage(skin_canvas, 44*scale, 16*scale, 4*scale, 4*scale, 0, 16.4*scale, 4*scale, 4.3*scale);

  //Body
  //Body - Front
  model_ctx.setTransform(1,-0.5,0,1.2,0,0);
  model_ctx.drawImage(skin_canvas, 20*scale, 20*scale, 8*scale, 12*scale, 8*scale, 20/1.2*scale, 8*scale, 12*scale);

  //Arm Right
  //Arm Right - Right
  model_ctx.setTransform(1,0.5,0,1.2,0,0);
  model_ctx.drawImage(skin_canvas, 40*scale, 20*scale, 4*scale, 12*scale, 0, 16/1.2*scale, 4*scale, 12*scale);
  //Arm Right - Front
  model_ctx.setTransform(1,-0.5,0,1.2,0,0);
  model_ctx.drawImage(skin_canvas, 44*scale, 20*scale, 4*scale, 12*scale, 4*scale, 20/1.2*scale, 4*scale, 12*scale);
  //Arm Right - Top
  model_ctx.setTransform(-1,0.5,1,0.5,0,0);
  model_ctx.scale(-1,1);
  model_ctx.drawImage(skin_canvas, 44*scale, 16*scale, 4*scale, 4*scale, -16.4*scale, 16*scale, 4*scale, 4.3*scale);
};
{'fraction_non_alphanumeric': 0.19858156028368795, 'fraction_numerical': 0.09639600521059488, 'mean_word_length': 4.68724279835391, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '67149', 'n_tokens_mistral': 3317, 'n_tokens_neox': 2974, 'n_words': 496}