Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/dom/canvas/test/   (Firefox Browser Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 2 kB image not shown  

Quelle  imagebitmap_bug1239752.js

  Sprache: JAVA
 

var RGBAValues = [
  [4214223148],
  [23416517791],
  [7422875195],
  [1401087365],
  [251773201],
  [12710412199],
  [19693240131],
  [250121231189],
  [175131215190],
  [14512216670],
  [18196210162],
  [225190188],
  [223216182233],
  [1154816856],
  [50206198199],
  [1522870130],
  [17613413351],
  [1484643144],
  [7817114195],
  [24177102110],
  [02712791],
  [3122141170],
  [857218146],
  [6530198238],
  [1215612388],
  [24639140146],
  [174195254149],
  [2915392116],
  [172405111],
  [3816284143],
  [237159201244],
  [936814246],
  [14314282221],
  [187215243154],
  [2412122053],
  [80153151219],
  [202241250191],
];

function createOneTest(rgbaValue) {
  return new Promise(function (resolve, reject) {
    var tolerance = 5;
    var r = rgbaValue[0];
    var g = rgbaValue[1];
    var b = rgbaValue[2];
    var a = rgbaValue[3];
    var imageData = new ImageData(new Uint8ClampedArray([r, g, b, a]), 11);

    var newImageData;
    createImageBitmap(imageData).then(
      function (imageBitmap) {
        var context = document.createElement("canvas").getContext("2d");
        context.drawImage(imageBitmap, 00);
        newImageData = context.getImageData(0011);
        var newR = newImageData.data[0];
        var newG = newImageData.data[1];
        var newB = newImageData.data[2];
        var newA = newImageData.data[3];
        var isTheSame =
          Math.abs(r - newR) <= tolerance &&
          Math.abs(g - newG) <= tolerance &&
          Math.abs(b - newB) <= tolerance &&
          Math.abs(a - newA) <= tolerance;
        ok(
          isTheSame,
          "newImageData(" +
            newR +
            "," +
            newG +
            "," +
            newB +
            "," +
            newA +
            ") should equal to imageData(" +
            r +
            "," +
            g +
            "," +
            b +
            "," +
            a +
            ")." +
            "Premultiplied Alpha is handled while creating ImageBitmap from ImageData."
        );
        if (isTheSame) {
          resolve();
        } else {
          reject();
        }
      },
      function () {
        reject();
      }
    );
  });
}

function testBug1239752() {
  var tests = [];
  for (var i = 0; i < RGBAValues.length; ++i) {
    tests.push(createOneTest(RGBAValues[i]));
  }

  return Promise.all(tests);
}

Messung V0.5 in Prozent
C=100 H=94 G=96

¤ Dauer der Verarbeitung: 0.10 Sekunden  (vorverarbeitet am  2026-06-09) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.