# HG changeset patch # User Claus Gittinger # Date 1504013989 -7200 # Node ID e9b6817158596fc2b05943f3c5b566183a2d0dd3 # Parent f7f0d04eda06dc12d49e9b4d30911e737a99e9f2 #OTHER by cg x diff -r f7f0d04eda06 -r e9b681715859 Depth24Image.st --- a/Depth24Image.st Tue Aug 29 15:39:48 2017 +0200 +++ b/Depth24Image.st Tue Aug 29 15:39:49 2017 +0200 @@ -182,10 +182,14 @@ ! rgbValueAtX:x y:y - "retrieve a pixels rgb value at x/y; return a 24bit rgbValue (rrggbb, red is MSB). - Pixels start at 0@0 for upper left pixel, end at (width-1)@(height-1) for lower right pixel." + "retrieve a pixel's rgb value at x/y; + return a 24bit rgbValue (rrggbb, red is MSB). + Pixels start at 0@0 for the upper left pixel, + and end at (width-1)@(height-1) for the lower right pixel." ^ self pixelAtX:x y:y. + + "Modified (comment): / 29-08-2017 / 14:35:01 / cg" ! rowAt:y putAll:pixelArray startingAt:startIndex @@ -2639,7 +2643,15 @@ ! valuesAtY:y from:xLow to:xHigh do:aBlock - "perform aBlock for each pixelValue from x1 to x2 in row y. + "WARNING: this enumerates pixel values which need photometric interpretation + Do not confuse with #rgbValuesAtY:from:to:do: + + Perform aBlock for each pixelValue from x1 to x2 in row y. + + Notice the difference between rgbValue and pixelValue: rgbValues are always + the rgb bytes; pixelvalues depend on the photometric interpretation, and may be + indices into a colormap or be non-byte-sized rgb values. + The block is passed the pixelValue at each pixel. This method allows slighly faster processing of an image than using valueAtX:y:, since some processing can be @@ -2664,19 +2676,27 @@ srcIndex := 1 + (((width * y) + x1) * 3). x1 to:x2 do:[:x | - r := bytes at:(srcIndex). - g := bytes at:(srcIndex + 1). - b := bytes at:(srcIndex + 2). - srcIndex := srcIndex + 3. - aBlock value:x value:(((r bitShift:16) bitOr:(g bitShift:8)) bitOr:b) + r := bytes at:(srcIndex). + g := bytes at:(srcIndex + 1). + b := bytes at:(srcIndex + 2). + srcIndex := srcIndex + 3. + aBlock value:x value:(((r bitShift:16) bitOr:(g bitShift:8)) bitOr:b) ] - "Created: 7.6.1996 / 19:09:40 / cg" + "Created: / 07-06-1996 / 19:09:40 / cg" + "Modified (comment): / 29-08-2017 / 14:53:14 / cg" ! valuesFromX:xStart y:yStart toX:xEnd y:yEnd do:aBlock - "perform aBlock for each pixel in the rectangle - yStart..yEnd / xStart..xEnd. + "WARNING: this enumerates pixel values which need photometric interpretation + Do not confuse with #rgbValuesAtY:from:to:do: + + Perform aBlock for each pixelValue in a rectangular area of the image. + + Notice the difference between rgbValue and pixelValue: rgbValues are always + the rgb bytes; pixelvalues depend on the photometric interpretation, and may be + indices into a colormap or be non-byte-sized rgb values. + The block is passed the pixelValue at each pixel. This method allows slighly faster processing of an image than using individual valueAtX:y: accesses, @@ -2768,8 +2788,8 @@ srcIndex := srcNext. ]. - "Modified: 11.7.1996 / 20:06:47 / cg" - "Created: 11.7.1996 / 20:08:11 / cg" + "Created: / 11-07-1996 / 20:08:11 / cg" + "Modified (comment): / 29-08-2017 / 14:45:54 / cg" ! ! !Depth24Image methodsFor:'image manipulations'!