eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'Depth4Image':

Home

everywhere
www.exept.de
for:
[back]

Class: Depth4Image


Inheritance:

   Object
   |
   +--Image
      |
      +--Depth4Image

Package:
stx:libview
Category:
Graphics-Images
Version:
rev: 1.51 date: 2009/11/05 14:37:10
user: stefan
file: Depth4Image.st directory: libview
module: stx stc-classLibrary: libview
Author:
Claus Gittinger

Description:


this class represents 16-color (4 bit / pixel) images.
Most images coming from the windows world are represented as Depth4Images.
It mainly consists of methods already implemented in Image,
reimplemented here for more performance.


Related information:

    Depth1Image
    Depth2Image
    Depth8Image
    Depth16Image
    Depth24Image
    ImageReader

Class protocol:

queries
o  defaultPhotometric
return the default photometric pixel interpretation

o  imageDepth
return the depth of images represented by instances of
this class - here we return 4


Instance protocol:

accessing-pixels
o  pixelAtX: x y: y
retrieve a pixel at x/y; return a pixelValue.
Pixels start at x=0 , y=0 for upper left pixel, end at
x = width-1, y=height-1 for lower right pixel

o  pixelAtX: x y: y put: aPixelValue
set the pixel at x/y to aPixelValue.
Pixels start at x=0 , y=0 for upper left pixel, end at
x = width-1, y=height-1 for lower right pixel

o  rowAt: y into: aPixelBuffer
fill aBuffer with pixel values retrieved from a single row.
Notice: row coordinate starts with 0.

converting images
o  anyImageAsTrueColorFormOn: aDevice
return a true-color device-form for receiver.
Supports true color devices with depths: 8, 16, 24 and 32

o  greyImageAsTrueColorFormOn: aDevice
return a true-color device-form for the grey-image receiver.
Supports true color devices with depths: 8, 16, 24 and 32

o  paletteImageAsTrueColorFormOn: aDevice
return a true-color device-form for the palette-image receiver.
Supports true color devices with depths: 8, 16, 24 and 32

o  rgbImageAsTrueColorFormOn: aDevice
return a true-color device-form for the rgb-image receiver.
Supports true color devices with depths: 8, 16, 24 and 32

dither helpers
o  orderedDitheredGrayBitsWithDitherMatrix: ditherMatrix ditherWidth: dW depth: depth
return the bitmap for a dithered depth-bitmap from the image;
with a constant ditherMatrix, this can be used for thresholding.
Redefined to make use of knowing that pixels are 4-bit values.

o  orderedDitheredMonochromeBitsWithDitherMatrix: ditherMatrix ditherWidth: dW
return the dithered monochrome bits for the receiver image;
with a constant ditherMatrix, this can be used for thresholding.
Redefined to make use of knowing that pixels are 4-bit values.

enumerating
o  colorsAtY: y from: xLow to: xHigh do: aBlock
perform aBlock for each pixel from x1 to x2 in row y.
The block is passed the color at each pixel.
This method allows slighly faster processing of an
image than using atX:y:, since some processing can be
avoided when going from pixel to pixel. However, for
real image processing, specialized methods should be written.

o  valuesAtY: y from: xLow to: xHigh do: aBlock
perform aBlock for each pixelValue from x1 to x2 in row y.
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
avoided when going from pixel to pixel. However, for
real image processing, specialized methods should be written.

magnification
o  magnifyRowFrom: srcBytes offset: srcStart into: dstBytes offset: dstStart factor: mX
magnify a single pixel row - can only magnify by integer factors.
Specially tuned for factor 2.

queries
o  bitsPerPixel
return the number of bits per pixel

o  bitsPerRow
return the number of bits in one scanline of the image

o  bytesPerRow
return the number of bytes in one scanline of the image

o  colorFromValue: pixelValue
given a pixel value, return the corresponding color.
Pixel values start with 0.

o  usedValues
return a collection of color values used in the receiver.



ST/X 6.1.1; WebServer 1.620 at exept:8081; Wed, 23 May 2012 08:50:44 GMT