DDraceNetwork Docs
image_manipulation.h
Go to the documentation of this file.
1#ifndef ENGINE_GFX_IMAGE_MANIPULATION_H
2#define ENGINE_GFX_IMAGE_MANIPULATION_H
3
4#include <engine/image.h>
5
6#include <cstdint>
7
8// Destination must have appropriate size for RGBA data
9bool ConvertToRgba(uint8_t *pDest, const CImageInfo &SourceImage);
10// Allocates appropriate buffer with malloc, must be freed by caller
11bool ConvertToRgbaAlloc(uint8_t *&pDest, const CImageInfo &SourceImage);
12// Replaces existing image data with RGBA data (unless already RGBA)
13bool ConvertToRgba(CImageInfo &Image);
14
15// Changes the image data (not the format)
16void ConvertToGrayscale(const CImageInfo &Image);
17
18// These functions assume that the image data is 4 bytes per pixel RGBA
19void DilateImage(uint8_t *pImageBuff, int w, int h);
20void DilateImage(const CImageInfo &Image);
21void DilateImageSub(uint8_t *pImageBuff, int w, int h, int x, int y, int SubWidth, int SubHeight);
22
23// Returned buffer is allocated with malloc, must be freed by caller
24uint8_t *ResizeImage(const uint8_t *pImageData, int Width, int Height, int NewWidth, int NewHeight, int BPP);
25// Replaces existing image data with resized buffer
26void ResizeImage(CImageInfo &Image, int NewWidth, int NewHeight);
27
28int HighestBit(int OfVar);
29
30#endif // ENGINE_GFX_IMAGE_MANIPULATION_H
Definition: image.h:12
uint8_t * ResizeImage(const uint8_t *pImageData, int Width, int Height, int NewWidth, int NewHeight, int BPP)
Definition: image_manipulation.cpp:264
void DilateImageSub(uint8_t *pImageBuff, int w, int h, int x, int y, int SubWidth, int SubHeight)
Definition: image_manipulation.cpp:160
void ConvertToGrayscale(const CImageInfo &Image)
Definition: image_manipulation.cpp:71
bool ConvertToRgba(uint8_t *pDest, const CImageInfo &SourceImage)
Definition: image_manipulation.cpp:6
bool ConvertToRgbaAlloc(uint8_t *&pDest, const CImageInfo &SourceImage)
Definition: image_manipulation.cpp:52
void DilateImage(uint8_t *pImageBuff, int w, int h)
Definition: image_manipulation.cpp:149
int HighestBit(int OfVar)
Definition: image_manipulation.cpp:280