author | Claus Gittinger <cg@exept.de> |
Mon, 04 May 2020 19:15:18 +0200 | |
changeset 9041 | b3621d52dd8c |
parent 8321 | d1814cac8c46 |
permissions | -rw-r--r-- |
3 | 1 |
" |
2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
81 | 3 |
All Rights Reserved |
3 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
3263 | 12 |
"{ Package: 'stx:libview' }" |
13 |
||
7500 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
1 | 16 |
Image subclass:#Depth2Image |
579 | 17 |
instanceVariableNames:'' |
18 |
classVariableNames:'' |
|
19 |
poolDictionaries:'' |
|
20 |
category:'Graphics-Images' |
|
1 | 21 |
! |
22 |
||
46 | 23 |
!Depth2Image class methodsFor:'documentation'! |
24 |
||
25 |
copyright |
|
26 |
" |
|
27 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
81 | 28 |
All Rights Reserved |
3 | 29 |
|
46 | 30 |
This software is furnished under a license and may be used |
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
37 |
! |
|
3 | 38 |
|
46 | 39 |
documentation |
40 |
" |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
41 |
this class represents four-color (2 bit / pixel) images |
46 | 42 |
(as used mainly on the NeXT). |
43 |
It mainly consists of methods already implemented in Image, |
|
44 |
reimplemented here for more performance. |
|
611 | 45 |
|
798 | 46 |
#blackIs0 / #whiteIs0 and #palette formats are supported here. |
47 |
||
611 | 48 |
[author:] |
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
49 |
Claus Gittinger |
611 | 50 |
|
51 |
[see also:] |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
52 |
Depth1Image Depth4Image Depth8Image Depth16Image Depth24Image |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
53 |
ImageReader |
46 | 54 |
" |
55 |
! ! |
|
3 | 56 |
|
89 | 57 |
!Depth2Image class methodsFor:'queries'! |
58 |
||
59 |
imageDepth |
|
579 | 60 |
"return the depth of images represented by instances of |
61 |
this class - here we return 2" |
|
62 |
||
89 | 63 |
^ 2 |
579 | 64 |
|
65 |
"Modified: 20.4.1996 / 23:40:12 / cg" |
|
89 | 66 |
! ! |
67 |
||
3263 | 68 |
!Depth2Image methodsFor:'accessing-pixels'! |
1 | 69 |
|
1656
ebcad6911ddb
pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents:
813
diff
changeset
|
70 |
pixelAtX:x y:y |
8321 | 71 |
"retrieve a pixel at x/y; return a pixel value (0..3). |
7513 | 72 |
The interpretation of the returned value depends on the photometric |
73 |
and the colormap. See also Image>>atX:y:) |
|
1656
ebcad6911ddb
pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents:
813
diff
changeset
|
74 |
Pixels start at x=0 , y=0 for upper left pixel, end at |
ebcad6911ddb
pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents:
813
diff
changeset
|
75 |
x = width-1, y=height-1 for lower right pixel" |
ebcad6911ddb
pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents:
813
diff
changeset
|
76 |
|
ebcad6911ddb
pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents:
813
diff
changeset
|
77 |
|lineIndex "{ Class: SmallInteger }" |
ebcad6911ddb
pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents:
813
diff
changeset
|
78 |
byte "{ Class: SmallInteger }" |
ebcad6911ddb
pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents:
813
diff
changeset
|
79 |
shift "{ Class: SmallInteger }" | |
ebcad6911ddb
pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents:
813
diff
changeset
|
80 |
|
6300 | 81 |
pixelFunction notNil ifTrue:[^ pixelFunction value:x value:y]. |
82 |
||
1656
ebcad6911ddb
pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents:
813
diff
changeset
|
83 |
lineIndex := (self bytesPerRow * y) + 1. |
ebcad6911ddb
pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents:
813
diff
changeset
|
84 |
|
ebcad6911ddb
pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents:
813
diff
changeset
|
85 |
"left pixel in high bits" |
ebcad6911ddb
pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents:
813
diff
changeset
|
86 |
byte := bytes at:(lineIndex + (x // 4)). |
ebcad6911ddb
pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents:
813
diff
changeset
|
87 |
shift := #(-6 -4 -2 0) at:((x \\ 4) + 1). |
ebcad6911ddb
pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents:
813
diff
changeset
|
88 |
^ (byte bitShift:shift) bitAnd:3. |
ebcad6911ddb
pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents:
813
diff
changeset
|
89 |
|
ebcad6911ddb
pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents:
813
diff
changeset
|
90 |
"Created: 24.4.1997 / 16:06:39 / cg" |
ebcad6911ddb
pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents:
813
diff
changeset
|
91 |
! |
ebcad6911ddb
pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents:
813
diff
changeset
|
92 |
|
ebcad6911ddb
pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents:
813
diff
changeset
|
93 |
pixelAtX:x y:y put:aPixelValue |
8321 | 94 |
"set the pixel at x/y to aPixelValue (0..3). |
7513 | 95 |
The interpretation of the pixelValue depends on the photometric |
96 |
and the colormap. (see also: Image>>atX:y:put:) |
|
1 | 97 |
Pixels start at x=0 , y=0 for upper left pixel, end at |
98 |
x = width-1, y=height-1 for lower right pixel" |
|
99 |
||
38 | 100 |
|lineIndex "{ Class: SmallInteger }" |
101 |
index "{ Class: SmallInteger }" |
|
102 |
byte "{ Class: SmallInteger }" |
|
103 |
shift "{ Class: SmallInteger }" | |
|
1 | 104 |
|
8196 | 105 |
bytes isNil ifTrue:[ self createPixelStore ]. |
106 |
||
1 | 107 |
lineIndex := (self bytesPerRow * y) + 1. |
108 |
||
109 |
"left pixel is in high bits" |
|
110 |
index := lineIndex + (x // 4). |
|
111 |
byte := bytes at:index. |
|
7818 | 112 |
shift := #[6 4 2 0] at:((x \\ 4) + 1). |
1 | 113 |
byte := (byte bitAnd:(3 bitShift:shift) bitInvert) bitOr:(aPixelValue bitShift:shift). |
114 |
bytes at:index put:byte |
|
115 |
||
7818 | 116 |
"Created: / 24-04-1997 / 17:06:36 / cg" |
117 |
"Modified: / 30-01-2017 / 19:22:33 / stefan" |
|
1 | 118 |
! ! |
119 |
||
3178 | 120 |
!Depth2Image methodsFor:'converting images'! |
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
121 |
|
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
122 |
anyImageAsTrueColorFormOn:aDevice |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
123 |
"return a true-color device-form for the receiver. |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
124 |
Supports true color devices with depths: 8, 16, 24 and 32" |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
125 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
126 |
|depth |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
127 |
colorValues |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
128 |
form imageBits bestFormat usedDeviceDepth usedDeviceBitsPerPixel |
3851
34637f468b2a
also handle subclasses of ExternalBytes (Mapped..)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
129 |
usedDevicePadding usedDeviceBytesPerRow padd| |
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
130 |
|
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
131 |
depth := aDevice depth. |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
132 |
|
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
133 |
"/ gather r/g/b values for all colors in the map ... |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
134 |
|
2204
d58ed106b422
use common colorMap helper when converting to rgb-device form
Claus Gittinger <cg@exept.de>
parents:
2201
diff
changeset
|
135 |
colorValues := self rgbColormapFor:aDevice. |
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
136 |
|
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
137 |
bestFormat := self bestSupportedImageFormatFor:aDevice. |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
138 |
usedDeviceDepth := bestFormat at:#depth. |
2864
dd151bfdff9d
care for deep devices which do not support deep bitmaps
Claus Gittinger <cg@exept.de>
parents:
2401
diff
changeset
|
139 |
usedDeviceDepth == 1 ifTrue:[ |
7500 | 140 |
^ self asMonochromeFormOn:aDevice |
2864
dd151bfdff9d
care for deep devices which do not support deep bitmaps
Claus Gittinger <cg@exept.de>
parents:
2401
diff
changeset
|
141 |
]. |
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
142 |
usedDeviceBitsPerPixel := bestFormat at:#bitsPerPixel. |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
143 |
usedDevicePadding := bestFormat at:#padding. |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
144 |
|
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
145 |
usedDeviceBytesPerRow := self class bytesPerRowForWidth:width depth:usedDeviceBitsPerPixel padding:usedDevicePadding. |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
146 |
padd := usedDeviceBytesPerRow -( self class bytesPerRowForWidth:width depth:usedDeviceBitsPerPixel padding:8). |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
147 |
imageBits := ByteArray uninitializedNew:(usedDeviceBytesPerRow * height). |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
148 |
|
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
149 |
"/ for now, only support some depths |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
150 |
|
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
151 |
usedDeviceBitsPerPixel == 16 ifTrue:[ |
7500 | 152 |
"/ 16 bits/pixel |
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
153 |
|
7500 | 154 |
"/ now, walk over the image and replace |
155 |
"/ colorMap indices by color values in the bits array |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
156 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
157 |
%{ |
7500 | 158 |
unsigned char *srcPtr = 0; |
159 |
unsigned char *dstPtr = 0; |
|
160 |
OBJ _bytes = __INST(bytes); |
|
3851
34637f468b2a
also handle subclasses of ExternalBytes (Mapped..)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
161 |
|
7500 | 162 |
if (__isByteArrayLike(_bytes)) { |
163 |
srcPtr = __ByteArrayInstPtr(_bytes)->ba_element; |
|
164 |
} else { |
|
165 |
if (__isExternalBytesLike(_bytes)) { |
|
166 |
srcPtr = __externalBytesAddress(_bytes); |
|
167 |
} |
|
168 |
} |
|
169 |
if (__isByteArray(imageBits)) { |
|
170 |
dstPtr = __ByteArrayInstPtr(imageBits)->ba_element; |
|
171 |
} else { |
|
172 |
if (__isExternalBytesLike(imageBits)) { |
|
173 |
dstPtr = __externalBytesAddress(imageBits); |
|
174 |
} |
|
175 |
} |
|
3851
34637f468b2a
also handle subclasses of ExternalBytes (Mapped..)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
176 |
|
7500 | 177 |
if (__bothSmallInteger(__INST(height), __INST(width)) |
178 |
&& __isArrayLike(colorValues) |
|
179 |
&& srcPtr |
|
180 |
&& dstPtr) { |
|
181 |
int r,p; |
|
182 |
int x, y, w, h, nPix; |
|
183 |
int byte, shift; |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
184 |
|
7500 | 185 |
OBJ *ap = __ArrayInstPtr(colorValues)->a_element; |
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
186 |
|
7500 | 187 |
w = __intVal(__INST(width)); |
188 |
h = __intVal(__INST(height)); |
|
189 |
r = 0; |
|
190 |
p = __intVal(padd); |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
191 |
|
7500 | 192 |
nPix = w * h; |
193 |
shift = -2; |
|
194 |
while (nPix-- > 0) { |
|
195 |
unsigned idx, v; |
|
196 |
OBJ clr; |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
197 |
|
7500 | 198 |
if (shift < 0) { |
199 |
byte = *srcPtr++; |
|
200 |
shift = 6; |
|
201 |
} |
|
202 |
idx = (byte >> shift) & 3; |
|
203 |
shift -= 2; |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
204 |
|
7500 | 205 |
clr = ap[idx]; |
206 |
v = __intVal(clr); |
|
2401 | 207 |
#ifdef __MSBFIRST |
7500 | 208 |
((short *)dstPtr)[0] = v; |
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
209 |
#else |
2225
8fb244eaaf90
the SWAP_BYTES macro does not work yet.
Claus Gittinger <cg@exept.de>
parents:
2214
diff
changeset
|
210 |
# ifdef xxSWAP_BYTES |
7500 | 211 |
SWAP_BYTES(v); |
212 |
((short *)dstPtr)[0] = v; |
|
2214
452bd64584d6
use SWAP_BYTES macro, if defined
Claus Gittinger <cg@exept.de>
parents:
2204
diff
changeset
|
213 |
# else |
7500 | 214 |
dstPtr[0] = (v>>8) & 0xFF; |
215 |
dstPtr[1] = (v) & 0xFF; |
|
2214
452bd64584d6
use SWAP_BYTES macro, if defined
Claus Gittinger <cg@exept.de>
parents:
2204
diff
changeset
|
216 |
# endif |
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
217 |
#endif |
7500 | 218 |
dstPtr += 2; |
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
219 |
|
7500 | 220 |
if (++r == w) { |
221 |
dstPtr += p; |
|
222 |
r = 0; |
|
223 |
shift = -2; |
|
224 |
} |
|
225 |
} |
|
226 |
} |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
227 |
%}. |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
228 |
] ifFalse:[ |
7500 | 229 |
usedDeviceBitsPerPixel == 32 ifTrue:[ |
230 |
"/ 32 bits/pixel |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
231 |
|
7500 | 232 |
"/ now, walk over the image and replace |
233 |
"/ colorMap indices by color values in the bits array |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
234 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
235 |
%{ |
7500 | 236 |
unsigned char *srcPtr = 0; |
237 |
unsigned char *dstPtr = 0; |
|
238 |
OBJ _bytes = __INST(bytes); |
|
3851
34637f468b2a
also handle subclasses of ExternalBytes (Mapped..)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
239 |
|
7500 | 240 |
if (__isByteArrayLike(_bytes)) { |
241 |
srcPtr = __ByteArrayInstPtr(_bytes)->ba_element; |
|
242 |
} else { |
|
243 |
if (__isExternalBytesLike(_bytes)) { |
|
244 |
srcPtr = __externalBytesAddress(_bytes); |
|
245 |
} |
|
246 |
} |
|
247 |
if (__isByteArray(imageBits)) { |
|
248 |
dstPtr = __ByteArrayInstPtr(imageBits)->ba_element; |
|
249 |
} else { |
|
250 |
if (__isExternalBytesLike(imageBits)) { |
|
251 |
dstPtr = __externalBytesAddress(imageBits); |
|
252 |
} |
|
253 |
} |
|
3851
34637f468b2a
also handle subclasses of ExternalBytes (Mapped..)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
254 |
|
7500 | 255 |
if (__bothSmallInteger(__INST(height), __INST(width)) |
256 |
&& __isArrayLike(colorValues) |
|
257 |
&& srcPtr |
|
258 |
&& dstPtr) { |
|
259 |
int x, y, w, h, nPix; |
|
260 |
int r,p; |
|
261 |
int byte, shift; |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
262 |
|
7500 | 263 |
OBJ *ap = __ArrayInstPtr(colorValues)->a_element; |
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
264 |
|
7500 | 265 |
w = __intVal(__INST(width)); |
266 |
h = __intVal(__INST(height)); |
|
267 |
r = 0; |
|
268 |
p = __intVal(padd); |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
269 |
|
7500 | 270 |
nPix = w * h; |
271 |
shift = -2; |
|
272 |
while (nPix > 0) { |
|
273 |
unsigned idx, v; |
|
274 |
OBJ clr; |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
275 |
|
7500 | 276 |
if (shift < 0) { |
277 |
byte = *srcPtr++; |
|
278 |
shift = 6; |
|
279 |
} |
|
280 |
idx = (byte >> shift) & 3; |
|
281 |
shift -= 2; |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
282 |
|
7500 | 283 |
clr = ap[idx]; |
284 |
v = __intVal(clr); |
|
2401 | 285 |
#ifdef __MSBFIRST |
7500 | 286 |
((long *)dstPtr)[0] = v; |
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
287 |
#else |
7500 | 288 |
dstPtr[0] = (v>>24) & 0xFF; |
289 |
dstPtr[1] = (v>>16) & 0xFF; |
|
290 |
dstPtr[2] = (v>>8) & 0xFF; |
|
291 |
dstPtr[3] = (v) & 0xFF; |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
292 |
#endif |
7500 | 293 |
dstPtr += 4; |
294 |
nPix--; |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
295 |
|
7500 | 296 |
if (++r == w) { |
297 |
dstPtr += p; |
|
298 |
r = 0; |
|
299 |
shift = -2; |
|
300 |
} |
|
301 |
} |
|
302 |
} |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
303 |
%}. |
7500 | 304 |
] ifFalse:[ |
305 |
usedDeviceBitsPerPixel == 8 ifTrue:[ |
|
306 |
"/ 8 bits/pixel |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
307 |
|
7500 | 308 |
"/ now, walk over the image and replace |
309 |
"/ colorMap indices by color values in the bits array |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
310 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
311 |
%{ |
7500 | 312 |
unsigned char *srcPtr = 0; |
313 |
unsigned char *dstPtr = 0; |
|
314 |
OBJ _bytes = __INST(bytes); |
|
3851
34637f468b2a
also handle subclasses of ExternalBytes (Mapped..)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
315 |
|
7500 | 316 |
if (__isByteArrayLike(_bytes)) { |
317 |
srcPtr = __ByteArrayInstPtr(_bytes)->ba_element; |
|
318 |
} else { |
|
319 |
if (__isExternalBytesLike(_bytes)) { |
|
320 |
srcPtr = __externalBytesAddress(_bytes); |
|
321 |
} |
|
322 |
} |
|
323 |
if (__isByteArray(imageBits)) { |
|
324 |
dstPtr = __ByteArrayInstPtr(imageBits)->ba_element; |
|
325 |
} else { |
|
326 |
if (__isExternalBytesLike(imageBits)) { |
|
327 |
dstPtr = __externalBytesAddress(imageBits); |
|
328 |
} |
|
329 |
} |
|
3851
34637f468b2a
also handle subclasses of ExternalBytes (Mapped..)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
330 |
|
7500 | 331 |
if (__bothSmallInteger(__INST(height), __INST(width)) |
332 |
&& __isArrayLike(colorValues) |
|
333 |
&& srcPtr |
|
334 |
&& dstPtr) { |
|
335 |
int x, y, w, h, nPix; |
|
336 |
int r,p, byte, shift; |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
337 |
|
7500 | 338 |
OBJ *ap = __ArrayInstPtr(colorValues)->a_element; |
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
339 |
|
7500 | 340 |
w = __intVal(__INST(width)); |
341 |
h = __intVal(__INST(height)); |
|
342 |
r = 0; |
|
343 |
p = __intVal(padd); |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
344 |
|
7500 | 345 |
nPix = w * h; |
346 |
shift = -2; |
|
347 |
while (nPix > 0) { |
|
348 |
unsigned idx, v; |
|
349 |
OBJ clr; |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
350 |
|
7500 | 351 |
if (shift < 0) { |
352 |
byte = *srcPtr++; |
|
353 |
shift = 6; |
|
354 |
} |
|
355 |
idx = (byte >> shift) & 3; |
|
356 |
shift -= 2; |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
357 |
|
7500 | 358 |
clr = ap[idx]; |
359 |
v = __intVal(clr); |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
360 |
|
7500 | 361 |
dstPtr[0] = v; |
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
362 |
|
7500 | 363 |
dstPtr += 1; |
364 |
nPix--; |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
365 |
|
7500 | 366 |
if (++r == w) { |
367 |
dstPtr += p; |
|
368 |
r = 0; |
|
369 |
shift = -2; |
|
370 |
} |
|
371 |
} |
|
372 |
} |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
373 |
%}. |
7500 | 374 |
] ifFalse:[ |
375 |
usedDeviceBitsPerPixel == 24 ifTrue:[ |
|
376 |
"/ 24 bits/pixel |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
377 |
|
7500 | 378 |
"/ now, walk over the image and replace |
379 |
"/ colorMap indices by color values in the bits array |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
380 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
381 |
%{ |
7500 | 382 |
unsigned char *srcPtr = 0; |
383 |
unsigned char *dstPtr = 0; |
|
384 |
OBJ _bytes = __INST(bytes); |
|
3851
34637f468b2a
also handle subclasses of ExternalBytes (Mapped..)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
385 |
|
7500 | 386 |
if (__isByteArrayLike(_bytes)) { |
387 |
srcPtr = __ByteArrayInstPtr(_bytes)->ba_element; |
|
388 |
} else { |
|
389 |
if (__isExternalBytesLike(_bytes)) { |
|
390 |
srcPtr = __externalBytesAddress(_bytes); |
|
391 |
} |
|
392 |
} |
|
393 |
if (__isByteArray(imageBits)) { |
|
394 |
dstPtr = __ByteArrayInstPtr(imageBits)->ba_element; |
|
395 |
} else { |
|
396 |
if (__isExternalBytesLike(imageBits)) { |
|
397 |
dstPtr = __externalBytesAddress(imageBits); |
|
398 |
} |
|
399 |
} |
|
3851
34637f468b2a
also handle subclasses of ExternalBytes (Mapped..)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
400 |
|
7500 | 401 |
if (__bothSmallInteger(__INST(height), __INST(width)) |
402 |
&& __isArrayLike(colorValues) |
|
403 |
&& srcPtr |
|
404 |
&& dstPtr) { |
|
405 |
int x, y, w, h, nPix; |
|
406 |
int r, p, byte, shift; |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
407 |
|
7500 | 408 |
OBJ *ap = __ArrayInstPtr(colorValues)->a_element; |
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
409 |
|
7500 | 410 |
w = __intVal(__INST(width)); |
411 |
h = __intVal(__INST(height)); |
|
412 |
r = 0; |
|
413 |
p = __intVal(padd); |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
414 |
|
7500 | 415 |
nPix = w * h; |
416 |
shift = -2; |
|
417 |
while (nPix > 0) { |
|
418 |
unsigned idx, v; |
|
419 |
OBJ clr; |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
420 |
|
7500 | 421 |
if (shift < 0) { |
422 |
byte = *srcPtr++; |
|
423 |
shift = 6; |
|
424 |
} |
|
425 |
idx = (byte >> shift) & 3; |
|
426 |
shift -= 2; |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
427 |
|
7500 | 428 |
clr = ap[idx]; |
429 |
v = __intVal(clr); |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
430 |
|
7500 | 431 |
dstPtr[0] = (v>>16) & 0xFF; |
432 |
dstPtr[1] = (v>>8) & 0xFF; |
|
433 |
dstPtr[2] = (v) & 0xFF; |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
434 |
|
7500 | 435 |
dstPtr += 3; |
436 |
nPix--; |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
437 |
|
7500 | 438 |
if (++r == w) { |
439 |
dstPtr += p; |
|
440 |
r = 0; |
|
441 |
shift = -2; |
|
442 |
} |
|
443 |
} |
|
444 |
} |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
445 |
%}. |
7500 | 446 |
] ifFalse:[ |
447 |
'Image [warning]: unimplemented trueColor depth in anyImageAsTrueColorFormOn: ' errorPrint. usedDeviceBitsPerPixel errorPrintCR. |
|
448 |
^ nil |
|
449 |
] |
|
450 |
] |
|
451 |
] |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
452 |
]. |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
453 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
454 |
imageBits isNil ifTrue:[ |
7500 | 455 |
^ nil |
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
456 |
]. |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
457 |
|
7500 | 458 |
form := Form imageForm width:width height:height depth:usedDeviceDepth onDevice:aDevice. |
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
459 |
form isNil ifTrue:[^ nil]. |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
460 |
form initGC. |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
461 |
|
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
462 |
form |
7500 | 463 |
copyBitsFrom:imageBits |
464 |
bitsPerPixel:usedDeviceBitsPerPixel |
|
465 |
depth:usedDeviceDepth |
|
466 |
padding:usedDevicePadding |
|
467 |
width:width height:height |
|
468 |
x:0 y:0 |
|
469 |
toX:0 y:0. |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
470 |
|
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
471 |
^ form |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
472 |
|
4765 | 473 |
"Created: / 20-10-1995 / 22:05:10 / cg" |
474 |
"Modified: / 29-05-2007 / 19:22:29 / cg" |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
475 |
! |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
476 |
|
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
477 |
greyImageAsTrueColorFormOn:aDevice |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
478 |
"return a true-color device-form for the grey-image receiver. |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
479 |
Supports true color devices with depths: 8, 16, 24 and 32" |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
480 |
|
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
481 |
|f| |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
482 |
|
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
483 |
f := self anyImageAsTrueColorFormOn:aDevice. |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
484 |
f notNil ifTrue:[^ f]. |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
485 |
^ super greyImageAsTrueColorFormOn:aDevice |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
486 |
|
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
487 |
"Created: / 28.7.1998 / 16:57:32 / cg" |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
488 |
! |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
489 |
|
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
490 |
paletteImageAsTrueColorFormOn:aDevice |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
491 |
"return a true-color device-form for the palette-image receiver. |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
492 |
Supports true color devices with depths: 8, 16, 24 and 32" |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
493 |
|
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
494 |
|f| |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
495 |
|
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
496 |
f := self anyImageAsTrueColorFormOn:aDevice. |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
497 |
f notNil ifTrue:[^ f]. |
8140 | 498 |
|
2200
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
499 |
^ super paletteImageAsTrueColorFormOn:aDevice |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
500 |
|
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
501 |
"Created: / 28.7.1998 / 16:57:47 / cg" |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
502 |
! |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
503 |
|
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
504 |
rgbImageAsTrueColorFormOn:aDevice |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
505 |
"return a true-color device-form for the rgb-image receiver. |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
506 |
Supports true color devices with depths: 8, 16, 24 and 32" |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
507 |
|
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
508 |
|f| |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
509 |
|
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
510 |
f := self anyImageAsTrueColorFormOn:aDevice. |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
511 |
f notNil ifTrue:[^ f]. |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
512 |
^ super rgbImageAsTrueColorFormOn:aDevice |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
513 |
|
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
514 |
"Created: / 28.7.1998 / 16:58:01 / cg" |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
515 |
! ! |
4e3c5b30b2c1
tuned conversion to true-color.
Claus Gittinger <cg@exept.de>
parents:
2178
diff
changeset
|
516 |
|
810 | 517 |
!Depth2Image methodsFor:'dither helpers'! |
798 | 518 |
|
519 |
orderedDitheredMonochromeBitsWithDitherMatrix:ditherMatrix ditherWidth:dW |
|
520 |
"return the dithered monochrome bits for the receiver image; |
|
521 |
with a constant ditherMatrix, this can be used for thresholding. |
|
522 |
Redefined to make use of knowing that pixels are 2-bit values." |
|
523 |
||
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
524 |
|dH nDither bytes |
798 | 525 |
greyMap monoBits |
526 |
bytesPerMonoRow "{Class: SmallInteger }" |
|
527 |
bytesPerRow "{Class: SmallInteger }" |
|
528 |
w "{Class: SmallInteger }" |
|
529 |
h "{Class: SmallInteger }"| |
|
530 |
||
531 |
nDither := ditherMatrix size. |
|
532 |
dH := nDither / dW. |
|
533 |
||
534 |
w := width. |
|
535 |
h := height. |
|
3866
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3851
diff
changeset
|
536 |
bytes := self bits. |
798 | 537 |
|
538 |
bytesPerRow := self bytesPerRow. |
|
539 |
||
540 |
bytesPerMonoRow := w + 7 // 8. |
|
541 |
monoBits := ByteArray uninitializedNew:(bytesPerMonoRow * h). |
|
542 |
(monoBits isNil or:[bytes isNil]) ifTrue:[ |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
543 |
^ nil |
798 | 544 |
]. |
545 |
||
803
899f7eb32ef2
support #rgb - specialized code relaxed
Claus Gittinger <cg@exept.de>
parents:
798
diff
changeset
|
546 |
greyMap := self greyByteMapForRange:nDither. |
798 | 547 |
|
548 |
%{ |
|
549 |
int __dW = __intVal(dW); |
|
550 |
int __dH = __intVal(dH); |
|
551 |
int __byte; |
|
552 |
int __dT; |
|
553 |
int __dstIdx = 0; |
|
554 |
int __srcIdx = 0; |
|
555 |
int __bitCnt; |
|
556 |
int __inByte; |
|
557 |
int __grey; |
|
558 |
int __w = __intVal(w); |
|
559 |
int __h = __intVal(h); |
|
560 |
int __x; |
|
561 |
int __y; |
|
562 |
int __oX, __oY, __dY; |
|
563 |
int __nextDst; |
|
564 |
int __nextSrc; |
|
565 |
int __bytesPerRow = __intVal(bytesPerRow); |
|
566 |
int __bytesPerMonoRow = __intVal(bytesPerMonoRow); |
|
567 |
||
1812
beeaf75b245b
avoid type warnings (char * vs. unsigned char *)
Claus Gittinger <cg@exept.de>
parents:
1656
diff
changeset
|
568 |
unsigned char *__monoBits = __ByteArrayInstPtr(monoBits)->ba_element; |
808 | 569 |
unsigned char *__ditherMatrix = __ByteArrayInstPtr(ditherMatrix)->ba_element; |
3866
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3851
diff
changeset
|
570 |
unsigned char *__bytes = __ByteArrayInstPtr(bytes)->ba_element; |
798 | 571 |
unsigned char *__greyMap = __ByteArrayInstPtr(greyMap)->ba_element; |
572 |
||
573 |
__oY = __dY = 0; |
|
574 |
for (__y=0; __y<__h; __y++) { |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
575 |
__nextDst = __dstIdx + __bytesPerMonoRow; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
576 |
__nextSrc = __srcIdx + __bytesPerRow; |
798 | 577 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
578 |
__byte = 0; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
579 |
__bitCnt = 8; |
798 | 580 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
581 |
__oX = 0; |
798 | 582 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
583 |
for (__x=0; __x<__w; __x++) { |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
584 |
if ((__x & 3) == 0) { |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
585 |
__inByte = __bytes[__srcIdx]; /* 0..255 */ |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
586 |
__srcIdx++; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
587 |
} else { |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
588 |
__inByte = __inByte << 2; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
589 |
} |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
590 |
__grey = (__inByte >> 6) & 3; |
798 | 591 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
592 |
__grey = __greyMap[__grey]; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
593 |
__dT = __ditherMatrix[__dY + __oX]; |
798 | 594 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
595 |
__oX++; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
596 |
if (__oX == __dW) __oX = 0; |
798 | 597 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
598 |
__byte = __byte << 1; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
599 |
if (__grey > __dT) { |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
600 |
__byte = __byte | 1; /* white */ |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
601 |
} |
798 | 602 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
603 |
__bitCnt--; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
604 |
if (__bitCnt == 0) { |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
605 |
__monoBits[__dstIdx] = __byte; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
606 |
__dstIdx++; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
607 |
__byte = 0; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
608 |
__bitCnt = 8; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
609 |
} |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
610 |
} |
798 | 611 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
612 |
if (__bitCnt != 8) { |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
613 |
__byte = __byte << __bitCnt; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
614 |
__monoBits[__dstIdx] = __byte; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
615 |
} |
798 | 616 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
617 |
__oY++; __dY += __dW; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
618 |
if (__oY == __dH) { |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
619 |
__oY = 0; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
620 |
__dY = 0; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
621 |
} |
798 | 622 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
623 |
__srcIdx = __nextSrc; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
624 |
__dstIdx = __nextDst; |
798 | 625 |
} |
626 |
%}. |
|
627 |
||
628 |
^ monoBits |
|
629 |
! ! |
|
630 |
||
280 | 631 |
!Depth2Image methodsFor:'enumerating'! |
632 |
||
798 | 633 |
colorsAtY:y from:xLow to:xHigh do:aBlock |
280 | 634 |
"perform aBlock for each pixel from x1 to x2 in row y. |
635 |
The block is passed the color at each pixel. |
|
636 |
This method allows slighly faster processing of an |
|
637 |
image than using atX:y:, since some processing can be |
|
638 |
avoided when going from pixel to pixel. However, for |
|
639 |
real image processing, specialized methods should be written." |
|
640 |
||
641 |
|srcIndex "{ Class: SmallInteger }" |
|
642 |
byte "{ Class: SmallInteger }" |
|
643 |
shift "{ Class: SmallInteger }" |
|
644 |
value "{ Class: SmallInteger }" |
|
645 |
x1 "{ Class: SmallInteger }" |
|
646 |
x2 "{ Class: SmallInteger }" |
|
3866
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3851
diff
changeset
|
647 |
color0 color1 color2 color3 bytes| |
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3851
diff
changeset
|
648 |
|
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3851
diff
changeset
|
649 |
bytes := self bits. |
280 | 650 |
|
2226 | 651 |
color0 := self colorFromValue:0. |
652 |
color1 := self colorFromValue:1. |
|
653 |
color2 := self colorFromValue:2. |
|
654 |
color3 := self colorFromValue:3. |
|
280 | 655 |
|
656 |
"left pixel in high bits" |
|
657 |
||
658 |
x1 := xLow. |
|
659 |
x2 := xHigh. |
|
660 |
||
661 |
srcIndex := (self bytesPerRow * y) + 1. |
|
662 |
srcIndex := srcIndex + (x1 // 4). |
|
663 |
shift := #(-6 -4 -2 0) at:((x1 \\ 4) + 1). |
|
664 |
||
798 | 665 |
byte := bytes at:srcIndex. |
280 | 666 |
x1 to:x2 do:[:x | |
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
667 |
|clr| |
2226 | 668 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
669 |
value := (byte bitShift:shift) bitAnd:3. |
280 | 670 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
671 |
(value == 0) ifTrue:[ |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
672 |
clr := color0 |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
673 |
] ifFalse:[ |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
674 |
(value == 1) ifTrue:[ |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
675 |
clr := color1 |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
676 |
] ifFalse:[ |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
677 |
(value == 2) ifTrue:[ |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
678 |
clr := color2 |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
679 |
] ifFalse:[ |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
680 |
clr := color3 |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
681 |
] |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
682 |
] |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
683 |
]. |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
684 |
aBlock value:x value:clr. |
280 | 685 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
686 |
shift == 0 ifTrue:[ |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
687 |
shift := -6. |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
688 |
srcIndex := srcIndex + 1. |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
689 |
x < x2 ifTrue:[ |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
690 |
byte := bytes at:srcIndex. |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
691 |
] |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
692 |
] ifFalse:[ |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
693 |
shift := shift + 2. |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
694 |
] |
280 | 695 |
]. |
746 | 696 |
|
798 | 697 |
"Created: 7.6.1996 / 19:12:31 / cg" |
810 | 698 |
"Modified: 10.6.1996 / 10:32:47 / cg" |
280 | 699 |
! |
700 |
||
798 | 701 |
valuesAtY:y from:xLow to:xHigh do:aBlock |
8118 | 702 |
"WARNING: this enumerates pixel values which need photometric interpretation |
703 |
Do not confuse with #rgbValuesAtY:from:to:do: |
|
704 |
||
705 |
Perform aBlock for each pixelValue from x1 to x2 in row y. |
|
706 |
||
707 |
Notice the difference between rgbValue and pixelValue: rgbValues are always |
|
708 |
the rgb bytes; pixelvalues depend on the photometric interpretation, and may be |
|
709 |
indices into a colormap or be non-byte-sized rgb values. |
|
710 |
||
280 | 711 |
The block is passed the x coordinate and the pixelValue at each pixel. |
712 |
This method allows slighly faster processing of an |
|
713 |
image than using valueAtX:y:, since some processing can be |
|
714 |
avoided when going from pixel to pixel. However, for |
|
715 |
real image processing, specialized methods should be written." |
|
716 |
||
717 |
|srcIndex "{ Class: SmallInteger }" |
|
718 |
byte "{ Class: SmallInteger }" |
|
719 |
shift "{ Class: SmallInteger }" |
|
720 |
value "{ Class: SmallInteger }" |
|
721 |
x1 "{ Class: SmallInteger }" |
|
3866
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3851
diff
changeset
|
722 |
x2 "{ Class: SmallInteger }" |
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3851
diff
changeset
|
723 |
bytes| |
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3851
diff
changeset
|
724 |
|
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3851
diff
changeset
|
725 |
bytes := self bits. |
280 | 726 |
|
727 |
"left pixel in high bits" |
|
728 |
||
729 |
x1 := xLow. |
|
730 |
x2 := xHigh. |
|
731 |
||
732 |
srcIndex := (self bytesPerRow * y) + 1. |
|
733 |
srcIndex := srcIndex + (x1 // 4). |
|
734 |
shift := #(-6 -4 -2 0) at:((x1 \\ 4) + 1). |
|
735 |
||
798 | 736 |
byte := bytes at:srcIndex. |
280 | 737 |
x1 to:x2 do:[:x | |
8118 | 738 |
value := (byte bitShift:shift) bitAnd:3. |
280 | 739 |
|
8118 | 740 |
aBlock value:x value:value. |
280 | 741 |
|
8118 | 742 |
shift == 0 ifTrue:[ |
743 |
shift := -6. |
|
744 |
srcIndex := srcIndex + 1. |
|
745 |
x < x2 ifTrue:[ |
|
746 |
byte := bytes at:srcIndex. |
|
747 |
] |
|
748 |
] ifFalse:[ |
|
749 |
shift := shift + 2. |
|
750 |
] |
|
280 | 751 |
]. |
798 | 752 |
|
8118 | 753 |
"Created: / 07-06-1996 / 19:09:42 / cg" |
754 |
"Modified: / 08-06-1996 / 13:36:28 / cg" |
|
755 |
"Modified (comment): / 29-08-2017 / 14:53:09 / cg" |
|
280 | 756 |
! ! |
757 |
||
1 | 758 |
!Depth2Image methodsFor:'magnification'! |
759 |
||
760 |
magnifyRowFrom:srcBytes offset:srcStart |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
761 |
into:dstBytes offset:dstStart factor:mX |
1 | 762 |
|
763 |
"magnify a single pixel row - can only magnify by integer factors" |
|
764 |
||
765 |
%{ |
|
766 |
unsigned char *srcP, *dstP; |
|
767 |
int _mag; |
|
768 |
REGISTER int i; |
|
769 |
REGISTER unsigned char _byte; |
|
770 |
int _pixels; |
|
771 |
REGISTER int outcnt, bits, bit, mask, incnt; |
|
772 |
int shift; |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
773 |
OBJ w = __INST(width); |
1 | 774 |
|
2178 | 775 |
/* helper for two-plane magnification by 2 |
776 |
* 0000 -> 0000 0000 |
|
777 |
* 0001 -> 0000 0101 |
|
778 |
* ... |
|
779 |
* 1111 -> 1111 1111 |
|
780 |
*/ |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
781 |
static unsigned char mag2[16] = {0x00, 0x05, 0x0a, 0x0f, 0x50, 0x55, 0x5a, 0x5f, |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
782 |
0xa0, 0xa5, 0xaa, 0xaf, 0xf0, 0xf5, 0xfa, 0xff}; |
2178 | 783 |
/* helper for two-plane magnification by 4 */ |
784 |
static unsigned char mag4[16] = {0x00, 0x55, 0xaa, 0xff}; |
|
1 | 785 |
|
97 | 786 |
if (__bothSmallInteger(srcStart, dstStart) |
787 |
&& __bothSmallInteger(w, mX) |
|
5478
4e83e3604f19
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4765
diff
changeset
|
788 |
&& __isByteArrayLike(srcBytes) && __isByteArray(dstBytes)) { |
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
789 |
_mag = __intVal(mX); |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
790 |
srcP = __ByteArrayInstPtr(srcBytes)->ba_element - 1 + __intVal(srcStart); |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
791 |
dstP = __ByteArrayInstPtr(dstBytes)->ba_element - 1 + __intVal(dstStart); |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
792 |
_pixels = __intVal(w); |
2178 | 793 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
794 |
switch (_mag) { |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
795 |
case 1: |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
796 |
break; |
1 | 797 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
798 |
case 2: |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
799 |
/* tuned for this common case */ |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
800 |
while (_pixels > 2) { |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
801 |
_byte = *srcP++; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
802 |
*dstP++ = mag2[ _byte >> 4 ]; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
803 |
*dstP++ = mag2[ _byte & 0x0F ]; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
804 |
_pixels -= 4; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
805 |
} |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
806 |
while (_pixels > 0) { |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
807 |
_byte = *srcP++; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
808 |
*dstP++ = mag2[ _byte >> 4 ]; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
809 |
if (_pixels > 2) { |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
810 |
*dstP++ = mag2[ _byte & 0x0F ]; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
811 |
} |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
812 |
_pixels -= 4; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
813 |
} |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
814 |
break; |
1 | 815 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
816 |
case3: |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
817 |
/* tuned for this common case */ |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
818 |
bits = 0, incnt = 0, outcnt = 0; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
819 |
shift = 6; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
820 |
_byte = *srcP++; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
821 |
while (_pixels--) { |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
822 |
bit = (_byte >> shift) & 3; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
823 |
incnt++; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
824 |
if (incnt == 4) { |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
825 |
incnt = 0; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
826 |
shift = 6; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
827 |
_byte = *srcP++; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
828 |
} else { |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
829 |
shift -= 2; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
830 |
} |
2178 | 831 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
832 |
switch (outcnt) { |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
833 |
case 0: |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
834 |
/* next three pixels */ |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
835 |
bits = (((bit << 2) | bit) << 2) | bit; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
836 |
outcnt = 3; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
837 |
break; |
2178 | 838 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
839 |
case 1: |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
840 |
/* next three pixels & store */ |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
841 |
bits = (((((bits << 2) | bit) << 2) | bit) << 2) | bit; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
842 |
*dstP++ = bits; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
843 |
outcnt = 0; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
844 |
break; |
2178 | 845 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
846 |
case 2: |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
847 |
/* next two pixels & store */ |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
848 |
bits = (((bits << 2) | bit) << 2) | bit; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
849 |
*dstP++ = bits; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
850 |
bits = bit; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
851 |
outcnt = 1; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
852 |
break; |
1 | 853 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
854 |
case 3: |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
855 |
/* next pixel & store */ |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
856 |
bits = (bits << 2) | bit; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
857 |
*dstP++ = bits; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
858 |
bits = (bit << 2) | bit; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
859 |
outcnt = 2; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
860 |
break; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
861 |
} |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
862 |
} |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
863 |
if (outcnt) { |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
864 |
*dstP = bits << ((4-outcnt)*2); |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
865 |
} |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
866 |
break; |
2178 | 867 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
868 |
case 4: |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
869 |
/* tuned for this common case */ |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
870 |
incnt = 0; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
871 |
shift = 6; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
872 |
_byte = *srcP++; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
873 |
while (_pixels--) { |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
874 |
bit = (_byte >> shift) & 3; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
875 |
incnt++; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
876 |
if (incnt == 4) { |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
877 |
incnt = 0; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
878 |
shift = 6; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
879 |
_byte = *srcP++; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
880 |
} else { |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
881 |
shift -= 2; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
882 |
} |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
883 |
*dstP++ = mag4[bit]; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
884 |
} |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
885 |
break; |
1 | 886 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
887 |
default: |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
888 |
bits = 0, incnt = 0, outcnt = 0; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
889 |
shift = 6; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
890 |
_byte = *srcP++; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
891 |
while (_pixels--) { |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
892 |
bit = (_byte >> shift) & 3; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
893 |
incnt++; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
894 |
if (incnt == 4) { |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
895 |
incnt = 0; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
896 |
shift = 6; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
897 |
_byte = *srcP++; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
898 |
} else { |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
899 |
shift -= 2; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
900 |
} |
1 | 901 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
902 |
for (i=_mag; i>0; i--) { |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
903 |
bits = (bits << 2) | bit; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
904 |
outcnt++; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
905 |
if (outcnt == 4) { |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
906 |
*dstP++ = bits; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
907 |
bits = 0; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
908 |
outcnt = 0; |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
909 |
} |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
910 |
} |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
911 |
} |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
912 |
if (outcnt) { |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
913 |
*dstP = bits << ((4-outcnt)*2); |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
914 |
} |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
915 |
break; |
2178 | 916 |
|
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
917 |
} |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
918 |
RETURN (self); |
1 | 919 |
} |
3842 | 920 |
%}. |
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
921 |
super |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
922 |
magnifyRowFrom:srcBytes offset:srcStart |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
923 |
into:dstBytes offset:dstStart factor:mX |
1 | 924 |
! ! |
280 | 925 |
|
926 |
!Depth2Image methodsFor:'queries'! |
|
927 |
||
928 |
bitsPerPixel |
|
929 |
"return the number of bits per pixel" |
|
930 |
||
931 |
^ 2 |
|
932 |
! |
|
933 |
||
934 |
bitsPerRow |
|
935 |
"return the number of bits in one scanline of the image" |
|
936 |
||
3868 | 937 |
^ width * 2 |
280 | 938 |
! |
939 |
||
940 |
bytesPerRow |
|
941 |
"return the number of bytes in one scanline of the image" |
|
942 |
||
943 |
|nbytes| |
|
944 |
||
945 |
nbytes := width // 4. |
|
946 |
((width \\ 4) ~~ 0) ifTrue:[ |
|
947 |
^ nbytes + 1 |
|
948 |
]. |
|
949 |
^ nbytes |
|
950 |
! |
|
951 |
||
3866
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3851
diff
changeset
|
952 |
colorFromValue:colorValue |
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3851
diff
changeset
|
953 |
"given a pixel value, return the corresponding color. |
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3851
diff
changeset
|
954 |
Pixel values start with 0." |
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3851
diff
changeset
|
955 |
|
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3851
diff
changeset
|
956 |
|p value| |
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3851
diff
changeset
|
957 |
|
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3851
diff
changeset
|
958 |
value := colorValue. |
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3851
diff
changeset
|
959 |
p := photometric. |
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3851
diff
changeset
|
960 |
|
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3851
diff
changeset
|
961 |
p == #whiteIs0 ifTrue:[ |
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
962 |
value := 3 - value. |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
963 |
p := #blackIs0 |
3866
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3851
diff
changeset
|
964 |
]. |
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3851
diff
changeset
|
965 |
p == #blackIs0 ifTrue:[ |
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
966 |
(value == 0) ifTrue:[ |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
967 |
^ Color black |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
968 |
]. |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
969 |
(value == 3) ifTrue:[ |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
970 |
^ Color white |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
971 |
]. |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
972 |
^ Color gray:(value == 1 ifTrue:33 ifFalse:67) |
3866
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3851
diff
changeset
|
973 |
]. |
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3851
diff
changeset
|
974 |
|
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3851
diff
changeset
|
975 |
p == #palette ifTrue:[ |
6066
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
976 |
value < colorMap size ifTrue:[ |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
977 |
^ colorMap at:(value+1). |
62426e8110ae
stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents:
5478
diff
changeset
|
978 |
]. |
3866
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3851
diff
changeset
|
979 |
]. |
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3851
diff
changeset
|
980 |
^ super colorFromValue:colorValue. |
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3851
diff
changeset
|
981 |
! |
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3851
diff
changeset
|
982 |
|
280 | 983 |
usedColors |
984 |
"return a collection of colors used in the receiver. |
|
2201 | 985 |
For depth2 images, we return the colorMap here, assuming all |
986 |
pixels are used ... |
|
7641 | 987 |
... which is not really true - not all colors need to be" |
280 | 988 |
|
3867 | 989 |
(photometric == #whiteIs0 or:[photometric == #blackIs0]) ifTrue:[ |
7641 | 990 |
^ Array with:(Color black) |
991 |
with:(Color gray:33) |
|
992 |
with:(Color gray:67) |
|
993 |
with:(Color white). |
|
280 | 994 |
]. |
3867 | 995 |
photometric == #palette ifTrue:[ |
7641 | 996 |
^ colorMap |
3867 | 997 |
]. |
998 |
^ super usedColors |
|
746 | 999 |
|
2278 | 1000 |
"Modified: / 24.8.1998 / 18:38:08 / cg" |
280 | 1001 |
! |
1002 |
||
1003 |
usedValues |
|
2201 | 1004 |
"return a collection of color values used in the receiver. |
3274 | 1005 |
For depth2 images, we assume all pixel values are present ... |
2201 | 1006 |
... which is not really true" |
280 | 1007 |
|
1008 |
"actually, this is wrong - we have to look if those are |
|
7652 | 1009 |
really used. However, assume that we don't care for |
280 | 1010 |
those extra colors here ..." |
1011 |
||
7818 | 1012 |
^ #[0 1 2 3] |
2201 | 1013 |
|
7818 | 1014 |
"Modified: / 28-07-1998 / 22:23:15 / cg" |
1015 |
"Modified: / 30-01-2017 / 19:23:07 / stefan" |
|
280 | 1016 |
! ! |
1017 |
||
1018 |
!Depth2Image class methodsFor:'documentation'! |
|
1019 |
||
1020 |
version |
|
7500 | 1021 |
^ '$Header$' |
5478
4e83e3604f19
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4765
diff
changeset
|
1022 |
! |
4e83e3604f19
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4765
diff
changeset
|
1023 |
|
4e83e3604f19
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4765
diff
changeset
|
1024 |
version_CVS |
7500 | 1025 |
^ '$Header$' |
280 | 1026 |
! ! |
6300 | 1027 |