Base APIs

Platform integration utilities.

Files

file umbra_defs.h
Common definitions across all Umbra APIs.

Classes

struct UmbraAllocator
User provided memory management interface.
struct UmbraLogger
User provided logging interface.
struct UmbraInputStream
User provided input stream interface.
struct UmbraOutputStream
User provided output stream interface.
struct UmbraHttp
User provided HTTP implementation.
struct UmbraConfig
Opaque Umbra configuration struct.
struct UmbraFloat2
Two floats.
struct UmbraFloat3
Three floats.
struct UmbraFloat3_3
A 3x3 matrix of floats.
struct UmbraFloat3MinMax
A single precision, min-max representation of an axis-aligned bounding box.
struct UmbraFloat4
Four floats.
struct UmbraFloat4_4
A 4x4 matrix of floats.
struct UmbraDouble2
Two doubles.
struct UmbraDouble3
Three doubles.
struct UmbraDouble3_3
A 3x3 matrix of doubles.
struct UmbraDouble3MinMax
A double precision, min-max representation of an axis-aligned bounding box.
struct UmbraDouble4
Four doubles.
struct UmbraDouble4_4
A 4x4 matrix of doubles.
struct UmbraInt2
Two 32-bit integers.
struct UmbraInt3
Three 32-bit integers.
struct UmbraRGBA
Four 8-bit unsigned integer color values.

Enums

enum UmbraLogLevel { UmbraLogLevel_Debug = 0, UmbraLogLevel_Info, UmbraLogLevel_Warning, UmbraLogLevel_Error }
Log levels.
enum UmbraMatrixFormat { UmbraMatrixFormat_ColumnMajor = 0, UmbraMatrixFormat_RowMajor = 1 }
Row or column major matrix format.
enum UmbraTextureType { UmbraTextureType_Diffuse = 0, UmbraTextureType_Normal, UmbraTextureType_Specular, UmbraTextureType_MetaIndex }
Texture type.
enum UmbraTextureFormat { UmbraTextureFormat_RGBA32 = 0, UmbraTextureFormat_RGB24 = 1, UmbraTextureFormat_BC1 = 2, UmbraTextureFormat_BC3 = 3, UmbraTextureFormat_BC4 = 4, UmbraTextureFormat_BC5 = 5, UmbraTextureFormat_ETC1_RGB = 6, UmbraTextureFormat_RGBA_FLOAT32 = 7, UmbraTextureFormat_UNC1 = 8 deprecated, UmbraTextureFormat_JPEG = 9, UmbraTextureFormat_PNG = 10, UmbraTextureFormat_BMP = 11, UmbraTextureFormat_PSD = 12, UmbraTextureFormat_TGA = 13, UmbraTextureFormat_GIF = 14, UmbraTextureFormat_HDR = 15, UmbraTextureFormat_PIC = 16, UmbraTextureFormat_PNM = 17, UmbraTextureFormat_ASTC_4X4 = 18, UmbraTextureFormat_ASTC_5X4 = 19, UmbraTextureFormat_ASTC_5X5 = 20, UmbraTextureFormat_ASTC_6X5 = 21, UmbraTextureFormat_ASTC_6X6 = 22, UmbraTextureFormat_ASTC_8X5 = 23, UmbraTextureFormat_ASTC_8X6 = 24, UmbraTextureFormat_ASTC_10X5 = 25, UmbraTextureFormat_ASTC_10X6 = 26, UmbraTextureFormat_ASTC_8X8 = 27, UmbraTextureFormat_ASTC_10X8 = 28, UmbraTextureFormat_ASTC_10X10 = 29, UmbraTextureFormat_ASTC_12X10 = 30, UmbraTextureFormat_ASTC_12X12 = 31, UmbraTextureFormat_ARGB32 = 32, UmbraTextureFormat_R8 = 33, UmbraTextureFormat_PVRTC1_RGB4 = 34, UmbraTextureFormat_PVRTC1_RGBA4 = 35, UmbraTextureFormat_UINT8 = 36, UmbraTextureFormat_UINT16 = 37, UmbraTextureFormat_UINT32 = 38, UmbraTextureFormat_RGB565 = 39, UmbraTextureFormat_RG8 = 40, UmbraTextureFormat_RG16F = 41, UmbraTextureFormat_OPENEXR = 42, UmbraTextureFormat_RGBA_FLOAT16 = 43, UmbraTextureFormat_RGB_FLOAT16 = 44, UmbraTextureFormat_RGB_FLOAT32 = 45, UmbraTextureFormat_BC6H = 46, UmbraTextureFormat_BC7 = 47 }
Texture format.
enum UmbraColorSpace { UmbraColorSpace_Linear = 0, UmbraColorSpace_SRGB }
Color space enum.

Typedefs

typedef void*(* UmbraAllocateFunc )(void*userData, size_t size, const char*info)
The function pointer type for allocating memory.
typedef void(* UmbraDeallocateFunc )(void*userData, void*ptr)
The function pointer type for deallocating memory.
typedef void(* UmbraLogFunc )(void*userData, UmbraLogLevel level, const char*str)
The function pointer type for logging messages.
typedef uint32_t(* UmbraReadFunc )(void*userData, void*buf, uint32_t numBytes)
The function pointer type for reading streams.
typedef uint32_t(* UmbraWriteFunc )(void*userData, const void*ptr, uint32_t numBytes)
The function pointer type for writing streams.
typedef UmbraHttpRequest(* UmbraHttpCreateRequestFunc )(void*userData, const char*url, UmbraHttpMethod method)
The function pointer type for creating UmbraHttpRequest objects.
typedef void(* UmbraHttpDestroyRequestFunc )(void*userData, UmbraHttpRequest req)
The function pointer type for destroying UmbraHttpRequest objects.
typedef void(* UmbraHttpSetUploadDataFunc )(void*userData, UmbraHttpRequest req, const char data[], uint32_t numBytes)
The function pointer type for setting the request body.
typedef void(* UmbraHttpSetUploadStreamFunc )(void*userData, UmbraHttpRequest req, UmbraInputStream*stream)
The function pointer type for setting the request body stream.
typedef void(* UmbraHttpSetDownloadStreamFunc )(void*userData, UmbraHttpRequest req, UmbraOutputStream*stream)
The function pointer type for setting the response output stream.
typedef void(* UmbraHttpSetHeaderFunc )(void*userData, UmbraHttpRequest req, const char*name, const char*value)
The function pointer type for setting HTTP request headers.
typedef void(* UmbraHttpSetAuthorizationFunc )(void*userData, UmbraHttpRequest req, const char*auth)
The function pointer type for setting HTTP request credentials.
typedef void(* UmbraHttpStartTransferFunc )(void*userData, UmbraHttpRequest req)
The function pointer type for starting an HTTP request.
typedef UmbraTransferStatus(* UmbraHttpReadStatusFunc )(void*userData, UmbraHttpRequest req, UmbraHttpTransferInfo*info)
The function pointer type for querying the status of an HTTP request.
typedef struct UmbraClient UmbraClient
Opaque client object.
typedef int32_t UmbraBool
A boolean type.

Functions

void UmbraConfigInit(UmbraConfig*)
Initialize an UmbraConfig struct with default values.
void UmbraSetAllocator(UmbraConfig* config, const UmbraAllocator* allocator)
Replace the default allocator.
void UmbraSetLogger(UmbraConfig* config, const UmbraLogger* logger, UmbraLogLevel minLevel)
Replace the default logger.
void UmbraSetHttp(UmbraConfig* config, const UmbraHttp* http)
Replace the default HTTP implementation.
UmbraClient* UmbraClientCreate(const char* appName, const UmbraConfig* config)
Create a client object.
void UmbraClientDestroy(UmbraClient* client)
Destroy a client object.
const char* UmbraGetLibraryInfo(UmbraLibraryInfo field)
Get information about Umbra's compile-time configuration.

Enum details

enum UmbraLogLevel

Log levels.

Enumerators
UmbraLogLevel_Debug

Debugging information, only useful for working on Umbra itself.

UmbraLogLevel_Info

An informational message.

UmbraLogLevel_Warning

A warning message.

UmbraLogLevel_Error

A fatal error message.

enum UmbraTextureType

Texture type.

Enumerators
UmbraTextureType_Diffuse
UmbraTextureType_Normal
UmbraTextureType_Specular
UmbraTextureType_MetaIndex

enum UmbraTextureFormat

Texture format.

A list of formats either accepted as input by the Umbra importer, or produced as output for use in the Umbra runtime.

Enumerators
UmbraTextureFormat_RGBA32

Four 8-bit unsigned integers.

Can be used as an input or output.

UmbraTextureFormat_RGB24

Three 8-bit unsigned integers.

Can be used as an input or output.

UmbraTextureFormat_BC1

A compressed RGB (or RGB with 1-bit alpha) format.

Can only be used as an output.

UmbraTextureFormat_BC3

A compressed RGBA format.

Can only be used as an output.

UmbraTextureFormat_BC4

A compressed single channel format.

Can only be used as an output.

UmbraTextureFormat_BC5

A compressed dual channel format.

Can only be used as an output.

UmbraTextureFormat_ETC1_RGB

A compressed RGB format.

Can only be used as an output.

UmbraTextureFormat_RGBA_FLOAT32

Four floats.

Can be used as input or output.

UmbraTextureFormat_UNC1
UmbraTextureFormat_JPEG

Standard image formats.

Can only be used as inputs.

UmbraTextureFormat_PNG
UmbraTextureFormat_BMP
UmbraTextureFormat_PSD
UmbraTextureFormat_TGA
UmbraTextureFormat_GIF
UmbraTextureFormat_HDR
UmbraTextureFormat_PIC
UmbraTextureFormat_PNM
UmbraTextureFormat_ASTC_4X4

A flexible compressed format.

Can only be used as outputs.

UmbraTextureFormat_ASTC_5X4
UmbraTextureFormat_ASTC_5X5
UmbraTextureFormat_ASTC_6X5
UmbraTextureFormat_ASTC_6X6
UmbraTextureFormat_ASTC_8X5
UmbraTextureFormat_ASTC_8X6
UmbraTextureFormat_ASTC_10X5
UmbraTextureFormat_ASTC_10X6
UmbraTextureFormat_ASTC_8X8
UmbraTextureFormat_ASTC_10X8
UmbraTextureFormat_ASTC_10X10
UmbraTextureFormat_ASTC_12X10
UmbraTextureFormat_ASTC_12X12
UmbraTextureFormat_ARGB32

Four 8-bit unsigned integers, with alpha in the first channel.

Can only be used as an input.

UmbraTextureFormat_R8

A single 8-bit unsigned integer greyscale channel.

Can only be used as an input.

UmbraTextureFormat_PVRTC1_RGB4

A compressed RGB format.

Can only be used as an output.

UmbraTextureFormat_PVRTC1_RGBA4

A compressed RGBA format.

Can only be used as an output.

UmbraTextureFormat_UINT8

Umbra internal use only.

UmbraTextureFormat_UINT16

Umbra internal use only.

UmbraTextureFormat_UINT32

Umbra internal use only.

UmbraTextureFormat_RGB565

Low precision RGB format.

Only used by Umbra internally. Cannot be used as an input or output.

UmbraTextureFormat_RG8

Two 8-bit unsigned integers.

Only used by Umbra internally. Cannot be used as an input or output.

UmbraTextureFormat_RG16F

Two halfs.

Only used by Umbra internally. Cannot be used as an input or output.

UmbraTextureFormat_OPENEXR

An HDR format.

Can only be used as an input.

UmbraTextureFormat_RGBA_FLOAT16

Four halfs.

Can only be used as an output.

UmbraTextureFormat_RGB_FLOAT16

Three halfs.

Can only be used as an output.

UmbraTextureFormat_RGB_FLOAT32

Three floats.

Can only be used as an output.

UmbraTextureFormat_BC6H

A compressed HDR RGB format.

Can only be used as an output.

UmbraTextureFormat_BC7

A compressed RGB or RGBA format.

Can only be used as an output.

enum UmbraColorSpace

Color space enum.

Enumerators
UmbraColorSpace_Linear

Linear color space.

UmbraColorSpace_SRGB

sRGB color space.

Typedef details

typedef void*(*UmbraAllocateFunc)(void*userData, size_t size, const char*info)

The function pointer type for allocating memory.

typedef void(*UmbraDeallocateFunc)(void*userData, void*ptr)

The function pointer type for deallocating memory.

typedef void(*UmbraLogFunc)(void*userData, UmbraLogLevel level, const char*str)

The function pointer type for logging messages.

typedef uint32_t(*UmbraReadFunc)(void*userData, void*buf, uint32_t numBytes)

The function pointer type for reading streams.

typedef uint32_t(*UmbraWriteFunc)(void*userData, const void*ptr, uint32_t numBytes)

The function pointer type for writing streams.

typedef UmbraHttpRequest(*UmbraHttpCreateRequestFunc)(void*userData, const char*url, UmbraHttpMethod method)

The function pointer type for creating UmbraHttpRequest objects.

typedef void(*UmbraHttpDestroyRequestFunc)(void*userData, UmbraHttpRequest req)

The function pointer type for destroying UmbraHttpRequest objects.

typedef void(*UmbraHttpSetUploadDataFunc)(void*userData, UmbraHttpRequest req, const char data[], uint32_t numBytes)

The function pointer type for setting the request body.

typedef void(*UmbraHttpSetUploadStreamFunc)(void*userData, UmbraHttpRequest req, UmbraInputStream*stream)

The function pointer type for setting the request body stream.

typedef void(*UmbraHttpSetDownloadStreamFunc)(void*userData, UmbraHttpRequest req, UmbraOutputStream*stream)

The function pointer type for setting the response output stream.

typedef void(*UmbraHttpSetHeaderFunc)(void*userData, UmbraHttpRequest req, const char*name, const char*value)

The function pointer type for setting HTTP request headers.

typedef void(*UmbraHttpSetAuthorizationFunc)(void*userData, UmbraHttpRequest req, const char*auth)

The function pointer type for setting HTTP request credentials.

typedef void(*UmbraHttpStartTransferFunc)(void*userData, UmbraHttpRequest req)

The function pointer type for starting an HTTP request.

typedef UmbraTransferStatus(*UmbraHttpReadStatusFunc)(void*userData, UmbraHttpRequest req, UmbraHttpTransferInfo*info)

The function pointer type for querying the status of an HTTP request.

Function details

void UmbraSetAllocator(UmbraConfig* config, const UmbraAllocator* allocator)

Replace the default allocator.

Parameters
config in The configuration object.
allocator in The allocator implementation.

void UmbraSetLogger(UmbraConfig* config, const UmbraLogger* logger, UmbraLogLevel minLevel)

Replace the default logger.

Parameters
config in The configuration object.
logger in The logger implementation.
minLevel in The minimum logging level.

void UmbraSetHttp(UmbraConfig* config, const UmbraHttp* http)

Replace the default HTTP implementation.

Parameters
config in The configuration object.
http in The HTTP implementation.

UmbraClient* UmbraClientCreate(const char* appName, const UmbraConfig* config)

Create a client object.

Parameters
appName in The application name.
config in The configuration object.
Returns A new client object.

void UmbraClientDestroy(UmbraClient* client)

Destroy a client object.

Parameters
client in The client object.

const char* UmbraGetLibraryInfo(UmbraLibraryInfo field)

Get information about Umbra's compile-time configuration.

Parameters
field in The info string to retrieve.
Returns The ASCII encoded info string. It is statically allocated and doesn't need to be deallocated.

This function returns a string describing Umbra's compile-time configuration. See UmbraLibraryInfo for the complete list of available strings.