Brightness and Contrast

Jeanne A. E. DeVoto jeanne at runrev.com
Tue Jan 15 18:14:00 EST 2002


At 2:30 AM -0800 1/14/2002, Marten van den Berg wrote:
>I could't find a description of the imageData property in my transcript
>dictionary (I'm using rev 1.1).

I had forgotten, there's a bug in the 1.1 version. The imageData property
is in there, though, and you can get to it by typing "imagePixmap" into the
search box at the tiop of the dictionary, then pressing the left arrow to
go back one card.

Here's the info from the dictionary:

---------------
The imageData property specifies the binary data that makes up the picture
in an image object.

Syntax:
set the imageData of image to binaryData

Examples:
put the imageData of image ID 3577 into dateToAnalyze
set the imageData of the mouseControl to the personalImage of this card

Use the imageData property to process an image and display the processed
version.

Value:
The imageData of an image consists of a sequence of binary values.

Notes:
Each pixel is represented by 32 bits (4 bytes) of image data, with pixels
numbered from the top left corner of the image, left to right, then top to
bottom. The first byte consists of zeroes, and the last three bytes encode
the amount of red, green, and blue respectively.

Since each pixel is represented by 4 bytes (4 characters), you can obtain
the numeric value of any of the color channels for a given pixel using the
charToNum function. For example, the numeric value of the red channel for
the tenth pixel is given by the expression charToNum(char 10 + 1 of the
imageData of image); the numeric value of the green channel is
charToNum(char 10 + 2 of the imageData of image); and the numeric value of
the blue channel is charToNum(char 10 + 3 of the imageData of image).
---------------

I'm thinking it would be possible to process this data in a repeat loop,
altering each run of four bytes and then writing out the altered values.

--
Jeanne A. E. DeVoto ~ jeanne at runrev.com
http://www.runrev.com/
Runtime Revolution Limited - Power to the Developer!





More information about the use-livecode mailing list