author | Claus Gittinger <cg@exept.de> |
Tue, 29 Apr 2003 20:45:23 +0200 | |
changeset 3866 | c01473a90934 |
parent 3263 | bd92a12c9316 |
child 4761 | 9672fbf6ad20 |
permissions | -rw-r--r-- |
1663 | 1 |
" |
2 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
3 |
All Rights Reserved |
|
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 |
" |
|
12 |
||
3263 | 13 |
"{ Package: 'stx:libview' }" |
14 |
||
1663 | 15 |
Image subclass:#Depth32Image |
16 |
instanceVariableNames:'' |
|
17 |
classVariableNames:'' |
|
18 |
poolDictionaries:'' |
|
19 |
category:'Graphics-Images' |
|
20 |
! |
|
21 |
||
22 |
!Depth32Image class methodsFor:'documentation'! |
|
23 |
||
24 |
copyright |
|
25 |
" |
|
26 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
27 |
All Rights Reserved |
|
28 |
||
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
37 |
||
38 |
documentation |
|
39 |
" |
|
40 |
this class represents 32 bit images. |
|
41 |
Only the minimum protocol is implemented here; much more is |
|
42 |
needed for higher performance operations on depth32 images. |
|
43 |
(however, 32bit images are very seldom used, so falling back into the |
|
44 |
slow general methods from Image should not hurt too much ..) |
|
45 |
||
46 |
[author:] |
|
47 |
Claus Gittinger |
|
48 |
||
49 |
[see also:] |
|
50 |
Depth1Image Depth2Image Depth4Image Depth8Image Depth16Image Depth24Image |
|
51 |
ImageReader |
|
52 |
" |
|
53 |
! ! |
|
54 |
||
55 |
!Depth32Image class methodsFor:'queries'! |
|
56 |
||
57 |
imageDepth |
|
58 |
"return the depth of images represented by instances of |
|
59 |
this class - here we return 32" |
|
60 |
||
61 |
^ 32 |
|
62 |
||
63 |
"Modified: 20.4.1996 / 23:40:01 / cg" |
|
64 |
"Created: 24.4.1997 / 19:00:28 / cg" |
|
65 |
! ! |
|
66 |
||
3263 | 67 |
!Depth32Image methodsFor:'accessing-pixels'! |
1663 | 68 |
|
69 |
pixelAtX:x y:y |
|
70 |
"retrieve a pixel at x/y; return a pixelValue. |
|
71 |
Pixels start at x=0 , y=0 for upper left pixel, end at |
|
72 |
x = width-1, y=height-1 for lower right pixel" |
|
73 |
||
1669 | 74 |
|pixelIndex "{ Class: SmallInteger }"| |
1663 | 75 |
|
1669 | 76 |
pixelIndex := (width * 4 * y) + 1 + (x * 4). |
1663 | 77 |
|
78 |
"left pixel in high bits" |
|
1669 | 79 |
^ bytes doubleWordAt:pixelIndex MSB:true. |
1663 | 80 |
|
81 |
"Created: 24.4.1997 / 19:00:28 / cg" |
|
1669 | 82 |
"Modified: 24.4.1997 / 23:11:05 / cg" |
1663 | 83 |
! |
84 |
||
85 |
pixelAtX:x y:y put:aPixelValue |
|
86 |
"set the pixel at x/y to aPixelValue. |
|
87 |
Pixels start at x=0 , y=0 for upper left pixel, end at |
|
88 |
x = width-1, y=height-1 for lower right pixel" |
|
89 |
||
1669 | 90 |
|pixelIndex "{ Class: SmallInteger }"| |
1663 | 91 |
|
1669 | 92 |
pixelIndex := (width * 4 * y) + 1 + (x * 4). |
93 |
bytes doubleWordAt:pixelIndex put:aPixelValue MSB:true |
|
1663 | 94 |
|
95 |
"Created: 24.4.1997 / 19:00:28 / cg" |
|
1669 | 96 |
"Modified: 24.4.1997 / 23:10:51 / cg" |
1663 | 97 |
! ! |
98 |
||
99 |
!Depth32Image methodsFor:'queries'! |
|
100 |
||
101 |
bitsPerPixel |
|
102 |
"return the number of bits per pixel" |
|
103 |
||
104 |
^ 32 |
|
105 |
||
106 |
"Created: 24.4.1997 / 19:00:28 / cg" |
|
107 |
! |
|
108 |
||
109 |
bitsPerRow |
|
110 |
"return the number of bits in one scanline of the image" |
|
111 |
||
3866
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3263
diff
changeset
|
112 |
^ width * 32 |
1663 | 113 |
|
114 |
"Created: 24.4.1997 / 19:00:28 / cg" |
|
115 |
! |
|
116 |
||
117 |
bytesPerRow |
|
118 |
"return the number of bytes in one scanline of the image" |
|
119 |
||
120 |
^ width * 4. |
|
121 |
||
122 |
"Created: 24.4.1997 / 19:00:28 / cg" |
|
123 |
! ! |
|
124 |
||
125 |
!Depth32Image class methodsFor:'documentation'! |
|
126 |
||
127 |
version |
|
3866
c01473a90934
eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents:
3263
diff
changeset
|
128 |
^ '$Header: /cvs/stx/stx/libview/Depth32Image.st,v 1.4 2003-04-29 18:45:10 cg Exp $' |
1663 | 129 |
! ! |