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