<commit_before>'use strict'

export const vertexQuad = {
  type: 'x-shader/x-vertex',
  source: `
  uniform mat4 u_projection;
  attribute vec2 a_position;
  attribute vec2 a_texCoord;
  varying vec2 v_texCoord;
  void main(){
      v_texCoord = a_texCoord;
      gl_Position = u_projection * vec4(a_position, 0.0, 1.0);
  }
`
}

export const fragmentRGBA = {
  type: 'x-shader/x-fragment',
  source: `
  precision mediump float;
  uniform sampler2D u_texture0;
  varying vec2 v_texCoord;
  void main(){
      gl_FragColor = texture2D(u_texture0, v_texCoord);
  }
`
}

export const fragmentYUVA = {
  type: 'x-shader/x-fragment',
  source: `
  precision mediump float;
  varying vec2 v_texCoord;
  
  uniform sampler2D yTexture;
  uniform sampler2D uTexture;
  uniform sampler2D vTexture;
  uniform sampler2D alphaYTexture;
    
  const mat4 YUV2RGB = mat4
  (
   1.1643828125,             0, 1.59602734375, -.87078515625,
   1.1643828125, -.39176171875,    -.81296875,     .52959375,
   1.1643828125,   2.017234375,             0,  -1.081390625,
              0,             0,             0,             1
  );

  void main(void) {
   vec4 pix = vec4(texture2D(yTexture,  v_texCoord).x, texture2D(uTexture, v_texCoord).x, texture2D(vTexture, v_texCoord).x, 1) * YUV2RGB;
   pix.w = (texture2D(alphaYTexture,  v_texCoord).x - (16.0 / 255.0)) * (255.0 / (235.0-16.0));
   // pix.w = 1.0;
   gl_FragColor = pix;
  }
`
}

export const fragmentYUV = {
  type: 'x-shader/x-fragment',
  source: `
  precision mediump float;
  varying vec2 v_texCoord;
  
  uniform sampler2D yTexture;
  uniform sampler2D uTexture;
  uniform sampler2D vTexture;
    
  const mat4 YUV2RGB = mat4
  (
   1.1643828125,             0, 1.59602734375, -.87078515625,
   1.1643828125, -.39176171875,    -.81296875,     .52959375,
   1.1643828125,   2.017234375,             0,  -1.081390625,
              0,             0,             0,             1
  );

  void main(void) {
   vec4 pix = vec4(texture2D(yTexture,  v_texCoord).x, texture2D(uTexture, v_texCoord).x, texture2D(vTexture, v_texCoord).x, 1) * YUV2RGB;
   pix.w = 1.0;
   // pix.w = 1.0;
   gl_FragColor = pix;
  }<commit_msg>fix alpha channel color conversion artifacts on firefox<commit_after>'use strict'

export const vertexQuad = {
  type: 'x-shader/x-vertex',
  source: `
  uniform mat4 u_projection;
  attribute vec2 a_position;
  attribute vec2 a_texCoord;
  varying vec2 v_texCoord;
  void main(){
      v_texCoord = a_texCoord;
      gl_Position = u_projection * vec4(a_position, 0.0, 1.0);
  }
`
}

export const fragmentRGBA = {
  type: 'x-shader/x-fragment',
  source: `
  precision mediump float;
  uniform sampler2D u_texture0;
  varying vec2 v_texCoord;
  void main(){
      gl_FragColor = texture2D(u_texture0, v_texCoord);
  }
`
}

export const fragmentYUVA = {
  type: 'x-shader/x-fragment',
  source: `
  precision mediump float;
  varying vec2 v_texCoord;
  
  uniform sampler2D yTexture;
  uniform sampler2D uTexture;
  uniform sampler2D vTexture;
  uniform sampler2D alphaYTexture;
    
  const mat4 YUV2RGB = mat4
  (
   1.1643828125,             0, 1.59602734375, -.87078515625,
   1.1643828125, -.39176171875,    -.81296875,     .52959375,
   1.1643828125,   2.017234375,             0,  -1.081390625,
              0,             0,             0,             1
  );

  void main(void) {
   vec4 pix = vec4(texture2D(yTexture,  v_texCoord).x, texture2D(uTexture, v_texCoord).x, texture2D(vTexture, v_texCoord).x, 1) * YUV2RGB;
   pix.w = (vec4(texture2D(alphaYTexture,  v_texCoord).x, 0.5019607843137255, 0.5019607843137255, 1) * YUV2RGB).x;
   gl_FragColor = pix;
  }
`
}

export const fragmentYUV = {
  type: 'x-shader/x-fragment',
  source: `
  precision mediump float;
  varying vec2 v_texCoord;
  
  uniform sampler2D yTexture;
  uniform sampler2D uTexture;
  uniform sampler2D vTexture;
    
  const mat4 YUV2RGB = mat4
  (
   1.1643828125,             0, 1.59602734375, -.87078515625,
   1.1643828125, -.39176171875,    -.81296875,     .52959375,
   1.1643828125,   2.017234375,             0,  -1.081390625,
              0,             0,             0,             1
  );

  void main(void) {
   vec4 pix = vec4(texture2D(yTexture,  v_texCoord).x, texture2D(uTexture, v_texCoord).x, texture2D(vTexture, v_texCoord).x, 1) * YUV2RGB;
   pix.w = 1.0;
   // pix.w = 1.0;
   gl_FragColor = pix;
  }
{'fraction_non_alphanumeric': 0.11434463794683776, 'fraction_numerical': 0.134967919340055, 'mean_word_length': 2.5201612903225805, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2958470', 'n_tokens_mistral': 2026, 'n_tokens_neox': 1734, 'n_words': 355}