@@ -20,9 +20,9 @@ julia> using Colors
20
20
21
21
julia> img = [RGB(1,0,0) RGB(0,1,0);
22
22
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)
26
26
```
27
27
28
28
which displays as
@@ -50,7 +50,7 @@ That said, occasionally there are reasons to want to treat `RGB` as a
50
50
51
51
``` jldoctest
52
52
julia> 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 :
54
54
[:, :, 1] =
55
55
1.0 0.0
56
56
0.0 0.0
@@ -70,7 +70,7 @@ another view called `rawview`:
70
70
71
71
``` jldoctest
72
72
julia> 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:
74
74
[:, :, 1] =
75
75
0xff 0x00
76
76
0x00 0x00
110
110
111
111
``` jldoctest
112
112
julia> 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:
114
114
[:, :, 1] =
115
115
0xff 0x00
116
116
0x00 0x00
@@ -122,7 +122,7 @@ julia> r
122
122
0x00 0x00
123
123
124
124
julia> v
125
- 3×2×2 reinterpret(N0f8, ::Array {RGB{N0f8},3}) :
125
+ 3×2×2 reinterpret(reshape, N0f8, ::Matrix {RGB{N0f8}}) with eltype N0f8 :
126
126
[:, :, 1] =
127
127
1.0 0.0
128
128
0.0 0.0
@@ -134,9 +134,9 @@ julia> v
134
134
0.0 0.0
135
135
136
136
julia> 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)
140
140
```
141
141
142
142
The hexadecimal representation of 128 is 0x80; this is approximately
@@ -150,7 +150,7 @@ rather than the first. We can achieve that using `PermutedDimsArray`:
150
150
151
151
``` jldoctest
152
152
julia> 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 :
154
154
[:, :, 1] =
155
155
1.0 0.0
156
156
0.0 0.0
@@ -164,13 +164,13 @@ julia> p = PermutedDimsArray(v, (2,3,1))
164
164
1.0 0.0
165
165
166
166
julia> 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 :
168
168
0.251N0f8
169
169
0.251N0f8
170
170
0.251N0f8
171
171
172
172
julia> 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 :
174
174
[:, :, 1] =
175
175
1.0 0.251
176
176
0.0 0.0
@@ -184,7 +184,7 @@ julia> p
184
184
1.0 0.0
185
185
186
186
julia> v
187
- 3×2×2 reinterpret(N0f8, ::Array {RGB{N0f8},3}) :
187
+ 3×2×2 reinterpret(reshape, N0f8, ::Matrix {RGB{N0f8}}) with eltype N0f8 :
188
188
[:, :, 1] =
189
189
1.0 0.0
190
190
0.0 0.0
@@ -196,9 +196,9 @@ julia> v
196
196
0.251 0.0
197
197
198
198
julia> 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)
202
202
```
203
203
204
204
Once again, ` p ` is a view, and as a consequence changing it leads to
0 commit comments