hdr-canvas 0.0.6 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -29,5 +29,7 @@ declare function checkHDR(): boolean;
29
29
  declare function checkHDRCanvas(): boolean;
30
30
 
31
31
  declare function initHDRCanvas(canvas: HDRHTMLCanvasElement): RenderingContext | null;
32
+ declare function defaultGetContextHDR(): void;
33
+ declare function resetGetContext(): void;
32
34
 
33
- export { Uint16Image, checkHDR, checkHDRCanvas, initHDRCanvas };
35
+ export { Uint16Image, checkHDR, checkHDRCanvas, defaultGetContextHDR, initHDRCanvas, resetGetContext };
@@ -5938,6 +5938,23 @@ function initHDRCanvas(canvas) {
5938
5938
  const ctx = canvas.getContext("2d", hdr_options);
5939
5939
  return ctx;
5940
5940
  }
5941
+ function defaultGetContextHDR() {
5942
+ HTMLCanvasElement.prototype._getContext = HTMLCanvasElement.prototype.getContext;
5943
+ HTMLCanvasElement.prototype.getContext = function (type, options) {
5944
+ if (options !== undefined) {
5945
+ options = Object.assign({}, options, hdr_options);
5946
+ }
5947
+ else {
5948
+ options = hdr_options;
5949
+ }
5950
+ return this._getContext(type, options);
5951
+ };
5952
+ }
5953
+ function resetGetContext() {
5954
+ if (typeof HTMLCanvasElement.prototype._getContext === "function") {
5955
+ HTMLCanvasElement.prototype.getContext = HTMLCanvasElement.prototype._getContext;
5956
+ }
5957
+ }
5941
5958
 
5942
- export { Uint16Image, checkHDR, checkHDRCanvas, initHDRCanvas };
5959
+ export { Uint16Image, checkHDR, checkHDRCanvas, defaultGetContextHDR, initHDRCanvas, resetGetContext };
5943
5960
  //# sourceMappingURL=hdr-canvas.js.map