Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pi/pigetpixel.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pi/pigetpixel.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pi/pigetpixel.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pi/pigetpixel.html on line 8
Retrieve the value of a pixel within an image
int PiGetPixel( PhImage_t const *image,
unsigned short x,
unsigned short y,
unsigned long *value );
ph
This function retrieves the value of a pixel within an image.
The image argument is a pointer to a
PhImage_t
structure that defines the image to be queried,
while the x and y arguments specify the
coordinates of the pixel to be examined.
The value argument points to an area of memory where the result
of the query is stored. The meaning of this value depends on the type
of the image, as follows:
- Pg_IMAGE_DIRECT_1555
Pg_IMAGE_DIRECT_444
Pg_IMAGE_DIRECT_4444
Pg_IMAGE_DIRECT_565
Pg_IMAGE_DIRECT_888
Pg_IMAGE_DIRECT_8888
- A PgColor_t
representing the pixel's color.
- Pg_IMAGE_PALETTE_BYTE
Pg_IMAGE_PALETTE_NIBBLE
- An index into the image's palette (0 - 255 for BYTE palettes,
0 - 15 for NIBBLE palettes).
- Pg_IMAGE_GRADIENT_BYTE
Pg_IMAGE_GRADIENT_NIBBLE
- A number representing the pixel's intensity (0 - 255 for BYTE gradients,
0 - 15 for NIBBLE gradients).
- Pg_BITMAP_BACKFILL
Pg_BITMAP_TRANSPARENT
- 0 or 1 representing the pixel's state.
- 0
- Success.
- -1
- An error occurred because the pixel was out of bounds or the
image type wasn't recognized.
Photon
Safety: | |
Interrupt handler |
No |
Signal handler |
No |
Thread |
No |
PgColor_t,
PhImage_t,
PiGetPixelFromData(),
PiGetPixelRGB(),
PiSetPixel(),
PiSetPixelInData()
“Images”
in the Raw Drawing and Animation chapter of the
Photon Programmer's Guide
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pi/pigetpixel.html on line 166
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pi/pigetpixel.html on line 166