Bitmap
Category | refcounted |
Type | hime_bitmap_t |
Inherits | Object |
A ref-counted wrapper of SkBitmap.
SkBitmap describes a two-dimensional raster pixel array. SkBitmap is built on SkImageInfo, containing integer width and height, SkColorType and SkAlphaType describing the pixel format, and SkColorSpace describing the range of colors. SkBitmap points to SkPixelRef, which describes the physical array of pixels. SkImageInfo bounds may be located anywhere fully inside SkPixelRef bounds.
Constructors
hime_bitmap_t hime_bitmap_create_empty()
Create an empty bitmap.
Return
hime_bitmap_t
Class methods
hime_bitmap_t hime_bitmap_create_from_jpeg(input, input_size)
Decode the JPEG data contained in input
of length input_size
.
NULL is returned if decoding fails.
Parameters
const unsigned char*
inputsize_t
input_size - Size of input.
Return
hime_bitmap_t
hime_bitmap_t hime_bitmap_create_from_png(input, input_size)
Decode the JPEG data contained in input
of length input_size
.
NULL is returned if decoding fails.
Parameters
const unsigned char*
inputsize_t
input_size - Size of input.
Return
hime_bitmap_t
Methods
bool hime_bitmap_is_empty(self)
Return true if either width or height is zero, or the bitmap contains no pixels.
Parameters
hime_bitmap_const_t
self
Return
bool
hime_size_t hime_bitmap_get_size(self)
Return the pixel counts of row and column.
Parameters
hime_bitmap_const_t
self
Return
hime_size_t
hime_color_t hime_bitmap_get_color(self, position)
Return the pixel at position
as unpremultiplied color.
Parameters
hime_bitmap_const_t
selfhime_point_t
position
Return
hime_color_t