< index < 5. Image toolkit |
===================================== |
C++ : TCODColor TCODImage::getPixel(int x, int y) const C : TCOD_color_t TCOD_image_get_pixel(TCOD_image_t image,int x, int y) Py : image_get_pixel(image, x, y)
Parameter | Description |
---|---|
image | In the C and python version, the image handler, obtained with the load function. |
x,y | The pixel coordinates inside the image. 0 <= x < width 0 <= y < height |
C++ : TCODImage *pix = new TCODImage(80,50); TCODColor col=pix->getPixel(40,25); C : TCOD_image_t pix = TCOD_image_new(80,50); TCOD_color_t col=TCOD_image_get_pixel(pix,40,25); Py : pix = litbcod.image_new(80,50) col=litbcod.image_get_pixel(pix,40,25)
C++ : int TCODImage::getAlpha(int x,int y) const C : int TCOD_image_get_alpha(TCOD_image_t image,int x, int y) Py : image_get_alpha(image, x, y)This function returns a value between 0 (transparent pixel) and 255 (opaque pixel).
Parameter | Description |
---|---|
image | In the C and python version, the image handler, obtained with the load function. |
x,y | The pixel coordinates inside the image. 0 <= x < width 0 <= y < height |
C++ : int alpha=pix->getAlpha(40,25); C : int alpha=TCOD_image_get_alpha(pix,40,25); Py : alpha=litbcod.image_get_alpha(pix,40,25)
C++ : bool TCODImage::isPixelTransparent(int x,int y) const C : bool TCOD_image_is_pixel_transparent(TCOD_image_t image,int x, int y) Py : image_is_pixel_transparent(image, x, y)
Parameter | Description |
---|---|
image | In the C and python version, the image handler, obtained with the load function. |
x,y | The pixel coordinates inside the image. 0 <= x < width 0 <= y < height |
C++ : bool transparent=pix->isPixelTransparent(40,25); C : bool transparent=TCOD_image_is_pixel_transparent(pix,40,25); Py : transparent=litbcod.image_is_pixel_transparent(pix,40,25)