Skip to content

Commit e48cc27

Browse files
author
c
committed
Renamed ImageSettings to ImageDataSettings, and removed its companion object
Added enum PredefinedColorSpace
1 parent b874db2 commit e48cc27

File tree

7 files changed

+40
-20
lines changed

7 files changed

+40
-20
lines changed

api-reports/2_12.txt

+4-3
Original file line numberDiff line numberDiff line change
@@ -15654,9 +15654,7 @@ ImageCapture[JC] val track: MediaStreamTrack
1565415654
ImageData[JC] def data: Uint8ClampedArray
1565515655
ImageData[JC] def height: Int
1565615656
ImageData[JC] def width: Int
15657-
ImageSettings[JT] var colorSpace: js.UndefOr[String]
15658-
ImageSettings[SO] lazy val displayP3: ImageSettings
15659-
ImageSettings[SO] lazy val sRGB: ImageSettings
15657+
ImageDataSettings[JT] var colorSpace: js.UndefOr[PredefinedColorSpace]
1566015658
InputEvent[JC] def bubbles: Boolean
1566115659
InputEvent[JC] def cancelBubble: Boolean
1566215660
InputEvent[JC] def cancelable: Boolean
@@ -17212,6 +17210,9 @@ PositionError[JT] def message: String
1721217210
PositionOptions[JC] var enableHighAccuracy: Boolean
1721317211
PositionOptions[JC] var maximumAge: Int
1721417212
PositionOptions[JC] var timeout: Int
17213+
PredefinedColorSpace[JT]
17214+
PredefinedColorSpace[SO] val `display-p3`: PredefinedColorSpace
17215+
PredefinedColorSpace[SO] val srgb: PredefinedColorSpace
1721517216
PresentationStyle[JT]
1721617217
PresentationStyle[SO] val attachment: PresentationStyle
1721717218
PresentationStyle[SO] val inline: PresentationStyle

api-reports/2_13.txt

+4-3
Original file line numberDiff line numberDiff line change
@@ -15654,9 +15654,7 @@ ImageCapture[JC] val track: MediaStreamTrack
1565415654
ImageData[JC] def data: Uint8ClampedArray
1565515655
ImageData[JC] def height: Int
1565615656
ImageData[JC] def width: Int
15657-
ImageSettings[JT] var colorSpace: js.UndefOr[String]
15658-
ImageSettings[SO] lazy val displayP3: ImageSettings
15659-
ImageSettings[SO] lazy val sRGB: ImageSettings
15657+
ImageDataSettings[JT] var colorSpace: js.UndefOr[PredefinedColorSpace]
1566015658
InputEvent[JC] def bubbles: Boolean
1566115659
InputEvent[JC] def cancelBubble: Boolean
1566215660
InputEvent[JC] def cancelable: Boolean
@@ -17212,6 +17210,9 @@ PositionError[JT] def message: String
1721217210
PositionOptions[JC] var enableHighAccuracy: Boolean
1721317211
PositionOptions[JC] var maximumAge: Int
1721417212
PositionOptions[JC] var timeout: Int
17213+
PredefinedColorSpace[JT]
17214+
PredefinedColorSpace[SO] val `display-p3`: PredefinedColorSpace
17215+
PredefinedColorSpace[SO] val srgb: PredefinedColorSpace
1721517216
PresentationStyle[JT]
1721617217
PresentationStyle[SO] val attachment: PresentationStyle
1721717218
PresentationStyle[SO] val inline: PresentationStyle
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package org.scalajs.dom
2+
3+
import scala.scalajs.js
4+
5+
@js.native
6+
sealed trait PredefinedColorSpace extends js.Any
7+
8+
object PredefinedColorSpace {
9+
val srgb: PredefinedColorSpace = "srgb".asInstanceOf[PredefinedColorSpace]
10+
11+
val `display-p3`: PredefinedColorSpace = "display-p3".asInstanceOf[PredefinedColorSpace]
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package org.scalajs.dom
2+
3+
import scala.scalajs.js
4+
5+
opaque type PredefinedColorSpace <: String = String
6+
7+
object PredefinedColorSpace {
8+
val srgb: PredefinedColorSpace = "srgb"
9+
10+
val `display-p3`: PredefinedColorSpace = "display-p3"
11+
}

dom/src/main/scala/org/scalajs/dom/ImageData.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class ImageData extends js.Object {
5252
* @param settings
5353
* image settings
5454
*/
55-
def this(width: Int, height: Int, settings: ImageSettings) = this()
55+
def this(width: Int, height: Int, settings: ImageDataSettings) = this()
5656

5757
/** Create a blank ImageData instance from specified pixel data, width, height, and settings object.
5858
* @param data
@@ -64,7 +64,7 @@ class ImageData extends js.Object {
6464
* @param settings
6565
* image settings
6666
*/
67-
def this(data: Uint8ClampedArray, width: Int, height: Int, settings: ImageSettings) = this()
67+
def this(data: Uint8ClampedArray, width: Int, height: Int, settings: ImageDataSettings) = this()
6868

6969
/** Is an unsigned long representing the actual width, in pixels, of the ImageData. */
7070
def width: Int = js.native
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package org.scalajs.dom
2+
3+
import scala.scalajs.js
4+
5+
trait ImageDataSettings extends js.Object {
6+
var colorSpace: js.UndefOr[PredefinedColorSpace] = js.undefined
7+
}

dom/src/main/scala/org/scalajs/dom/ImageSettings.scala

-12
This file was deleted.

0 commit comments

Comments
 (0)