Add mask color for c_bitmap

This commit is contained in:
idea4good
2019-02-20 12:55:27 +08:00
parent 3d58ef1c3f
commit 7ebae0b87e
6 changed files with 70 additions and 68 deletions

View File

@@ -1,16 +1,17 @@
#ifndef BITMAP_UNIT_H
#define BITMAP_UNIT_H
#define DEFAULT_MASK_COLOR 0xFF080408
class c_surface;
class c_bitmap
{
public:
static void draw_bitmap(c_surface* surface, int z_order, const BITMAP_INFO *pBitmap, int x, int y);
static void draw_bitmap_in_rect(c_surface* surface, int z_order, const BITMAP_INFO *pBitmap, c_rect rect, unsigned int align_type);
static void draw_bitmap(c_surface* surface, int z_order, const BITMAP_INFO *pBitmap, int x, int y, unsigned int mask_rgb = DEFAULT_MASK_COLOR);
static void draw_bitmap_in_rect(c_surface* surface, int z_order, const BITMAP_INFO *pBitmap, c_rect rect, unsigned int align_type, unsigned int mask_rgb = DEFAULT_MASK_COLOR);
private:
static void draw_bitmap_565(c_surface* surface, int z_order, int x, int y, int xsize, int ysize, const unsigned char* pPixel);
static void draw_bitmap_565(c_surface* surface, int z_order, int x, int y, int xsize, int ysize, const unsigned char* pPixel, unsigned int mask_color);
static void get_bitmap_pos(const BITMAP_INFO *pBitmap, c_rect rect, unsigned int align_type, int &x, int &y);
static void draw_bitmap_565_in_rect(c_surface* surface, int z_order, int x, int y, int width, int height, int xsize, int ysize, const unsigned char* pPixel);
static void draw_bitmap_565_in_rect(c_surface* surface, int z_order, int x, int y, int width, int height, int xsize, int ysize, const unsigned char* pPixel, unsigned int mask_color);
c_bitmap(){}
c_bitmap(const c_bitmap&);