9 #ifndef RAMSES_RAMSES_UTILS_H
10 #define RAMSES_RAMSES_UTILS_H
32 struct CubeMipLevelData;
109 static bool SaveImageBufferToPng(
const std::string& filePath,
const std::vector<uint8_t>& imageData, uint32_t width, uint32_t height);
128 static bool SaveImageBufferToPng(
const std::string& filePath, std::vector<uint8_t>& imageData, uint32_t width, uint32_t height,
bool flipImageBufferVertically);
210 static Scene* LoadSceneFromMemory(
RamsesClient& client, std::unique_ptr<
unsigned char[]> data,
size_t size,
bool localOnly);
215 std::unique_ptr<
unsigned char[], void(*)(
const unsigned char*)> dataWithDeleter(data.release(), [](
const unsigned char* ptr) {
delete[] ptr; });
#define RAMSES_API
Definition: APIExport.h:35
The DataVector2f data object stores a vector with 2 float components within a scene.
Definition: DataVector2f.h:22
The DataVector4f data object stores a vector with 4 float components within a scene.
Definition: DataVector4f.h:22
The Node is the base class of all nodes and provides scene graph functionality which propagates to it...
Definition: Node.h:23
Entry point of RAMSES client API.
Definition: RamsesClient.h:34
Scene * loadSceneFromMemory(std::unique_ptr< unsigned char[], void(*)(const unsigned char *)> data, size_t size, bool localOnly=false)
Loads scene contents and resources from a memory buffer.
The RamsesObject is a base class for all client API objects owned by the framework.
Definition: RamsesObject.h:21
Temporary functions for convenience. All of these can be implemented on top of the RAMSES Client API,...
Definition: ramses-utils.h:39
static const T * TryConvert(const RamsesObject &obj)
Converts object to a compatible object type. Object can be converted to any of its base classes....
static void DeleteGeneratedMipMaps(CubeMipLevelData *&data, uint32_t mipMapCount)
Deletes mip map data created with RamsesUtils::GenerateMipMapsTextureCube.
static bool SaveImageBufferToPng(const std::string &filePath, std::vector< uint8_t > &imageData, uint32_t width, uint32_t height, bool flipImageBufferVertically)
Creates a png from image data, e.g. data generated by RamsesClientService::readPixels....
static void DeleteGeneratedMipMaps(MipLevelData *&data, uint32_t mipMapCount)
Deletes mip map data created with RamsesUtils::GenerateMipMapsTexture2D.
static Texture2D * CreateTextureResourceFromPngBuffer(const std::vector< unsigned char > &pngData, Scene &scene, const TextureSwizzle &swizzle={}, const char *name=nullptr)
Creates a Texture from the given png memory buffer.
static T * TryConvert(RamsesObject &obj)
Converts object to a compatible object type. Object can be converted to any of its base classes....
static CubeMipLevelData * GenerateMipMapsTextureCube(uint32_t faceWidth, uint32_t faceHeight, uint8_t bytesPerPixel, uint8_t *data, uint32_t &mipMapCount)
Generate mip maps from original texture cube data. You obtain ownership of all the data returned in t...
static Scene * LoadSceneFromMemory(RamsesClient &client, std::unique_ptr< unsigned char[]> data, size_t size, bool localOnly)
Convenience wrapper for RamsesClient::loadSceneFromMemory with automatic deleter.
Definition: ramses-utils.h:213
static MipLevelData * GenerateMipMapsTexture2D(uint32_t width, uint32_t height, uint8_t bytesPerPixel, uint8_t *data, uint32_t &mipMapCount)
Generate mip maps from original texture 2D data. You obtain ownership of all the data returned in the...
static bool SetPerspectiveCameraFrustumToDataObjects(float fov, float aspectRatio, float nearPlane, float farPlane, DataVector4f &frustumPlanesData, DataVector2f &nearFarPlanesData)
Convenience method to set perspective camera frustum using FOV and aspect ratio (like in ramses::Pers...
static bool SaveImageBufferToPng(const std::string &filePath, const std::vector< uint8_t > &imageData, uint32_t width, uint32_t height)
Creates a png from image data, e.g. data generated by RamsesClientService::readPixels....
static Texture2D * CreateTextureResourceFromPng(const char *pngFilePath, Scene &scene, const TextureSwizzle &swizzle={}, const char *name=nullptr)
Creates a Texture from the given png file.
static nodeId_t GetNodeId(const Node &node)
Returns the identifier of a node, which is printed in the renderer logs. The identifier is guaranteed...
The Scene holds a scene graph. It is the essential class for distributing content to the ramses syste...
Definition: Scene.h:83
Helper class to create strongly typed values out of various types.
Definition: StronglyTypedValue.h:23
Texture represents a 2-D texture resource.
Definition: Texture2D.h:24
The RAMSES namespace contains all client side objects and functions used to implement RAMSES applicat...
Definition: AnimatedProperty.h:15
Struct containing information about one mip-map level of a cube texture. All faces of the cube textur...
Definition: MipLevelData.h:60
Struct containing information about one mip-map level of a texture.
Definition: MipLevelData.h:24
Information of how color channels of a texture are reordered or set to fixed value (one,...
Definition: TextureSwizzle.h:23