summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorculler <culler>2021-05-01 21:37:00 (GMT)
committerculler <culler>2021-05-01 21:37:00 (GMT)
commit3c4f9f531b94668f572cf0ca3de704edfcd81055 (patch)
tree63eb2ea7ae5dba7ac747d476e2cde3a40edbf16d
parent1a692b15205d5c7f4480dfee96ab812ec8bfc800 (diff)
downloadtk-3c4f9f531b94668f572cf0ca3de704edfcd81055.zip
tk-3c4f9f531b94668f572cf0ca3de704edfcd81055.tar.gz
tk-3c4f9f531b94668f572cf0ca3de704edfcd81055.tar.bz2
Edit comments. Use uint32_t since Apple documentation specifies that type for kCGImageAlphaLast etc.
-rw-r--r--macosx/tkMacOSXImage.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/macosx/tkMacOSXImage.c b/macosx/tkMacOSXImage.c
index 85b109d..410e38e 100644
--- a/macosx/tkMacOSXImage.c
+++ b/macosx/tkMacOSXImage.c
@@ -391,14 +391,25 @@ XCreateImage(
/*
*----------------------------------------------------------------------
*
- * TkPutImage, XPutImage --
- *
- * Copies a rectangular subimage of an XImage into a drawable. Currently
- * this is only called by TkImgPhotoDisplay, using a Window as the
- * drawable.
+ * TkPutImage, XPutImage, TkpPutRGBAImage --
+ *
+ * These functions, which all have the same signature, copy a rectangular
+ * subimage of an XImage into a drawable. The first two are identical on
+ * macOS. They assume that the XImage data has the structure of a 32bpp
+ * ZPixmap in which the image data is an array of 32bit integers packed
+ * with 8 bit values for the Red Green and Blue channels. They ignore the
+ * fourth byte. The function TkpPutRGBAImage assumes that the XImage data
+ * has been extended by using the fourth byte to store an 8-bit Alpha
+ * value. (The Alpha data is assumed not to pre-multiplied). The image
+ * is then drawn into the drawable using standard Porter-Duff Source Atop
+ * Composition (kCGBlendModeSourceAtop in Apple's Core Graphics).
+ *
+ * The TkpPutRGBAfunction is used by TkImgPhotoDisplay to render photo
+ * images if the compile-time variable TK_CAN_RENDER_RGBA is defined in
+ * a platform's tkXXXXPort.h header, as is the case for the macOS Aqua port.
*
* Results:
- * None.
+ * These functions always return Success.
*
* Side effects:
* Draws the image on the specified drawable.
@@ -413,7 +424,7 @@ XCreateImage(
static int
TkMacOSXPutImage(
- uint32 pixelFormat,
+ uint32_t pixelFormat,
Display* display, /* Display. */
Drawable drawable, /* Drawable to place image on. */
GC gc, /* GC to use. */