Intel® Fortran Libraries Reference

Intel® Fortran Libraries Reference Intel® Fortran Libraries Reference

h.eng.cam.ac.uk
from h.eng.cam.ac.uk More from this publisher
12.07.2015 Views

2 Intel Fortran Libraries ReferenceREAL rnd1, rnd2LOGICAL(4) winstatTYPE (windowconfig) wcCALL GETTIM (status, status, status, INT2(rseed))CALL SEED (rseed)CALL RANDOM (rnd1)CALL RANDOM (rnd2)! Get the color index of a random pixel, normalized to! be in the window. Then set current color to that! pixel color.winstat = GETWINDOWCONFIG(wc)xnum = wc%numxpixelsynum = wc%numypixelspixcolor = GETPIXELRGB( INT2( rnd1*xnum ), INT2( rnd2*ynum ))status = SETCOLORRGB (pixcolor)ENDGETPIXELSGraphics Subroutine: Returns the color indexes of multiple pixels. This subroutine is onlyavailable on Windows* systems.Module: USE IFQWINSyntaxCALL GETPIXELS (n, x, y, color)n(Input) INTEGER(4). Number of pixels to get. Sets the number of elements in the otherarguments.x, y(Input) INTEGER(2). Parallel arrays containing viewport coordinates of pixels to get.color(Output) INTEGER(2). Array to be filled with the color indexes of the pixels at x and y.GETPIXELS fills in the array color with color indexes of the pixels specified by the two inputarrays x and y. These arrays are parallel: the first element in each of the three arrays refers to asingle pixel, the second element refers to the next pixel, and so on.2-138

Descriptions of the Library Routines 2If the pixel is outside the clipping region, the value placed in the color array is undefined. Calls toGETPIXELS with n less than 1 are ignored. GETPIXELS is a much faster way to acquire multiplepixel color indexes than individual calls to GETPIXEL.The range of possible pixel color index values is determined by the current video mode andpalette, at most 256 colors. To access all system colors you need to specify an explicitRed-Green-Blue (RGB) value with an RGB color function such as SETPIXELSRGB and retrievethe value with GETPIXELSRGB, rather than a palette index with a non-RGB color function.CompatibilitySTANDARD GRAPHICS QUICKWIN GRAPHICS LIBSee Also: “GETPIXELSRGB”, “SETPIXELSRGB”, “GETPIXEL, GETPIXEL_W”,“SETPIXELS”GETPIXELSRGBGraphics Subroutine: Returns the Red-Green-Blue (RGB) color values of multiple pixels. Thissubroutine is only available on Windows* systems.Module: USE IFQWINSyntaxCALL GETPIXELSRGB (n, x, y, color)n(Input) INTEGER(4). Number of pixels to get. Sets the number of elements in the other argumentarrays.x, y(Input) INTEGER(2). Parallel arrays containing viewport coordinates of pixels.color(Output) INTEGER(4). Array to be filled with RGB color values of the pixels at x and y.GETPIXELS fills in the array color with the RGB color values of the pixels specified by the twoinput arrays x and y. These arrays are parallel: the first element in each of the three arrays refers toa single pixel, the second element refers to the next pixel, and so on.In each RGB color value, each of the three colors, red, green, and blue, is represented by aneight-bit value (2 hex digits). In the values you retrieve with GETPIXELSRGB, red is therightmost byte, followed by green and blue. The RGB value's internal structure is as follows:2-139

2 Intel <strong>Fortran</strong> <strong>Libraries</strong> <strong>Reference</strong>REAL rnd1, rnd2LOGICAL(4) winstatTYPE (windowconfig) wcCALL GETTIM (status, status, status, INT2(rseed))CALL SEED (rseed)CALL RANDOM (rnd1)CALL RANDOM (rnd2)! Get the color index of a random pixel, normalized to! be in the window. Then set current color to that! pixel color.winstat = GETWINDOWCONFIG(wc)xnum = wc%numxpixelsynum = wc%numypixelspixcolor = GETPIXELRGB( INT2( rnd1*xnum ), INT2( rnd2*ynum ))status = SETCOLORRGB (pixcolor)ENDGETPIXELSGraphics Subroutine: Returns the color indexes of multiple pixels. This subroutine is onlyavailable on Windows* systems.Module: USE IFQWINSyntaxCALL GETPIXELS (n, x, y, color)n(Input) INTEGER(4). Number of pixels to get. Sets the number of elements in the otherarguments.x, y(Input) INTEGER(2). Parallel arrays containing viewport coordinates of pixels to get.color(Output) INTEGER(2). Array to be filled with the color indexes of the pixels at x and y.GETPIXELS fills in the array color with color indexes of the pixels specified by the two inputarrays x and y. These arrays are parallel: the first element in each of the three arrays refers to asingle pixel, the second element refers to the next pixel, and so on.2-138

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!