28#ifndef AGS_SHARED_GFX_BITMAP_H
29#define AGS_SHARED_GFX_BITMAP_H
31#include "ags/shared/gfx/gfx_def.h"
32#include "ags/shared/util/geometry.h"
33#include "ags/shared/util/string.h"
40enum BitmapMaskOption {
51#include "ags/shared/gfx/allegro_bitmap.h"
60namespace BitmapHelper {
68Bitmap *CreateBitmap(
int width,
int height,
int color_depth = 0);
70Bitmap *CreateClearBitmap(
int width,
int height,
int color_depth = 0,
int clear_color = 0);
72Bitmap *CreateTransparentBitmap(
int width,
int height,
int color_depth = 0);
76Bitmap *CreateSubBitmap(Bitmap *src,
const Rect &rc);
79Bitmap *CreateBitmapCopy(Bitmap *src,
int color_depth = 0);
82Bitmap *LoadFromFile(
const char *filename);
83inline Bitmap *LoadFromFile(
const String &filename) {
84 return LoadFromFile(filename.GetCStr());
86Bitmap *LoadFromFile(PACKFILE *pf);
90Bitmap *AdjustBitmapSize(Bitmap *src,
int width,
int height);
92void MakeOpaque(Bitmap *bmp);
95void MakeOpaqueSkipMask(Bitmap *bmp);
97void ReplaceAlphaWithRGBMask(Bitmap *bmp);
102void CopyTransparency(Bitmap *dst,
const Bitmap *mask,
bool dst_has_alpha,
bool mask_has_alpha);
107void ReadPixelsFromMemory(Bitmap *dst,
const uint8_t *src_buffer,
const size_t src_pitch,
const size_t src_px_offset = 0);