Intel® Fortran Libraries Reference
Intel® Fortran Libraries Reference Intel® Fortran Libraries Reference
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
- Page 140 and 141: 2 Intel Fortran Libraries Reference
- Page 142 and 143: 2 Intel Fortran Libraries Reference
- Page 144 and 145: 2 Intel Fortran Libraries Reference
- Page 146 and 147: 2 Intel Fortran Libraries Reference
- Page 148 and 149: 2 Intel Fortran Libraries Reference
- Page 150 and 151: 2 Intel Fortran Libraries Reference
- Page 152 and 153: 2 Intel Fortran Libraries Reference
- Page 154 and 155: 2 Intel Fortran Libraries Reference
- Page 156 and 157: 2 Intel Fortran Libraries Reference
- Page 158 and 159: 2 Intel Fortran Libraries Reference
- Page 160 and 161: 2 Intel Fortran Libraries Reference
- Page 162 and 163: 2 Intel Fortran Libraries Reference
- Page 164 and 165: 2 Intel Fortran Libraries Reference
- Page 166 and 167: 2 Intel Fortran Libraries Reference
- Page 168 and 169: 2 Intel Fortran Libraries Reference
- Page 170 and 171: 2 Intel Fortran Libraries Reference
- Page 172 and 173: 2 Intel Fortran Libraries Reference
- Page 174 and 175: 2 Intel Fortran Libraries Reference
- Page 176 and 177: 2 Intel Fortran Libraries Reference
- Page 178 and 179: 2 Intel Fortran Libraries Reference
- Page 180 and 181: 2 Intel Fortran Libraries Reference
- Page 182 and 183: 2 Intel Fortran Libraries Reference
- Page 184 and 185: 2 Intel Fortran Libraries Reference
- Page 186 and 187: 2 Intel Fortran Libraries Reference
- Page 188 and 189: 2 Intel Fortran Libraries Reference
- Page 192 and 193: 2 Intel Fortran Libraries Reference
- Page 194 and 195: 2 Intel Fortran Libraries Reference
- Page 196 and 197: 2 Intel Fortran Libraries Reference
- Page 198 and 199: 2 Intel Fortran Libraries Reference
- Page 200 and 201: 2 Intel Fortran Libraries Reference
- Page 202 and 203: 2 Intel Fortran Libraries Reference
- Page 204 and 205: 2 Intel Fortran Libraries Reference
- Page 206 and 207: 2 Intel Fortran Libraries Reference
- Page 208 and 209: 2 Intel Fortran Libraries Reference
- Page 210 and 211: 2 Intel Fortran Libraries Reference
- Page 212 and 213: 2 Intel Fortran Libraries Reference
- Page 214 and 215: 2 Intel Fortran Libraries Reference
- Page 216 and 217: 2 Intel Fortran Libraries Reference
- Page 218 and 219: 2 Intel Fortran Libraries Reference
- Page 220 and 221: 2 Intel Fortran Libraries Reference
- Page 222 and 223: 2 Intel Fortran Libraries Reference
- Page 224 and 225: 2 Intel Fortran Libraries Reference
- Page 226 and 227: 2 Intel Fortran Libraries Reference
- Page 228 and 229: 2 Intel Fortran Libraries Reference
- Page 230 and 231: 2 Intel Fortran Libraries Reference
- Page 232 and 233: 2 Intel Fortran Libraries Reference
- Page 234 and 235: 2 Intel Fortran Libraries Reference
- Page 236 and 237: 2 Intel Fortran Libraries Reference
- Page 238 and 239: 2 Intel Fortran Libraries Reference
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