FormIt C++ API
v23.0.0 (2023.0.0)
|
Classes | |
class | FormIt::Utils::UtilsImage |
FormIt::Utils::UtilsImage class. More... | |
struct | FormIt::Utils::Span< T > |
Provides a "view" into a container/array. More... | |
Functions | |
Guid | FormIt::Utils::NewGuid () |
NewGuid() function. More... | |
Guid | FormIt::Utils::GuidFromString (const 1::string &str) |
GuidFromString() function. More... | |
::string | FormIt::Utils::GuidToHexString (const Guid &guid) |
GuidToHexString() function. More... | |
FORMIT_CORE_EXPORT::string | FormIt::Utils::CreateTextureFileFromData (const 1::vector< char > &data, const 1::string &fileName, bool bForceRemake=false) |
Create the texture cache file from a texture's bit data. More... | |
FORMIT_CORE_EXPORT::shared_ptr< FormIt::Utils::UtilsImage > | FormIt::Utils::LoadImageData (const 1::string &aRootFolder, const 1::string &filename, bool swapredblue=false, bool flip=false) |
Create an Image object from an input file (JPEG or PNG) More... | |
FORMIT_CORE_EXPORT::shared_ptr< FormIt::Utils::UtilsImage > | FormIt::Utils::DecodeImage (unsigned char *data, int size, bool swapredblue=false, bool flip=false) |
Create an Image object from input image data (JPEG or PNG format) More... | |
FORMIT_CORE_EXPORT::vector< unsigned char > | FormIt::Utils::EncodeImagePNG (1::vector< unsigned char > &imgData, size_t width, size_t height, size_t bytesPerPixel) |
Create PNG formatted data from raw rgb (bytesPerPixel == 3) or rgba (bytesPerPixel == 4) pixel data. More... | |
FORMIT_CORE_EXPORT::vector< char > | FormIt::Utils::EncodeImageJPG (unsigned char *imageData, size_t image_width, size_t image_height, size_t bytesPerPixel, bool encodeAlphaOnly, int quality=80) |
Create JPG formatted data from raw rgb (bytesPerPixel == 3) or rgba (bytesPerPixel == 4) pixel data. More... | |
FORMIT_CORE_EXPORT ::string FormIt::Utils::CreateTextureFileFromData | ( | const 1::vector< char > & | data, |
const 1::string & | fileName, | ||
bool | bForceRemake = false |
||
) |
Create the texture cache file from a texture's bit data.
It is assumed that the data is in png or jpg format
[in] | data | |
[in] | fileName | |
[in] | bForceRemake |
FORMIT_CORE_EXPORT ::shared_ptr<FormIt::Utils::UtilsImage> FormIt::Utils::DecodeImage | ( | unsigned char * | data, |
int | size, | ||
bool | swapredblue = false , |
||
bool | flip = false |
||
) |
Create an Image object from input image data (JPEG or PNG format)
[out] | data | |
[in] | size | |
[in] | swapredblue | |
[in] | flip |
FORMIT_CORE_EXPORT ::vector<char> FormIt::Utils::EncodeImageJPG | ( | unsigned char * | imageData, |
size_t | image_width, | ||
size_t | image_height, | ||
size_t | bytesPerPixel, | ||
bool | encodeAlphaOnly, | ||
int | quality = 80 |
||
) |
Create JPG formatted data from raw rgb (bytesPerPixel == 3) or rgba (bytesPerPixel == 4) pixel data.
jpg quality 0 ... 100
imageData | Vector of R,G,B or R,G,B-A order data |
image_width | Number of columns in image |
image_height | Number of rows in image |
bytesPerPixel | should be 3 (RGB) or 4 (RGBA) |
encodeAlphaOnly | if true, the alpha channel of the input will be used to create a grayscale jpg |
quality | assuming there is an alpha channel. Otherwise the RGB channels will be used |
FORMIT_CORE_EXPORT ::vector<unsigned char> FormIt::Utils::EncodeImagePNG | ( | 1::vector< unsigned char > & | imgData, |
size_t | width, | ||
size_t | height, | ||
size_t | bytesPerPixel | ||
) |
Create PNG formatted data from raw rgb (bytesPerPixel == 3) or rgba (bytesPerPixel == 4) pixel data.
[out] | imgData | |
[in] | width | |
[in] | height | |
[in] | bytesPerPixel |
Guid FormIt::Utils::GuidFromString | ( | const 1::string & | str | ) |
GuidFromString() function.
[in] | str |
::string FormIt::Utils::GuidToHexString | ( | const Guid & | guid | ) |
GuidToHexString() function.
[in] | guid |
FORMIT_CORE_EXPORT ::shared_ptr<FormIt::Utils::UtilsImage> FormIt::Utils::LoadImageData | ( | const 1::string & | aRootFolder, |
const 1::string & | filename, | ||
bool | swapredblue = false , |
||
bool | flip = false |
||
) |
Create an Image object from an input file (JPEG or PNG)
[in] | aRootFolder | |
[in] | filename | |
[in] | swapredblue | |
[in] | flip |
Guid FormIt::Utils::NewGuid | ( | ) |
NewGuid() function.