mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-05 07:45:59 +02:00
Initial checkin
This commit is contained in:
parent
c74712dad9
commit
078564ac9e
3242 changed files with 1616395 additions and 0 deletions
51
BeefySysLib/img/ImageUtils.h
Normal file
51
BeefySysLib/img/ImageUtils.h
Normal file
|
@ -0,0 +1,51 @@
|
|||
#pragma once
|
||||
|
||||
#include "Common.h"
|
||||
|
||||
NS_BF_BEGIN;
|
||||
|
||||
class ImageData;
|
||||
|
||||
struct PackedColor
|
||||
{
|
||||
uint8 r;
|
||||
uint8 g;
|
||||
uint8 b;
|
||||
uint8 a;
|
||||
};
|
||||
|
||||
class PackedColorGetR
|
||||
{
|
||||
public:
|
||||
int operator()(PackedColor color) { return color.r; }
|
||||
};
|
||||
|
||||
class PackedColorGetG
|
||||
{
|
||||
public:
|
||||
int operator()(PackedColor color) { return color.g; }
|
||||
};
|
||||
|
||||
class PackedColorGetB
|
||||
{
|
||||
public:
|
||||
int operator()(PackedColor color) { return color.b; }
|
||||
};
|
||||
|
||||
class PackedColorGetGray
|
||||
{
|
||||
public:
|
||||
int operator()(PackedColor color) { return ((color.r * 300) + (color.g * 586) + (color.b * 113)) / 1000; }
|
||||
};
|
||||
|
||||
ImageData* CreateResizedImageUnion(ImageData* src, int x, int y, int width, int height);
|
||||
ImageData* CreateEmptyResizedImageUnion(ImageData* src, int x, int y, int width, int height);
|
||||
void CrossfadeImage(ImageData* origImage, ImageData* newImage, float opacity);
|
||||
void BlendImage(ImageData* dest, ImageData* src, int destX, int destY, float alpha = 1.0f, int mixType = 'Nrml', bool fullAlpha = false);
|
||||
void BlendImagesTogether(ImageData* bottomImage, ImageData* topImage, ImageData* alphaImage);
|
||||
void SetImageAlpha(ImageData* image, ImageData* alphaImage);
|
||||
void MultiplyImageAlpha(ImageData* image, ImageData* alphaImage);
|
||||
void SetImageAlpha(ImageData* image, int alpha);
|
||||
void CopyImageBits(ImageData* dest, ImageData* src);
|
||||
|
||||
NS_BF_END;
|
Loading…
Add table
Add a link
Reference in a new issue