Skip to content

Commit bb88815

Browse files
committed
Removed some unnecessary comments and corrected errors in others.
1 parent 3a96876 commit bb88815

File tree

17 files changed

+18
-95
lines changed

17 files changed

+18
-95
lines changed

uriel/shared/src/main/scala/ai/dragonfly/uriel/cie/Illuminant.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ import narr.*
2020

2121
import slash.matrix.*
2222

23-
24-
2523
/**
2624
* From: https://en.wikipedia.org/wiki/Standard_illuminant
2725
* "A standard illuminant is a theoretical source of visible light with a spectral power distribution that is published.

uriel/shared/src/main/scala/ai/dragonfly/uriel/color/model/huesat/HSL.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ trait HSL extends HueSaturation { self: WorkingSpace =>
4141
}
4242

4343
/**
44-
* HSL is the primary case class for representing colors in HSL space.
44+
* HSL is the primary type for representing colors in HSL space.
4545
*
4646
* @constructor Create a new HSV object from three Double values. This constructor does not validate input parameters.
4747
* For values taken from user input, sensors, or otherwise uncertain sources, consider using the factory method in the Color companion object.

uriel/shared/src/main/scala/ai/dragonfly/uriel/color/model/huesat/HSV.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ trait HSV extends HueSaturation { self: WorkingSpace =>
4141
}
4242

4343
/**
44-
* HSV is the primary case class for representing colors in HSV space.
44+
* HSV is the primary type for representing colors in HSV space.
4545
*
4646
* @constructor Create a new HSV object from three Double values. This constructor does not validate
4747
* input parameters. For values taken from user input, sensors, or otherwise uncertain sources, consider using

uriel/shared/src/main/scala/ai/dragonfly/uriel/color/model/perceptual/Lab.scala

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ trait Lab { self: WorkingSpace =>
4646
*/
4747
def apply(L: Double, a: Double, b: Double): Lab = apply(NArray[Double](a, b, L))
4848

49-
// override val rgbGamut:Gamut = Gamut.fromRGB(transform = (v:XYZ) => Vector3(fromXYZ(v).values))
50-
// override def toString:String = s"${illuminant}L*a*b*"
51-
5249
inline def f(t: Double): Double = if (t > ϵ) Math.cbrt(t) else (t * `k/116`) + `16/116`
5350

5451
inline def fInverse(t: Double): Double = if (t > `∛ϵ`) cubeInPlace(t) else (`116/k` * t) - `16/k`
@@ -99,9 +96,6 @@ trait Lab { self: WorkingSpace =>
9996
override def toString:String = "Lab"
10097
}
10198

102-
// case class Lab private(override val values: NArray[Double]) extends PerceptualColorModel[Lab] {
103-
// override type VEC = this.type with Lab
104-
10599
type Lab = Lab.Lab
106100

107101
given PerceptualColorModel[Lab] with {

uriel/shared/src/main/scala/ai/dragonfly/uriel/color/model/perceptual/Luv.scala

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,6 @@ trait Luv { self: WorkingSpace =>
103103
)
104104
}
105105

106-
// override val rgbGamut:Gamut = Gamut.fromRGB(transform = (v:XYZ) => Vector3(fromXYZ(v).values))
107-
108-
// override def toString:String = s"${illuminant}L*u*v*"
109-
110106
def L(luv: Luv): Double = luv(2)
111107

112108
def u(luv: Luv): Double = luv(0)
@@ -121,14 +117,11 @@ trait Luv { self: WorkingSpace =>
121117
}
122118

123119
/**
124-
* LUV is the base trait for classes that encode colors in the CIE L*u*v* color space.
120+
* LUV is the primary type to represent colors from the CIE L*u*v* color space.
125121
*
126122
* @see [[https://en.wikipedia.org/wiki/CIELUV]] for more information on CIE L*u*v*.
127123
*/
128124

129-
// case class Luv private(override val values: NArray[Double]) extends PerceptualColorModel[Luv] {
130-
// override type VEC = this.type with Luv
131-
132125
type Luv = Luv.Luv
133126

134127
given PerceptualColorModel[Luv] with {

uriel/shared/src/main/scala/ai/dragonfly/uriel/color/model/perceptual/XYZ.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ trait XYZ { self:WorkingSpace =>
8282

8383
type XYZ = XYZ.XYZ
8484

85-
given PerceptualColorModel[XYZ] with { //case class XYZ private(override val values: NArray[Double]) extends PerceptualColorModel[XYZ] {
85+
given PerceptualColorModel[XYZ] with {
8686
extension (xyz: XYZ) {
8787
override inline def copy: XYZ = XYZ.copy(xyz)
8888

uriel/shared/src/main/scala/ai/dragonfly/uriel/color/model/rgb/LRGB.scala

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,6 @@ trait LRGB { self: WorkingSpace =>
5454
*/
5555
def apply(red: Double, green: Double, blue: Double): LRGB = apply(NArray[Double](red, green, blue))
5656

57-
// def apply(argb: ARGB32): RGB = apply(`1/255` * argb.red, `1/255` * argb.green, `1/255` * argb.blue)
58-
//
59-
// def apply(rgba: RGBA32): RGB = apply(`1/255` * rgba.red, `1/255` * rgba.green, `1/255` * rgba.blue)
60-
61-
//override def fromRGB(rgb: RGB): RGB = apply(rgb.red, rgb.green, rgb.blue)
62-
6357
/**
6458
* Factory method to create a fully Opaque RGB color; one with an alpha value of 1.0.
6559
* Because this method validates each intensity, it sacrifices performance for safety.
@@ -117,8 +111,6 @@ trait LRGB { self: WorkingSpace =>
117111
override def toString:String = "LRGB"
118112
}
119113

120-
// case class RGB private(override val values: NArray[Double]) extends VectorColorModel[RGB] {
121-
// override type VEC = this.type with RGB
122114
type LRGB = LRGB.LRGB
123115

124116
given VectorColorModel[LRGB] with {

uriel/shared/src/main/scala/ai/dragonfly/uriel/color/model/rgb/RGB.scala

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,6 @@ trait RGB { self: WorkingSpace =>
5555
*/
5656
def apply(red: Double, green: Double, blue: Double): RGB = apply(NArray[Double](red, green, blue))
5757

58-
// def apply(argb: ARGB32): RGB = apply(`1/255` * argb.red, `1/255` * argb.green, `1/255` * argb.blue)
59-
//
60-
// def apply(rgba: RGBA32): RGB = apply(`1/255` * rgba.red, `1/255` * rgba.green, `1/255` * rgba.blue)
61-
62-
//override def fromRGB(rgb: RGB): RGB = apply(rgb.red, rgb.green, rgb.blue)
63-
6458
/**
6559
* Factory method to create a fully Opaque RGB color; one with an alpha value of 1.0.
6660
* Because this method validates each intensity, it sacrifices performance for safety.
@@ -116,8 +110,6 @@ trait RGB { self: WorkingSpace =>
116110
override def toString:String = "RGB"
117111
}
118112

119-
// case class RGB private(override val values: NArray[Double]) extends VectorColorModel[RGB] {
120-
// override type VEC = this.type with RGB
121113
type RGB = RGB.RGB
122114

123115
given VectorColorModel[RGB] with {

uriel/shared/src/main/scala/ai/dragonfly/uriel/color/model/rgb/discrete/ARGB32.scala

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,14 @@ trait ARGB32 extends DiscreteRGB { self: WorkingSpace =>
155155
type ARGB32 = ARGB32.ARGB32
156156

157157
/**
158-
* ARGB is the primary case class for representing colors in ARGB space.
158+
* ARGB is the primary type for representing colors in ARGB space.
159159
*
160160
* @constructor Create a new ARGB object from an Int.
161161
* @see [[https://en.wikipedia.org/wiki/RGB_color_space]] for more information on the RGB color space.
162162
* @param argb a 32 bit integer that represents this color in ARGB space.
163163
* The most significant byte encodes the alpha value, the second most significant byte encodes red,
164164
* the third most significant byte encodes green, and the least significant byte encodes blue.
165-
* @return an instance of the ARGB case class.
165+
* @return an instance of the ARGB color model.
166166
* @example {{{
167167
* val c = ARGB32(-1) // returns fully opaque white
168168
* c.toString() // returns "ARGB32(255,255,255,255)"
@@ -172,7 +172,6 @@ trait ARGB32 extends DiscreteRGB { self: WorkingSpace =>
172172
given DiscreteRGB[ARGB32] with {
173173
extension (argb: ARGB32) {
174174

175-
///case class ARGB32(argb: Int) extends DiscreteRGB[ARGB32] {
176175
/**
177176
* @return the alpha component of this color in ARGB space.
178177
*/
@@ -197,19 +196,6 @@ trait ARGB32 extends DiscreteRGB { self: WorkingSpace =>
197196

198197
override def similarity(that: ARGB32): Double = ARGB32.similarity(argb, that)
199198

200-
// /**
201-
// * @return the hashcode. For all color types, the hashcode function returns the same result as argb
202-
// */
203-
// def hashCode: Int = argb
204-
205-
// /**
206-
// * @return true if these colors are equal in ARGB32 space, false otherwise
207-
// */
208-
// def equals(obj: Any): Boolean = obj match {
209-
// case that: ARGB32 => argb == that
210-
// case _ => false
211-
// }
212-
213199
/**
214200
* @return a hexadecimal string representing the rgba integer for this color.
215201
* @example {{{

uriel/shared/src/main/scala/ai/dragonfly/uriel/color/model/rgb/discrete/ARGB64.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,14 @@ trait ARGB64 extends DiscreteRGB { self: WorkingSpace =>
136136
type ARGB64 = ARGB64.ARGB64
137137

138138
/**
139-
* ARGB64 is the primary case class for representing colors in ARGB64 space.
139+
* ARGB64 is the primary type for representing colors in ARGB64 space.
140140
*
141141
* @constructor Create a new ARGB64 object from an Int.
142142
* @see [[https://en.wikipedia.org/wiki/RGB_color_space]] for more information on the RGB color space.
143143
* @param argb a 64 bit integer that represents this color in ARGB64 space.
144144
* The most significant byte encodes the alpha value, the second most significant byte encodes red,
145145
* the third most significant byte encodes green, and the least significant byte encodes blue.
146-
* @return an instance of the ARGB64 case class.
146+
* @return an instance of the ARGB64 type.
147147
* @example {{{
148148
* val c = ARGB(-1) // returns fully opaque white
149149
* c.toString() // returns "ARGB(65535,65535,65535,65535)"
@@ -152,7 +152,6 @@ trait ARGB64 extends DiscreteRGB { self: WorkingSpace =>
152152
*/
153153
given DiscreteRGB[ARGB64] with {
154154
extension (argb: ARGB64) {
155-
//case class ARGB64(argb: Long) extends DiscreteRGB[ARGB64] {
156155
/**
157156
* @return the alpha component of this color in ARGB64 space.
158157
*/

0 commit comments

Comments
 (0)