Added a member to swizzle the R and B
[platform/upstream/libSkiaSharp.git] / include / c / sk_pixmap.h
1 /*
2  * Copyright 2017 Xamarin Inc.
3  *
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7
8 // EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
9 // DO NOT USE -- FOR INTERNAL TESTING ONLY
10
11 #ifndef sk_pixmap_DEFINED
12 #define sk_pixmap_DEFINED
13
14 #include "sk_types.h"
15
16 SK_C_PLUS_PLUS_BEGIN_GUARD
17
18 SK_C_API void sk_pixmap_destructor(sk_pixmap_t* cpixmap);
19 SK_C_API sk_pixmap_t* sk_pixmap_new(void);
20 SK_C_API sk_pixmap_t* sk_pixmap_new_with_params(const sk_imageinfo_t* cinfo, const void* addr, size_t rowBytes, sk_colortable_t* ctable);
21 SK_C_API void sk_pixmap_reset(sk_pixmap_t* cpixmap);
22 SK_C_API void sk_pixmap_reset_with_params(sk_pixmap_t* cpixmap, const sk_imageinfo_t* cinfo, const void* addr, size_t rowBytes, sk_colortable_t* ctable);
23 SK_C_API void sk_pixmap_get_info(sk_pixmap_t* cpixmap, sk_imageinfo_t* cinfo);
24 SK_C_API size_t sk_pixmap_get_row_bytes(sk_pixmap_t* cpixmap);
25 SK_C_API const void* sk_pixmap_get_pixels(sk_pixmap_t* cpixmap);
26 SK_C_API sk_colortable_t* sk_pixmap_get_colortable(sk_pixmap_t* cpixmap);
27
28 SK_C_API bool sk_bitmapscaler_resize(const sk_pixmap_t* dst, const sk_pixmap_t* src, sk_bitmapscaler_resizemethod_t method);
29
30 SK_C_API sk_color_t sk_color_unpremultiply(const sk_pmcolor_t pmcolor);
31 SK_C_API sk_pmcolor_t sk_color_premultiply(const sk_color_t color);
32 SK_C_API void sk_color_unpremultiply_array(const sk_pmcolor_t* pmcolors, int size, sk_color_t* colors);
33 SK_C_API void sk_color_premultiply_array(const sk_color_t* colors, int size, sk_pmcolor_t* pmcolors);
34 SK_C_API void sk_color_get_bit_shift(int* a, int* r, int* g, int* b);
35
36 SK_C_API bool sk_pixmap_encode_image(sk_wstream_t* dst, const sk_pixmap_t* src, sk_encoded_image_format_t encoder, int quality);
37
38 SK_C_API bool sk_pixmap_read_pixels(const sk_pixmap_t* cpixmap, const sk_imageinfo_t* dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY);
39
40 SK_C_API void sk_swizzle_swap_rb(uint32_t* dest, const uint32_t* src, int count);
41
42 SK_C_PLUS_PLUS_END_GUARD
43
44 #endif