doc change for getAlphaf

Please add this to your CL when you reland.
Thanks!

R=reed@google.com
NOTRY=true
Docs-Preview: https://skia.org/?cl=156007
Bug: skia:
Change-Id: Iba458272d34d2dee412b95baeabaf6eff181e93a
Reviewed-on: https://skia-review.googlesource.com/156007
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Mike Reed <reed@google.com>
This commit is contained in:
Cary Clark 2018-09-20 17:31:43 -04:00 committed by Skia Commit-Bot
parent c25f440d53
commit 8fe2940ae2
4 changed files with 194 additions and 79 deletions

View File

@ -2513,10 +2513,31 @@ Unpremultiplied:
##
##
#SeeAlso getAddr readPixels
#SeeAlso getAlphaf getAddr readPixels
##
#Method float getAlphaf(int x, int y) const
#In Property
#Line # returns Alpha normalized from zero to one ##
Looks up the pixel at (x,y) and return its alpha component, normalized to [0..1].
This is roughly equivalent to #Formula # SkGetColorA(getColor()) ##, but can be more efficent
(and more precise if the pixels store more than 8 bits per component).
#Param x column index, zero or greater, and less than width() ##
#Param y row index, zero or greater, and less than height() ##
#Return alpha converted to normalized float ##
#NoExample
##
#SeeAlso getColor
##
# ------------------------------------------------------------------------------
#Method void* getAddr(int x, int y) const

View File

@ -804,7 +804,27 @@ Unpremultiplied:
##
##
#SeeAlso addr() readPixels
#SeeAlso getAlphaf addr() readPixels
##
#Method float getAlphaf(int x, int y) const
#In Property
#Line # returns Alpha normalized from zero to one ##
Looks up the pixel at (x,y) and return its alpha component, normalized to [0..1].
This is roughly equivalent to #Formula # SkGetColorA(getColor()) ##, but can be more efficent
(and more precise if the pixels store more than 8 bits per component).
#Param x column index, zero or greater, and less than width() ##
#Param y row index, zero or greater, and less than height() ##
#Return alpha converted to normalized float ##
#NoExample
##
#SeeAlso getColor
##

View File

@ -297,158 +297,162 @@ SkBitmap member functions read and modify the structure properties.
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns readable pixel address as 8-bit pointer</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getAlphaf'>getAlphaf</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkColor_Reference#Alpha'>Alpha</a> normalized from zero to one</td>
</tr>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getBounds'>getBounds</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkBitmap_width'>width</a> and <a href='#SkBitmap_height'>height</a> as Rectangle</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getColor'>getColor</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns one pixel as <a href='undocumented#Unpremultiply'>Unpremultiplied</a> <a href='SkColor_Reference#Color'>Color</a></td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getGenerationID'>getGenerationID</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns unique ID</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getPixels'>getPixels</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns address of pixels</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getSubset'>getSubset</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds offset by origin</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_hasHardwareMipMap'>hasHardwareMipMap</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Mip_Map'>Mip Map</a> support present; Android only</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_height'>height</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel row count</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_info'>info</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkImageInfo_Reference#Image_Info'>Image Info</a></td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_installPixels'>installPixels</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>creates <a href='undocumented#Pixel_Ref'>Pixel Ref</a>, with optional release function</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_isImmutable'>isImmutable</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if pixels will not change</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_isNull'>isNull</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='undocumented#Pixel_Ref'>Pixel Ref</a> is nullptr</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_isOpaque'>isOpaque</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> describes opaque pixels</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_isVolatile'>isVolatile</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if pixels should not be cached</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_notifyPixelsChanged'>notifyPixelsChanged</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>marks pixels as changed, altering the unique ID</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_peekPixels'>peekPixels</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkPixmap_Reference#Pixmap'>Pixmap</a> if possible</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_pixelRef'>pixelRef</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Pixel_Ref'>Pixel Ref</a>, or nullptr</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_pixelRefOrigin'>pixelRefOrigin</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns offset within <a href='undocumented#Pixel_Ref'>Pixel Ref</a></td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_pixmap'>pixmap</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkPixmap_Reference#Pixmap'>Pixmap</a></td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_readPixels'>readPixels</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies and converts pixels</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_readyToDraw'>readyToDraw</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if address of pixels is not nullptr</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_refColorSpace'>refColorSpace</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> <a href='undocumented#Color_Space'>Color Space</a></td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_reset'>reset</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets to default values, releases pixel ownership</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_rowBytes'>rowBytes</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns interval between rows in bytes</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_rowBytesAsPixels'>rowBytesAsPixels</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns interval between rows in pixels</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_setAlphaType'>setAlphaType</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='SkImageInfo_Reference#Alpha_Type'>Alpha Type</a> of shared pixels</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_setHasHardwareMipMap'>setHasHardwareMipMap</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='undocumented#Mip_Map'>Mip Map</a> support present; Android only</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_setImmutable'>setImmutable</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>marks that pixels will not change</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_setInfo'>setInfo</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets height, width, <a href='SkImageInfo_Reference#Color_Type'>Color Type</a>, and so on, releasing pixels</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_setIsVolatile'>setIsVolatile</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>marks if pixels should not be cached</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_setPixelRef'>setPixelRef</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='undocumented#Pixel_Ref'>Pixel Ref</a> and offset</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_setPixels'>setPixels</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='undocumented#Pixel_Ref'>Pixel Ref</a> without an offset</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_shiftPerPixel'>shiftPerPixel</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bit shift from pixels to bytes</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_swap'>swap</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>exchanges <a href='#Bitmap'>Bitmap</a> pair</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_tryAllocN32Pixels'>tryAllocN32Pixels</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>allocates compatible ARGB pixels if possible</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_tryAllocPixels'>tryAllocPixels</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>allocates pixels from <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> if possible</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_tryAllocPixelsFlags'>tryAllocPixelsFlags</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>allocates pixels from <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> with options if possible</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_validate'>validate</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>asserts if <a href='#Bitmap'>Bitmap</a> is invalid (debug only)</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_width'>width</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel column count</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_writePixels'>writePixels</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies and converts pixels</td>
</tr>
@ -882,86 +886,90 @@ two width:1 height:1 colorType:kRGBA_8888_SkColorType alphaType:kOpaque_SkAlphaT
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns readable pixel address as 8-bit pointer</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getAlphaf'>getAlphaf</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkColor_Reference#Alpha'>Alpha</a> normalized from zero to one</td>
</tr>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getBounds'>getBounds</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='#SkBitmap_width'>width</a> and <a href='#SkBitmap_height'>height</a> as Rectangle</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getBounds'>getBounds(SkRect* bounds)</a> const</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getBounds_2'>getBounds(SkIRect* bounds)</a> const</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getColor'>getColor</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns one pixel as <a href='undocumented#Unpremultiply'>Unpremultiplied</a> <a href='SkColor_Reference#Color'>Color</a></td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getPixels'>getPixels</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns address of pixels</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_getSubset'>getSubset</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bounds offset by origin</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_hasHardwareMipMap'>hasHardwareMipMap</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Mip_Map'>Mip Map</a> support present; Android only</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_height'>height</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel row count</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_info'>info</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkImageInfo_Reference#Image_Info'>Image Info</a></td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_isImmutable'>isImmutable</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if pixels will not change</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_isNull'>isNull</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='undocumented#Pixel_Ref'>Pixel Ref</a> is nullptr</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_isOpaque'>isOpaque</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> describes opaque pixels</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_isVolatile'>isVolatile</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if pixels should not be cached</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_pixelRef'>pixelRef</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='undocumented#Pixel_Ref'>Pixel Ref</a>, or nullptr</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_pixelRefOrigin'>pixelRefOrigin</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns offset within <a href='undocumented#Pixel_Ref'>Pixel Ref</a></td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_pixmap'>pixmap</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkPixmap_Reference#Pixmap'>Pixmap</a></td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_refColorSpace'>refColorSpace</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> <a href='undocumented#Color_Space'>Color Space</a></td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_rowBytes'>rowBytes</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns interval between rows in bytes</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_rowBytesAsPixels'>rowBytesAsPixels</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns interval between rows in pixels</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_shiftPerPixel'>shiftPerPixel</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bit shift from pixels to bytes</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkBitmap_width'>width</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel column count</td>
</tr>
@ -3320,7 +3328,38 @@ Unpremultiplied:
### See Also
<a href='#SkBitmap_getAddr'>getAddr</a> <a href='#SkBitmap_readPixels'>readPixels</a><sup><a href='#SkBitmap_readPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_readPixels_3'>[3]</a></sup>
<a href='#SkBitmap_getAlphaf'>getAlphaf</a> <a href='#SkBitmap_getAddr'>getAddr</a> <a href='#SkBitmap_readPixels'>readPixels</a><sup><a href='#SkBitmap_readPixels_2'>[2]</a></sup><sup><a href='#SkBitmap_readPixels_3'>[3]</a></sup>
---
<a name='SkBitmap_getAlphaf'></a>
## getAlphaf
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
float <a href='#SkBitmap_getAlphaf'>getAlphaf</a>(int x, int y) const
</pre>
Looks up the pixel at (<a href='#SkBitmap_getAlphaf_x'>x</a>,<a href='#SkBitmap_getAlphaf_y'>y</a>) and return its alpha component, normalized to [0..1].
This is roughly equivalent to <code>SkGetColorA(getColor()\)</code>, but can be more efficent
(and more precise if the pixels store more than 8 bits per component).
### Parameters
<table> <tr> <td><a name='SkBitmap_getAlphaf_x'><code><strong>x</strong></code></a></td>
<td>column index, zero or greater, and less than <a href='#SkBitmap_width'>width</a></td>
</tr>
<tr> <td><a name='SkBitmap_getAlphaf_y'><code><strong>y</strong></code></a></td>
<td>row index, zero or greater, and less than <a href='#SkBitmap_height'>height</a></td>
</tr>
</table>
### Return Value
alpha converted to normalized float
### See Also
<a href='#SkBitmap_getColor'>getColor</a>
---

View File

@ -149,74 +149,78 @@ SkPixmap member functions read and modify the structure properties.
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets pointer to portion of original</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_getAlphaf'>getAlphaf</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkColor_Reference#Alpha'>Alpha</a> normalized from zero to one</td>
</tr>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_getColor'>getColor</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns one pixel as <a href='undocumented#Unpremultiply'>Unpremultiplied</a> <a href='SkColor_Reference#Color'>Color</a></td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_height'>height</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel row count</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_info'>info</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns <a href='SkImageInfo_Reference#Image_Info'>Image Info</a></td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_isOpaque'>isOpaque</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns true if <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> describes opaque pixels</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_readPixels'>readPixels</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>copies and converts pixels</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_reset'>reset</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>reuses existing <a href='#Pixmap'>Pixmap</a> with replacement values</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_rowBytes'>rowBytes</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns interval between rows in bytes</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_rowBytesAsPixels'>rowBytesAsPixels</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns interval between rows in pixels</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_scalePixels'>scalePixels</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>scales and converts pixels</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_setColorSpace'>setColorSpace</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>sets <a href='SkImageInfo_Reference#Image_Info'>Image Info</a> <a href='undocumented#Color_Space'>Color Space</a></td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_shiftPerPixel'>shiftPerPixel</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns bit shift from pixels to bytes</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_width'>width</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns pixel column count</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_writable_addr'>writable addr</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns writable pixel address as void pointer</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_writable_addr16'>writable addr16</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns writable pixel address as 16-bit pointer</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_writable_addr32'>writable addr32</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns writable pixel address as 32-bit pointer</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_writable_addr64'>writable addr64</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns writable pixel address as 64-bit pointer</td>
</tr>
<tr style='background-color: #f0f0f0; '>
<tr>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_writable_addr8'>writable addr8</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns writable pixel address as 8-bit pointer</td>
</tr>
<tr>
<tr style='background-color: #f0f0f0; '>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a href='#SkPixmap_writable_addrF16'>writable addrF16</a></td>
<td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>returns writable pixel component address as 16-bit pointer</td>
</tr>
@ -1035,7 +1039,38 @@ Unpremultiplied:
### See Also
<a href='#SkPixmap_addr'>addr</a><sup><a href='#SkPixmap_addr_2'>[2]</a></sup> <a href='#SkPixmap_readPixels'>readPixels</a><sup><a href='#SkPixmap_readPixels_2'>[2]</a></sup><sup><a href='#SkPixmap_readPixels_3'>[3]</a></sup><sup><a href='#SkPixmap_readPixels_4'>[4]</a></sup>
<a href='#SkPixmap_getAlphaf'>getAlphaf</a> <a href='#SkPixmap_addr'>addr</a><sup><a href='#SkPixmap_addr_2'>[2]</a></sup> <a href='#SkPixmap_readPixels'>readPixels</a><sup><a href='#SkPixmap_readPixels_2'>[2]</a></sup><sup><a href='#SkPixmap_readPixels_3'>[3]</a></sup><sup><a href='#SkPixmap_readPixels_4'>[4]</a></sup>
---
<a name='SkPixmap_getAlphaf'></a>
## getAlphaf
<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
float <a href='#SkPixmap_getAlphaf'>getAlphaf</a>(int x, int y) const
</pre>
Looks up the pixel at (<a href='#SkPixmap_getAlphaf_x'>x</a>,<a href='#SkPixmap_getAlphaf_y'>y</a>) and return its alpha component, normalized to [0..1].
This is roughly equivalent to <code>SkGetColorA(getColor()\)</code>, but can be more efficent
(and more precise if the pixels store more than 8 bits per component).
### Parameters
<table> <tr> <td><a name='SkPixmap_getAlphaf_x'><code><strong>x</strong></code></a></td>
<td>column index, zero or greater, and less than <a href='#SkPixmap_width'>width</a></td>
</tr>
<tr> <td><a name='SkPixmap_getAlphaf_y'><code><strong>y</strong></code></a></td>
<td>row index, zero or greater, and less than <a href='#SkPixmap_height'>height</a></td>
</tr>
</table>
### Return Value
alpha converted to normalized float
### See Also
<a href='#SkPixmap_getColor'>getColor</a>
---