Depth16Image.st
author Claus Gittinger <cg@exept.de>
Tue, 15 Mar 2016 22:44:33 +0100
changeset 7209 c4cb8c02e820
parent 7190 18fc47cc1ce6
child 7520 c89730e74836
permissions -rw-r--r--
call the renamed basic methods for short access: #signedInt16At:MSB: #signedInt16At:put:MSB: #unsignedInt16At:MSB: #unsignedInt16At:put:MSB:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7209
c4cb8c02e820 call the renamed basic methods for short access:
Claus Gittinger <cg@exept.de>
parents: 7190
diff changeset
     1
"{ Encoding: utf8 }"
c4cb8c02e820 call the renamed basic methods for short access:
Claus Gittinger <cg@exept.de>
parents: 7190
diff changeset
     2
193
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
"
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
 COPYRIGHT (c) 1995 by Claus Gittinger
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
	      All Rights Reserved
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 This software is furnished under a license and may be used
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 only in accordance with the terms of that license and with the
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 be provided or otherwise made available to, or used by, any
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
 other person.  No title to or ownership of the software is
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
 hereby transferred.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
"
3263
bd92a12c9316 category changes
Claus Gittinger <cg@exept.de>
parents: 2180
diff changeset
    14
"{ Package: 'stx:libview' }"
bd92a12c9316 category changes
Claus Gittinger <cg@exept.de>
parents: 2180
diff changeset
    15
7190
Claus Gittinger <cg@exept.de>
parents: 6306
diff changeset
    16
"{ NameSpace: Smalltalk }"
Claus Gittinger <cg@exept.de>
parents: 6306
diff changeset
    17
193
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
Image subclass:#Depth16Image
579
e381761190c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 281
diff changeset
    19
	instanceVariableNames:''
e381761190c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 281
diff changeset
    20
	classVariableNames:''
e381761190c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 281
diff changeset
    21
	poolDictionaries:''
e381761190c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 281
diff changeset
    22
	category:'Graphics-Images'
193
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
!Depth16Image class methodsFor:'documentation'!
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
copyright
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
"
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 COPYRIGHT (c) 1995 by Claus Gittinger
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
	      All Rights Reserved
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 This software is furnished under a license and may be used
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 only in accordance with the terms of that license and with the
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 be provided or otherwise made available to, or used by, any
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
 other person.  No title to or ownership of the software is
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
 hereby transferred.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
"
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
!
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
documentation
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
"
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    this class represents 16 bit images.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    Only the minimum protocol is implemented here; much more is
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
    needed for higher performance operations on depth16 images.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    (however, 16bit images are seldom used, so falling back into the
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    slow general methods from Image should not hurt too much ..)
611
e0442439a3c6 documentation
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
    48
e0442439a3c6 documentation
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
    49
    [author:]
6066
62426e8110ae stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents: 5477
diff changeset
    50
	Claus Gittinger
611
e0442439a3c6 documentation
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
    51
e0442439a3c6 documentation
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
    52
    [see also:]
6066
62426e8110ae stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents: 5477
diff changeset
    53
	Depth1Image Depth2Image Depth4Image Depth8Image Depth24Image
62426e8110ae stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents: 5477
diff changeset
    54
	ImageReader
193
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
"
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
! !
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
!Depth16Image class methodsFor:'queries'!
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
4759
55e8bc994d61 defaultPhotometric
Claus Gittinger <cg@exept.de>
parents: 3872
diff changeset
    60
defaultPhotometric
55e8bc994d61 defaultPhotometric
Claus Gittinger <cg@exept.de>
parents: 3872
diff changeset
    61
    "return the default photometric pixel interpretation"
55e8bc994d61 defaultPhotometric
Claus Gittinger <cg@exept.de>
parents: 3872
diff changeset
    62
55e8bc994d61 defaultPhotometric
Claus Gittinger <cg@exept.de>
parents: 3872
diff changeset
    63
    ^ #rgb
55e8bc994d61 defaultPhotometric
Claus Gittinger <cg@exept.de>
parents: 3872
diff changeset
    64
55e8bc994d61 defaultPhotometric
Claus Gittinger <cg@exept.de>
parents: 3872
diff changeset
    65
    "Created: / 27-05-2007 / 14:04:11 / cg"
55e8bc994d61 defaultPhotometric
Claus Gittinger <cg@exept.de>
parents: 3872
diff changeset
    66
!
55e8bc994d61 defaultPhotometric
Claus Gittinger <cg@exept.de>
parents: 3872
diff changeset
    67
193
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
imageDepth
579
e381761190c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 281
diff changeset
    69
    "return the depth of images represented by instances of
e381761190c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 281
diff changeset
    70
     this class - here we return 16"
e381761190c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 281
diff changeset
    71
193
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
    ^ 16
579
e381761190c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 281
diff changeset
    73
e381761190c4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 281
diff changeset
    74
    "Modified: 20.4.1996 / 23:40:01 / cg"
193
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
! !
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
3263
bd92a12c9316 category changes
Claus Gittinger <cg@exept.de>
parents: 2180
diff changeset
    77
!Depth16Image methodsFor:'accessing-pixels'!
281
4f04a56b1641 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    78
1659
a38cf5be1aa8 pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents: 813
diff changeset
    79
pixelAtX:x y:y
281
4f04a56b1641 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    80
    "retrieve a pixel at x/y; return a pixelValue.
4f04a56b1641 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    81
     Pixels start at x=0 , y=0 for upper left pixel, end at
4f04a56b1641 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    82
     x = width-1, y=height-1 for lower right pixel"
4f04a56b1641 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    83
4f04a56b1641 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    84
    |lineIndex "{ Class: SmallInteger }"|
4f04a56b1641 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    85
6306
a3bbe514829e class: Depth16Image
Claus Gittinger <cg@exept.de>
parents: 6066
diff changeset
    86
    pixelFunction notNil ifTrue:[^ pixelFunction value:x value:y].
a3bbe514829e class: Depth16Image
Claus Gittinger <cg@exept.de>
parents: 6066
diff changeset
    87
281
4f04a56b1641 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    88
    lineIndex := (width * 2 * y) + 1.
4f04a56b1641 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    89
7209
c4cb8c02e820 call the renamed basic methods for short access:
Claus Gittinger <cg@exept.de>
parents: 7190
diff changeset
    90
    ^ bytes unsignedInt16At:(lineIndex + (x * 2)) MSB:true.
1659
a38cf5be1aa8 pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents: 813
diff changeset
    91
a38cf5be1aa8 pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents: 813
diff changeset
    92
    "Created: 24.4.1997 / 16:06:19 / cg"
a38cf5be1aa8 pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents: 813
diff changeset
    93
!
a38cf5be1aa8 pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents: 813
diff changeset
    94
a38cf5be1aa8 pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents: 813
diff changeset
    95
pixelAtX:x y:y put:aPixelValue
a38cf5be1aa8 pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents: 813
diff changeset
    96
    "set the pixel at x/y to aPixelValue.
a38cf5be1aa8 pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents: 813
diff changeset
    97
     Pixels start at x=0 , y=0 for upper left pixel, end at
a38cf5be1aa8 pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents: 813
diff changeset
    98
     x = width-1, y=height-1 for lower right pixel"
a38cf5be1aa8 pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents: 813
diff changeset
    99
a38cf5be1aa8 pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents: 813
diff changeset
   100
    |lineIndex "{ Class: SmallInteger }"|
a38cf5be1aa8 pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents: 813
diff changeset
   101
a38cf5be1aa8 pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents: 813
diff changeset
   102
    lineIndex := (width * 2 * y) + 1.
a38cf5be1aa8 pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents: 813
diff changeset
   103
7209
c4cb8c02e820 call the renamed basic methods for short access:
Claus Gittinger <cg@exept.de>
parents: 7190
diff changeset
   104
    bytes unsignedInt16At:(lineIndex + (x * 2)) put:aPixelValue MSB:true
1659
a38cf5be1aa8 pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents: 813
diff changeset
   105
a38cf5be1aa8 pixel accessing methods cleaned up
Claus Gittinger <cg@exept.de>
parents: 813
diff changeset
   106
    "Created: 24.4.1997 / 17:06:21 / cg"
2180
c6b09d67eb40 tuned rowAt:putAll
tz
parents: 1659
diff changeset
   107
!
c6b09d67eb40 tuned rowAt:putAll
tz
parents: 1659
diff changeset
   108
3872
390fabbc3036 comments and slight cleanup
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   109
rowAt:y putAll:pixelArray startingAt:startIndex
2180
c6b09d67eb40 tuned rowAt:putAll
tz
parents: 1659
diff changeset
   110
    "store a single rows bits from bits in the pixelArray argument;
c6b09d67eb40 tuned rowAt:putAll
tz
parents: 1659
diff changeset
   111
     Return the pixelArray.
3872
390fabbc3036 comments and slight cleanup
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   112
     Notice: row coordinate starts at 0."
2180
c6b09d67eb40 tuned rowAt:putAll
tz
parents: 1659
diff changeset
   113
c6b09d67eb40 tuned rowAt:putAll
tz
parents: 1659
diff changeset
   114
    |dstIdx "{ Class: SmallInteger }"
7190
Claus Gittinger <cg@exept.de>
parents: 6306
diff changeset
   115
     srcIdx "{ Class: SmallInteger }"
3866
c01473a90934 eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents: 3263
diff changeset
   116
     pixel
c01473a90934 eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents: 3263
diff changeset
   117
     bytes|
2180
c6b09d67eb40 tuned rowAt:putAll
tz
parents: 1659
diff changeset
   118
3866
c01473a90934 eliminated most references to bytes
Claus Gittinger <cg@exept.de>
parents: 3263
diff changeset
   119
    bytes := self bits.
3872
390fabbc3036 comments and slight cleanup
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
   120
    dstIdx := (width * 2 * y) + 1.
7190
Claus Gittinger <cg@exept.de>
parents: 6306
diff changeset
   121
    srcIdx := startIndex.
2180
c6b09d67eb40 tuned rowAt:putAll
tz
parents: 1659
diff changeset
   122
    1 to:width do:[:col |
7190
Claus Gittinger <cg@exept.de>
parents: 6306
diff changeset
   123
        pixel := pixelArray at:srcIdx.
Claus Gittinger <cg@exept.de>
parents: 6306
diff changeset
   124
        "/ msbFirst
Claus Gittinger <cg@exept.de>
parents: 6306
diff changeset
   125
        bytes at:dstIdx put:((pixel bitShift:-8) bitAnd:16rFF).
Claus Gittinger <cg@exept.de>
parents: 6306
diff changeset
   126
        bytes at:dstIdx+1 put:(pixel bitAnd:16rFF).
Claus Gittinger <cg@exept.de>
parents: 6306
diff changeset
   127
        dstIdx := dstIdx + 2.
Claus Gittinger <cg@exept.de>
parents: 6306
diff changeset
   128
        srcIdx := srcIdx + 1.
2180
c6b09d67eb40 tuned rowAt:putAll
tz
parents: 1659
diff changeset
   129
    ].
c6b09d67eb40 tuned rowAt:putAll
tz
parents: 1659
diff changeset
   130
    ^ pixelArray
c6b09d67eb40 tuned rowAt:putAll
tz
parents: 1659
diff changeset
   131
c6b09d67eb40 tuned rowAt:putAll
tz
parents: 1659
diff changeset
   132
    "Created: 24.4.1997 / 15:50:27 / cg"
281
4f04a56b1641 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   133
! !
4f04a56b1641 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   134
4759
55e8bc994d61 defaultPhotometric
Claus Gittinger <cg@exept.de>
parents: 3872
diff changeset
   135
!Depth16Image methodsFor:'initialization'!
55e8bc994d61 defaultPhotometric
Claus Gittinger <cg@exept.de>
parents: 3872
diff changeset
   136
55e8bc994d61 defaultPhotometric
Claus Gittinger <cg@exept.de>
parents: 3872
diff changeset
   137
initialize
55e8bc994d61 defaultPhotometric
Claus Gittinger <cg@exept.de>
parents: 3872
diff changeset
   138
    super initialize.
6066
62426e8110ae stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents: 5477
diff changeset
   139
    samplesPerPixel := 3.
4759
55e8bc994d61 defaultPhotometric
Claus Gittinger <cg@exept.de>
parents: 3872
diff changeset
   140
    bitsPerSample := #(5 5 5).
55e8bc994d61 defaultPhotometric
Claus Gittinger <cg@exept.de>
parents: 3872
diff changeset
   141
55e8bc994d61 defaultPhotometric
Claus Gittinger <cg@exept.de>
parents: 3872
diff changeset
   142
    "Created: / 27-05-2007 / 14:09:46 / cg"
55e8bc994d61 defaultPhotometric
Claus Gittinger <cg@exept.de>
parents: 3872
diff changeset
   143
! !
55e8bc994d61 defaultPhotometric
Claus Gittinger <cg@exept.de>
parents: 3872
diff changeset
   144
5128
6092105361d1 +magnifyRowFrom:offset:into:offset:factor:
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   145
!Depth16Image methodsFor:'magnification'!
6092105361d1 +magnifyRowFrom:offset:into:offset:factor:
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   146
6092105361d1 +magnifyRowFrom:offset:into:offset:factor:
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   147
magnifyRowFrom:srcBytes offset:srcStart
6066
62426e8110ae stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents: 5477
diff changeset
   148
	  into:dstBytes offset:dstStart factor:mX
5128
6092105361d1 +magnifyRowFrom:offset:into:offset:factor:
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   149
6092105361d1 +magnifyRowFrom:offset:into:offset:factor:
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   150
    "magnify a single pixel row - can only magnify by integer factors"
6092105361d1 +magnifyRowFrom:offset:into:offset:factor:
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   151
6092105361d1 +magnifyRowFrom:offset:into:offset:factor:
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   152
%{
6092105361d1 +magnifyRowFrom:offset:into:offset:factor:
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   153
    unsigned char *srcP, *dstP;
6092105361d1 +magnifyRowFrom:offset:into:offset:factor:
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   154
    int _mag;
6092105361d1 +magnifyRowFrom:offset:into:offset:factor:
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   155
    REGISTER int i;
6092105361d1 +magnifyRowFrom:offset:into:offset:factor:
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   156
    REGISTER unsigned char byte1, byte2;
6092105361d1 +magnifyRowFrom:offset:into:offset:factor:
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   157
    int _pixels;
6066
62426e8110ae stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents: 5477
diff changeset
   158
    OBJ w = __INST(width);
5128
6092105361d1 +magnifyRowFrom:offset:into:offset:factor:
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   159
6092105361d1 +magnifyRowFrom:offset:into:offset:factor:
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   160
    if (__bothSmallInteger(srcStart, dstStart)
6092105361d1 +magnifyRowFrom:offset:into:offset:factor:
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   161
     && __bothSmallInteger(w, mX)
5477
8badcb37a2c0 __isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents: 5128
diff changeset
   162
     && __isByteArrayLike(srcBytes) && __isByteArray(dstBytes)) {
6066
62426e8110ae stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents: 5477
diff changeset
   163
	_mag = __intVal(mX);
62426e8110ae stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents: 5477
diff changeset
   164
	srcP = __ByteArrayInstPtr(srcBytes)->ba_element - 1 + __intVal(srcStart);
62426e8110ae stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents: 5477
diff changeset
   165
	dstP = __ByteArrayInstPtr(dstBytes)->ba_element - 1 + __intVal(dstStart);
62426e8110ae stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents: 5477
diff changeset
   166
	_pixels = __intVal(w);
5128
6092105361d1 +magnifyRowFrom:offset:into:offset:factor:
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   167
6066
62426e8110ae stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents: 5477
diff changeset
   168
	while (_pixels--) {
62426e8110ae stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents: 5477
diff changeset
   169
	    byte1 = *srcP;
62426e8110ae stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents: 5477
diff changeset
   170
	    byte2 = *(srcP+1);
62426e8110ae stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents: 5477
diff changeset
   171
	    srcP += 2;
62426e8110ae stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents: 5477
diff changeset
   172
	    for (i=_mag; i>0; i--) {
62426e8110ae stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents: 5477
diff changeset
   173
		*dstP = byte1;
62426e8110ae stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents: 5477
diff changeset
   174
		*(dstP+1) = byte2;
62426e8110ae stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents: 5477
diff changeset
   175
		dstP += 2;
62426e8110ae stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents: 5477
diff changeset
   176
	    }
62426e8110ae stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents: 5477
diff changeset
   177
	}
62426e8110ae stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents: 5477
diff changeset
   178
	RETURN (self);
5128
6092105361d1 +magnifyRowFrom:offset:into:offset:factor:
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   179
    }
6092105361d1 +magnifyRowFrom:offset:into:offset:factor:
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   180
%}.
6092105361d1 +magnifyRowFrom:offset:into:offset:factor:
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   181
    super
6066
62426e8110ae stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents: 5477
diff changeset
   182
	magnifyRowFrom:srcBytes offset:srcStart
62426e8110ae stx macros with 2 underlines
Claus Gittinger <cg@exept.de>
parents: 5477
diff changeset
   183
	into:dstBytes offset:dstStart factor:mX
5128
6092105361d1 +magnifyRowFrom:offset:into:offset:factor:
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   184
! !
6092105361d1 +magnifyRowFrom:offset:into:offset:factor:
Claus Gittinger <cg@exept.de>
parents: 4759
diff changeset
   185
193
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
!Depth16Image methodsFor:'queries'!
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
bitsPerPixel
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
    "return the number of bits per pixel"
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
    ^ 16
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
!
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
bitsPerRow
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
    "return the number of bits in one scanline of the image"
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
3868
e47cf114c824 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
   197
    ^ width * 16
193
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
!
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
bytesPerRow
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
    "return the number of bytes in one scanline of the image"
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
    ^ width * 2.
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
! !
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
281
4f04a56b1641 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   206
!Depth16Image class methodsFor:'documentation'!
193
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
281
4f04a56b1641 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   208
version
7190
Claus Gittinger <cg@exept.de>
parents: 6306
diff changeset
   209
    ^ '$Header$'
5477
8badcb37a2c0 __isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents: 5128
diff changeset
   210
!
8badcb37a2c0 __isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents: 5128
diff changeset
   211
8badcb37a2c0 __isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents: 5128
diff changeset
   212
version_CVS
7190
Claus Gittinger <cg@exept.de>
parents: 6306
diff changeset
   213
    ^ '$Header$'
193
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
! !
6306
a3bbe514829e class: Depth16Image
Claus Gittinger <cg@exept.de>
parents: 6066
diff changeset
   215