Revision history for KeyPgPoint
Additions:
The value return is a color index in a 256 or less color ##[[KeyPgScreengraphics|Screen (Graphics)]]##, and an ##[[KeyPgRgb|RGB]]## value in true color modes. If the coordinates are off-screen or off-buffer, ##-1## is returned
Deletions:
Revision [25486]
Edited on 2021-10-12 01:55:14 by fxm [differences from versions previous to 1.08 transferred to the Version section]Additions:
The return datatype is a ##[[KeyPgUlong|ULong]]##.
{{fbdoc item="filename" value="examples/manual/gfx/point.bas"}}%%(freebasic)
sleep
%%
Output:
%%
%%
{{fbdoc item="ver"}}
Before fbc 1.08.0, the return datatype was an ##[[KeyPgInteger|Integer]]##.
{{fbdoc item="filename" value="examples/manual/gfx/point.bas"}}%%(freebasic)
sleep
%%
Output:
%%
%%
{{fbdoc item="ver"}}
Before fbc 1.08.0, the return datatype was an ##[[KeyPgInteger|Integer]]##.
Deletions:
{{fbdoc item="filename" value="examples/manual/gfx/point.bas"}}%%(freebasic)
sleep%%
**Output:**
%%
%%
Additions:
The return datatype is an ##[[KeyPgInteger|Integer]]## for fbc version < 1.08, or a ##[[KeyPgUlong|ULong]]## for fbc version >= 1.08.
Deletions:
Additions:
The return datatype is an ##[[KeyPgInteger|Integer]]## for fbc version < 1.08, or a ##[[KeyPgulong|ULong]]## for fbc version >= 1.08.
Deletions:
Additions:
If supplied with two coordinates it reads the color of the pixel at the coordinate ##//coord_x//##, ##//coord_y//## of the screen, or of the ##//buffer//##, if supplied.
Deletions:
Additions:
or
""GfxLib"" Function with two different uses.
""GfxLib"" Function with two different uses.
Deletions:
""GfxLib"" Function with two different uses.
Additions:
The return datatype is an ##[[KeyPgInteger|Integer]]## for fbc version < 1.08 or a ##[[KeyPgulong|ULong]]## for fbc version >= 1.08.
If the ##//x//, //y//## coordinates of a pixel are provided **##Point##** returns the color attribute at the specified coordinates, as an 8-bit palette index in 8 bpp indexed modes, a 24-bit RGB value in 16 bpp modes (upper 8 bits unused, limited precision of R,G,B), and a 32-bit RGB or RGBA value in 32 bpp modes (upper 8 bits unused or holding Alpha). Note that it does NOT return a 16-bit value (5 bits R + 6 bits G + 5 bits B).
If the ##//x//, //y//## coordinates of a pixel are provided **##Point##** returns the color attribute at the specified coordinates, as an 8-bit palette index in 8 bpp indexed modes, a 24-bit RGB value in 16 bpp modes (upper 8 bits unused, limited precision of R,G,B), and a 32-bit RGB or RGBA value in 32 bpp modes (upper 8 bits unused or holding Alpha). Note that it does NOT return a 16-bit value (5 bits R + 6 bits G + 5 bits B).
Deletions:
If the ##//x//, //y//## coordinates of a pixel are provided **##Point##** returns the color attribute at the specified coordinates, as an 8-bit palette index in 8 bpp indexed modes, a 24-bit RGB value in 16 bpp modes (upper 8 bits of the integer unused, limited precision of R,G,B), and a 32-bit RGB or RGBA value in 32 bpp modes (upper 8 bits unused or holding Alpha). Note that it does NOT return a 16-bit value (5 bits R + 6 bits G + 5 bits B).
Additions:
Speed note: while ##**Point**## provides valid results, it is quite slow to call repeatedly due to the overhead of additional calculations and checks. Much better performance can be achieved by using direct memory access using the results obtained from ##[[KeyPgImageInfo|Imageinfo]]## and ##[[KeyPgScreeninfo|Screeninfo]]##/##[[KeyPgScreenptr|ScreenPtr]]##.
Deletions:
Additions:
The return datatype is always an ##[[KeyPgInteger|Integer]]##.
Deletions:
Additions:
Deletions:
Additions:
The value return is a color index in a 256 or less color ##[[KeyPgScreengraphics|Screen]]##, and an ##[[KeyPgRgb|RGB]]## value in true color modes. If the coordinates are off-screen or off-buffer, ##-1## is returned
Speed note: while ##**Point**## provides valid results, it is quite slow to call repeatedly due to the overhead of additional calculations and checks. Much better performance can be achieved by using direct memory access using the results obtained from ##[[KeyPgImageinfo|Imageinfo]]## and ##[[KeyPgScreeninfo|Screeninfo]]##/##[[KeyPgScreenptr|ScreenPtr]]##.
- ##[[KeyPgPset|Pset]]## - write pixels
- ##[[KeyPgPmap|Pmap]]##
- ##[[KeyPgColor|Color]]##
- ##[[KeyPgViewgraphics|View (Graphics)]]##
- ##[[KeyPgWindow|Window]]##
- ##[[GfxInternalFormats|Internal pixel formats]]##
Speed note: while ##**Point**## provides valid results, it is quite slow to call repeatedly due to the overhead of additional calculations and checks. Much better performance can be achieved by using direct memory access using the results obtained from ##[[KeyPgImageinfo|Imageinfo]]## and ##[[KeyPgScreeninfo|Screeninfo]]##/##[[KeyPgScreenptr|ScreenPtr]]##.
- ##[[KeyPgPset|Pset]]## - write pixels
- ##[[KeyPgPmap|Pmap]]##
- ##[[KeyPgColor|Color]]##
- ##[[KeyPgViewgraphics|View (Graphics)]]##
- ##[[KeyPgWindow|Window]]##
- ##[[GfxInternalFormats|Internal pixel formats]]##
Deletions:
Speed note: while ##**Point**## provides valid results, it is quite slow to call repeatedly due to the overhead of additional calculations and checks. Much better performance can be achieved by using direct memory access using the results obtained from ##[[KeyPgImageinfo Imageinfo]]## and ##[[KeyPgScreeninfo Screeninfo]]##/##[[KeyPgScreenptr ScreenPtr]]##.
- ##[[KeyPgPset Pset]]## - write pixels
- ##[[KeyPgPmap Pmap]]##
- ##[[KeyPgColor Color]]##
- ##[[KeyPgViewgraphics View (Graphics)]]##
- ##[[KeyPgWindow Window]]##
- ##[[GfxInternalFormats Internal pixel formats]]##
Additions:
Speed note: while ##**Point**## provides valid results, it is quite slow to call repeatedly due to the overhead of additional calculations and checks. Much better performance can be achieved by using direct memory access using the results obtained from ##[[KeyPgImageinfo Imageinfo]]## and ##[[KeyPgScreeninfo Screeninfo]]##/##[[KeyPgScreenptr ScreenPtr]]##.
Deletions:
Additions:
Speed note: while ##**Point**## provides valid results, it is quite slow due to the overhead of additional calculations and checks. Much better performance can be achieved by using direct memory access using the results obtained from ##[[KeyPgImageinfo Imageinfo]]## and ##[[KeyPgScreeninfo Screeninfo]]##/##[[KeyPgScreenptr ScreenPtr]]##.
Deletions:
Revision [15163]
Edited on 2011-08-08 04:04:33 by CountingPine [Speed note: additional info; note about asm is unnecessary I think]Additions:
Speed note: while **Point** provides valid results, it is quite slow due to the overhead of additional calculations and checks. Much better performance can be achieved by using direct memory access using the results obtained from ##[[KeyPgImageinfo Imageinfo]]## and ##[[KeyPgScreeninfo Screeninfo]]##/##[[KeyPgScreenptr ScreenPtr]]##.
Deletions:
Revision [15162]
Edited on 2011-08-08 03:53:42 by CountingPine [Make example use the same screen mode as Point]Additions:
' Set an appropriate screen mode - 320 x 240 x 8bpp indexed color
screenres 320, 240, 8
' Draw a line using color 12 (light red)
line (20,20)-(100,100), 12
' Print the color of a point on the line
' Sleep before the program closes
sleep%%
screenres 320, 240, 8
' Draw a line using color 12 (light red)
line (20,20)-(100,100), 12
' Print the color of a point on the line
' Sleep before the program closes
sleep%%
Deletions:
line (10,10)-(100,100),12
Revision [15145]
Edited on 2011-08-07 04:12:51 by DoS386 [someone please fix the examples too PSET+>POINT< both same screen]Additions:
If the ##//x//, //y//## coordinates of a pixel are provided **##Point##** returns the color attribute at the specified coordinates, as an 8-bit palette index in 8 bpp indexed modes, a 24-bit RGB value in 16 bpp modes (upper 8 bits of the integer unused, limited precision of R,G,B), and a 32-bit RGB or RGBA value in 32 bpp modes (upper 8 bits unused or holding Alpha). Note that it does NOT return a 16-bit value (5 bits R + 6 bits G + 5 bits B).
Deletions:
Revision [15141]
Edited on 2011-08-07 02:29:56 by DoS386 [hopefully fixed, please upgrade example and use same SCREEN for pset and point ......]Additions:
- In 16 bpp and 32 bpp modes, a 32-bit value is returned instead of an 8-bit palette index
Deletions:
Revision [15140]
Edited on 2011-08-07 02:27:07 by DoS386 [hopefully fixed, please upgrade example and use same SCREEN for pset and point ....]Additions:
- ##[[KeyPgPset Pset]]## - write pixels
Deletions:
Revision [15139]
Edited on 2011-08-07 02:25:47 by DoS386 [hopefully fixed, please upgrade example and use same SCREEN for pset and point ..]Additions:
If the ##//x//, //y//## coordinates of a pixel are provided **##Point##** returns the color attribute at the specified coordinates, as an 8-bit palette index in 8 bpp indexed modes, a 24-bit RGB value in 16 bpp modes, and a 32-bit RGBA value in 32 bpp modes. Note that it does NOT return a 16-bit value (5 bits R + 6 bits G + 5 bits B).
screen 13 '' 320 x 200 x 8bb indexed !!!FIXME!!!
screen 13 '' 320 x 200 x 8bb indexed !!!FIXME!!!
Deletions:
screen 13 '' 320 x 200 x 8bb indexed
Revision [15138]
Edited on 2011-08-07 02:24:33 by DoS386 [hopefully fixed, please upgrade example and use same SCREEN for pset and point]Additions:
If the ##//x//, //y//## coordinates of a pixel are provided **##Point##** returns the color attribute at the specified coordinates, as an 8-bit palette index in 8 bpp indexed modes, a 24-bit RGB value in 16 bpp modes, and a 32-bit RGBA value in 32 bpp modes. Note that it does NOT return an 16-bit value (5 bits R + 6 bits G + 5 bits B).
If the argument is a function index, **##Point##** returns one of the graphics cursor coordinates set by the last graphics command.
If the argument is a function index, **##Point##** returns one of the graphics cursor coordinates set by the last graphics command.
Deletions:
If the argument is a function index, **##Point##** returns one of the graphics cursor coordinates set by the last graphics command.
Revision [15137]
Edited on 2011-08-07 01:58:47 by DoS386 [killed some invisible whitespace, effect in 16bpp modes is very poorly documented]Additions:
The function ##**Point**## does not work in text modes.
Optimization note: while **Point** and the opposite ##[[KeyPgPset Pset]]## provide valid results, they are very slow. Much better performance can be achieved by using ##[[KeyPgPeek Peek]]## after calculating the address yourself from values obtained from ##[[KeyPgImageinfo Imageinfo]]## and ##[[KeyPgScreeninfo Screeninfo]]##, or even more using inline ASM.
screen 13 '' 320 x 200 x 8bb indexed
- ##[[GfxInternalFormats Internal pixel formats]]##
Optimization note: while **Point** and the opposite ##[[KeyPgPset Pset]]## provide valid results, they are very slow. Much better performance can be achieved by using ##[[KeyPgPeek Peek]]## after calculating the address yourself from values obtained from ##[[KeyPgImageinfo Imageinfo]]## and ##[[KeyPgScreeninfo Screeninfo]]##, or even more using inline ASM.
screen 13 '' 320 x 200 x 8bb indexed
- ##[[GfxInternalFormats Internal pixel formats]]##
Deletions:
The function ##**Point**## does not work in text modes.
Optimization note: while **Point** and the opposite ##[[KeyPgPset Pset]]## provide valid results, they are very slow. Much better performance can be achieved by using ##[[KeyPgPeek Peek]]## after calculating the address yourself from values obtained from ##[[KeyPgImageinfo Imageinfo]]## and ##[[KeyPgScreeninfo Screeninfo]]##, or even more usig inline ASM.
screen 13
Additions:
The function ##**Point**## does not work in text modes.
Optimization note: while **Point** and the opposite ##[[KeyPgPset Pset]]## provide valid results, they are very slow. Much better performance can be achieved by using ##[[KeyPgPeek Peek]]## after calculating the address yourself from values obtained from ##[[KeyPgImageinfo Imageinfo]]## and ##[[KeyPgScreeninfo Screeninfo]]##, or even more usig inline ASM.
Optimization note: while **Point** and the opposite ##[[KeyPgPset Pset]]## provide valid results, they are very slow. Much better performance can be achieved by using ##[[KeyPgPeek Peek]]## after calculating the address yourself from values obtained from ##[[KeyPgImageinfo Imageinfo]]## and ##[[KeyPgScreeninfo Screeninfo]]##, or even more usig inline ASM.
Deletions:
Additions:
- ##//buffer//## is new to ""FreeBASIC""
- In SVGA modes, a 32-bit RGB value is returned
- In SVGA modes, a 32-bit RGB value is returned
Deletions:
Additions:
If supplied with two coordinates it reads the color of the pixel at the coordinate ##//coord_x//##, ##//coord_y//## of the screen, or of the ##//buffer//##, if supplied.
Deletions:
Additions:
The value return is a color index in a 256 or less color ##[[KeyPgScreengraphics Screen]]##, and an ##[[KeyPgRgb RGB]]## value in true color modes. If the coordinates are off-screen or off-buffer, ##-1## is returned
If supplied with a single value it returns the one of the coordinates of the graphics cursor as set by the last graphics command executed. If the last command was executed in a buffer, the values returned will be coordinates in the buffer. Arguments out of the range ##0##-##3## will return ##0##.
If supplied with a single value it returns the one of the coordinates of the graphics cursor as set by the last graphics command executed. If the last command was executed in a buffer, the values returned will be coordinates in the buffer. Arguments out of the range ##0##-##3## will return ##0##.
Deletions:
If supplied with s single value it returns the one of the coordinates of the graphics cursor as set by the last graphics command executed. If the last command was executed in a buffer, the values returned will be coordinates in the buffer. Arguments out of the range ##0##-##3## will return ##0##.
Additions:
//result// = **Point**( //function_index// )
{{fbdoc item="usage"}}
the type of screen coordinate to return: one of the values ##0##, ##1##, ##2##, ##3##
{{fbdoc item="ret"}}
If the ##//x//, //y//## coordinates of a pixel are provided **##Point##** returns the color attribute at the specified coordinates.
If the argument is a function index, **##Point##** returns one of the graphics cursor coordinates set by the last graphics command.
{{table columns="2" cellpadding="1" cells="Argument; Value Returned ; 0;The current physical x coordinate.;1;The current physical y coordinate.; 2;The current view x coordinate. This returns the same value as the POINT(0) function if the WINDOW statement has not been used.;3;The current view y coordinate. This returns the same value as the POINT(1) function if the WINDOW statement has not been used."}}
""GfxLib"" Function with two different uses.
The value return is a color index in a 256 or less color ##[[KeyPgScreengraphics Screen]]##, and an ##[[KeyPgRgb RGB]]## value in true color modes. If the coordinates are off-screen, ##-1## is returned
If supplied with s single value it returns the one of the coordinates of the graphics cursor as set by the last graphics command executed. If the last command was executed in a buffer, the values returned will be coordinates in the buffer. Arguments out of the range ##0##-##3## will return ##0##.
- None, in the QB-compatible ##[[KeyPgScreengraphics Screen]]## modes. In SVGA modes, it returns an RGB value
- ##[[KeyPgViewgraphics View (Graphics)]]##
{{fbdoc item="usage"}}
the type of screen coordinate to return: one of the values ##0##, ##1##, ##2##, ##3##
{{fbdoc item="ret"}}
If the ##//x//, //y//## coordinates of a pixel are provided **##Point##** returns the color attribute at the specified coordinates.
If the argument is a function index, **##Point##** returns one of the graphics cursor coordinates set by the last graphics command.
{{table columns="2" cellpadding="1" cells="Argument; Value Returned ; 0;The current physical x coordinate.;1;The current physical y coordinate.; 2;The current view x coordinate. This returns the same value as the POINT(0) function if the WINDOW statement has not been used.;3;The current view y coordinate. This returns the same value as the POINT(1) function if the WINDOW statement has not been used."}}
""GfxLib"" Function with two different uses.
The value return is a color index in a 256 or less color ##[[KeyPgScreengraphics Screen]]##, and an ##[[KeyPgRgb RGB]]## value in true color modes. If the coordinates are off-screen, ##-1## is returned
If supplied with s single value it returns the one of the coordinates of the graphics cursor as set by the last graphics command executed. If the last command was executed in a buffer, the values returned will be coordinates in the buffer. Arguments out of the range ##0##-##3## will return ##0##.
- None, in the QB-compatible ##[[KeyPgScreengraphics Screen]]## modes. In SVGA modes, it returns an RGB value
- ##[[KeyPgViewgraphics View (Graphics)]]##
Deletions:
{{fbdoc item="usage"}}##
one of the values 0,1,2,3
{{fbdoc item="ret"}}##
If the x,y coordinates of a pixel are provided **Point** returns the color attribute at the specified coordinates.
If the argument is a function index, **Point** returns one of the graphics cursor coordinates set by the last graphics command.
{{table columns="2" cellpadding="1" cells="Argument; Value Returned ; 0;The current physical x coordinate.;1;The current physical y coordinate.; 2;The current view x oordinate. This returns the same value as the POINT(0) function if the WINDOW statement has not been used.;3;The current view y coordinate. This returns the same value as the POINT(1) function if the WINDOW statement has not been used."}}
GfxLib Function with two different uses.
The value return is a color index in a 256 or less color ##[[KeyPgScreengraphics Screen]]##, and a RGB value in true color modes. If the coordinates are off-screen, -1 is returned
If supplied with s single value it returns the one of the coordinates of the graphics cursor as set by the last graphics command executed. If the last command was executed in a buffer, the values returned will be coordinates in the buffer. Arguments out of the range 0-3 will return 0.
- None, in the VGA compatible SCREEN modes. In SVGA modes, it returns a RGB value
- ##[[KeyPgViewgraphics View (Grpahics)]]##
Additions:
//result// = **Point**( //function_index//)
If the x,y coordinates of a pixel are provided **Point** returns the color attribute at the specified coordinates.
If the argument is a function index, **Point** returns one of the graphics cursor coordinates set by the last graphics command.
GfxLib Function with two different uses.
If supplied with two coordinates it reads the color of the pixel at the coordinate ##//coord_x//##, ##//coord_y//## of the screen, or of ##//buffer//##, if supplied.
The value return is a color index in a 256 or less color ##[[KeyPgScreengraphics Screen]]##, and a RGB value in true color modes. If the coordinates are off-screen, -1 is returned
If supplied with s single value it returns the one of the coordinates of the graphics cursor as set by the last graphics command executed. If the last command was executed in a buffer, the values returned will be coordinates in the buffer. Arguments out of the range 0-3 will return 0.
If the x,y coordinates of a pixel are provided **Point** returns the color attribute at the specified coordinates.
If the argument is a function index, **Point** returns one of the graphics cursor coordinates set by the last graphics command.
GfxLib Function with two different uses.
If supplied with two coordinates it reads the color of the pixel at the coordinate ##//coord_x//##, ##//coord_y//## of the screen, or of ##//buffer//##, if supplied.
The value return is a color index in a 256 or less color ##[[KeyPgScreengraphics Screen]]##, and a RGB value in true color modes. If the coordinates are off-screen, -1 is returned
If supplied with s single value it returns the one of the coordinates of the graphics cursor as set by the last graphics command executed. If the last command was executed in a buffer, the values returned will be coordinates in the buffer. Arguments out of the range 0-3 will return 0.
Deletions:
If the x,y coordinates of a pixel are provided **Point** returns the color attribute at the specified coordinates
If the argument is a function index, **Point** returns one of the graphics cursor coordinates
GfxLib Function that reads the color of the pixel at the coordinate ##//coord_x//##, ##//coord_y//## of the screen, or of ##//buffer//##, if supplied.
The value return is a color index in a 256 or less color ##[[KeyPgScreengraphics Screen]]##, and a RGB value in true color modes. If the coordinates are off-screen, -1 is returned
Additions:
or
//result// = **Point**( //function_index//, [,//buffer//] )
##//function_index//##
one of the values 0,1,2,3
If the x,y coordinates of a pixel are provided **Point** returns the color attribute at the specified coordinates
If the argument is a function index, **Point** returns one of the graphics cursor coordinates
{{table columns="2" cellpadding="1" cells="Argument; Value Returned ; 0;The current physical x coordinate.;1;The current physical y coordinate.; 2;The current view x oordinate. This returns the same value as the POINT(0) function if the WINDOW statement has not been used.;3;The current view y coordinate. This returns the same value as the POINT(1) function if the WINDOW statement has not been used."}}
GfxLib Function that reads the color of the pixel at the coordinate ##//coord_x//##, ##//coord_y//## of the screen, or of ##//buffer//##, if supplied.
//result// = **Point**( //function_index//, [,//buffer//] )
##//function_index//##
one of the values 0,1,2,3
If the x,y coordinates of a pixel are provided **Point** returns the color attribute at the specified coordinates
If the argument is a function index, **Point** returns one of the graphics cursor coordinates
{{table columns="2" cellpadding="1" cells="Argument; Value Returned ; 0;The current physical x coordinate.;1;The current physical y coordinate.; 2;The current view x oordinate. This returns the same value as the POINT(0) function if the WINDOW statement has not been used.;3;The current view y coordinate. This returns the same value as the POINT(1) function if the WINDOW statement has not been used."}}
GfxLib Function that reads the color of the pixel at the coordinate ##//coord_x//##, ##//coord_y//## of the screen, or of ##//buffer//##, if supplied.
Deletions:
GfxLib Function that reads the color of the pixel at the coordinate ##//coord_x//##, ##//coord_y//## of the screen, or of ##//buffer//##, if supplied.