@@ -20,9 +20,9 @@ julia> using Colors
2020
2121julia> img = [RGB(1,0,0) RGB(0,1,0);
2222 RGB(0,0,1) RGB(0,0,0)]
23- 2×2 Array {RGB{N0f8},2} with eltype RGB{ FixedPointNumbers.Normed{UInt8,8 }}:
24- RGB{N0f8} (1.0,0.0,0.0) RGB{N0f8} (0.0,1.0,0.0)
25- RGB{N0f8} (0.0,0.0,1.0) RGB{N0f8} (0.0,0.0,0.0)
23+ 2×2 Matrix {RGB{FixedPointNumbers.N0f8 }}:
24+ RGB(1.0, 0.0, 0.0) RGB(0.0, 1.0, 0.0)
25+ RGB(0.0, 0.0, 1.0) RGB(0.0, 0.0, 0.0)
2626```
2727
2828which displays as
@@ -50,7 +50,7 @@ That said, occasionally there are reasons to want to treat `RGB` as a
5050
5151``` jldoctest
5252julia> v = channelview(img)
53- 3×2×2 reinterpret(N0f8, ::Array {RGB{N0f8},3}) :
53+ 3×2×2 reinterpret(reshape, N0f8, ::Matrix {RGB{N0f8}}) with eltype N0f8 :
5454[:, :, 1] =
5555 1.0 0.0
5656 0.0 0.0
@@ -70,7 +70,7 @@ another view called `rawview`:
7070
7171``` jldoctest
7272julia> r = rawview(v)
73- 3×2×2 rawview(reinterpret(N0f8, ::Array {RGB{N0f8},3 })) with eltype UInt8:
73+ 3×2×2 rawview(reinterpret(reshape, N0f8, ::Matrix {RGB{N0f8}})) with eltype UInt8:
7474[:, :, 1] =
7575 0xff 0x00
7676 0x00 0x00
110110
111111``` jldoctest
112112julia> r
113- 3×2×2 rawview(reinterpret(N0f8, ::Array {RGB{N0f8},3 })) with eltype UInt8:
113+ 3×2×2 rawview(reinterpret(reshape, N0f8, ::Matrix {RGB{N0f8}})) with eltype UInt8:
114114[:, :, 1] =
115115 0xff 0x00
116116 0x00 0x00
@@ -122,7 +122,7 @@ julia> r
122122 0x00 0x00
123123
124124julia> v
125- 3×2×2 reinterpret(N0f8, ::Array {RGB{N0f8},3}) :
125+ 3×2×2 reinterpret(reshape, N0f8, ::Matrix {RGB{N0f8}}) with eltype N0f8 :
126126[:, :, 1] =
127127 1.0 0.0
128128 0.0 0.0
@@ -134,9 +134,9 @@ julia> v
134134 0.0 0.0
135135
136136julia> img
137- 2×2 Array {RGB{N0f8},2} with eltype RGB{Normed{UInt8,8 }}:
138- RGB{N0f8} (1.0,0.0,0.502) RGB{N0f8} (0.0,1.0,0.0)
139- RGB{N0f8} (0.0,0.0,1.0) RGB{N0f8} (0.0,0.0,0.0)
137+ 2×2 Matrix {RGB{N0f8}}:
138+ RGB(1.0, 0.0, 0.502) RGB(0.0, 1.0, 0.0)
139+ RGB(0.0, 0.0, 1.0) RGB(0.0, 0.0, 0.0)
140140```
141141
142142The hexadecimal representation of 128 is 0x80; this is approximately
@@ -150,7 +150,7 @@ rather than the first. We can achieve that using `PermutedDimsArray`:
150150
151151``` jldoctest
152152julia> p = PermutedDimsArray(v, (2,3,1))
153- 2×2×3 PermutedDimsArray(reinterpret(N0f8, ::Array {RGB{N0f8},3 }), (2, 3, 1)) with eltype Normed{UInt8,8} :
153+ 2×2×3 PermutedDimsArray(reinterpret(reshape, N0f8, ::Matrix {RGB{N0f8}}), (2, 3, 1)) with eltype N0f8 :
154154[:, :, 1] =
155155 1.0 0.0
156156 0.0 0.0
@@ -164,13 +164,13 @@ julia> p = PermutedDimsArray(v, (2,3,1))
164164 1.0 0.0
165165
166166julia> p[1,2,:] .= 0.25
167- 3-element view(PermutedDimsArray(reinterpret(N0f8, ::Array {RGB{N0f8},3 }), (2, 3, 1)), 1, 2, :) with eltype Normed{UInt8,8} :
167+ 3-element view(PermutedDimsArray(reinterpret(reshape, N0f8, ::Matrix {RGB{N0f8}}), (2, 3, 1)), 1, 2, :) with eltype N0f8 :
168168 0.251N0f8
169169 0.251N0f8
170170 0.251N0f8
171171
172172julia> p
173- 2×2×3 PermutedDimsArray(reinterpret(N0f8, ::Array {RGB{N0f8},3 }), (2, 3, 1)) with eltype Normed{UInt8,8} :
173+ 2×2×3 PermutedDimsArray(reinterpret(reshape, N0f8, ::Matrix {RGB{N0f8}}), (2, 3, 1)) with eltype N0f8 :
174174[:, :, 1] =
175175 1.0 0.251
176176 0.0 0.0
@@ -184,7 +184,7 @@ julia> p
184184 1.0 0.0
185185
186186julia> v
187- 3×2×2 reinterpret(N0f8, ::Array {RGB{N0f8},3}) :
187+ 3×2×2 reinterpret(reshape, N0f8, ::Matrix {RGB{N0f8}}) with eltype N0f8 :
188188[:, :, 1] =
189189 1.0 0.0
190190 0.0 0.0
@@ -196,9 +196,9 @@ julia> v
196196 0.251 0.0
197197
198198julia> img
199- 2×2 Array {RGB{N0f8},2} with eltype RGB{Normed{UInt8,8 }}:
200- RGB{N0f8} (1.0,0.0,0.502) RGB{N0f8} (0.251,0.251,0.251)
201- RGB{N0f8} (0.0,0.0,1.0) RGB{N0f8} (0.0,0.0,0.0)
199+ 2×2 Matrix {RGB{N0f8}}:
200+ RGB(1.0, 0.0, 0.502) RGB(0.251, 0.251, 0.251)
201+ RGB(0.0, 0.0, 1.0) RGB(0.0, 0.0, 0.0)
202202```
203203
204204Once again, ` p ` is a view, and as a consequence changing it leads to
0 commit comments