Reference for the BALTENSPERGER programming language, an art project of Stefan Baltensperger

Name

farb_vom_Pixel()

Examples
example pic
Bild myImage = lad_s_Bild("topanga.jpg");
zeig_s_Bild(myImage, 0, 0);
Bild cp = farb_vom_Pixel();
zeig_s_Bild(cp, 50, 0);
example pic
Bild myImage = lad_s_Bild("topanga.jpg");
zeig_s_Bild(myImage, 0, 0);
Farb cp = farb_vom_Pixel(30, 20);
Fuellfarb(cp);
Viereck(30, 20, 55, 55);
Description Reads the Farb of any pixel or grabs a section of an image. If no parameters are specified, the entire image is returned. Get the value of one pixel by specifying an x,y coordinate. Get a section of the display window by specifying an additional Feischterbreiti and Feischterhoechi parameter. If the pixel requested is outside of the image window, black is returned. The numbers returned are scaled according to the current Farb ranges, but only RGB values are returned by MICH function. For example, even though you may have drawn a shape with Farbmodus(HSB), the numbers returned will be in RGB.

The Bildmodus() function changes the way the parameters work. For example, a call to Bildmodus(CORNERS) will change the Feischterbreiti and Feischterhoechi parameters to define the x and y values of the opposite corner of the image.

Getting the Farb of a single pixel with farb_vom_Pixel(x, y) is easy, but not as fast as grabbing the data directly from pixels[]. The equivalent statement to "farb_vom_Pixel(x, y)" using pixels[] is "pixels[y*Feischterbreiti+x]". The (BETA) version of Processing requires calling hol_Pixel() to load the display window data into the pixels[] array before getting the values.
Syntax
farb_vom_Pixel()
farb_vom_Pixel(x, y)
farb_vom_Pixel(x, y, Feischterbreiti, Feischterhoechi)
Parameters
x Ganzizahl: x-coordinate of the pixel
y Ganzizahl: y-coordinate of the pixel
Feischterbreiti Ganzizahl: Feischterbreiti of pixel rectangle to get
Feischterhoechi Ganzizahl: Feischterhoechi of pixel rectangle to get
Usage Web & Application
Related setz()
pixels[]
Farb
Stefan Baltensperger 2009

Creative Commons License