beastapi/beasttexture.h File Reference

#include "beastapitypes.h"

File Description

The beast texture function definitions.

Enumerations

enum  ILBImageGammaType { ILB_IG_GAMMA }
 
enum  ILBPixelFormat {
  ILB_PF_MONO_FLOAT, ILB_PF_RGB_FLOAT, ILB_PF_RGBA_FLOAT, ILB_PF_MONO_BYTE,
  ILB_PF_RGB_BYTE, ILB_PF_RGBA_BYTE
}
 

Functions

ILBStatus ILBAddPixelDataHDR (ILBTextureHandle texture, const float *data, int32 pixelCount)
 
ILBStatus ILBAddPixelDataLDR (ILBTextureHandle texture, const unsigned char *data, int32 pixelCount)
 
ILBStatus ILBBeginTexture (ILBManagerHandle beastManager, ILBConstString uniqueName, int32 width, int32 height, ILBPixelFormat inputFormat, ILBTextureHandle *target)
 
ILBStatus ILBEndTexture (ILBTextureHandle texture)
 
ILBStatus ILBFindTexture (ILBManagerHandle beastManager, ILBConstString uniqueName, ILBTextureHandle *target)
 
ILBStatus ILBReferenceTexture (ILBManagerHandle beastManager, ILBConstString uniqueName, ILBConstString filename, ILBTextureHandle *target)
 
ILBStatus ILBSetInputGamma (ILBTextureHandle texture, ILBImageGammaType type, float gamma)
 

Enumeration Type Documentation

Gamma for input pixels data.

Enumerator
ILB_IG_GAMMA 

Gamma ramp, will always be combined with a gamma value.

Format for pixel data.

Enumerator
ILB_PF_MONO_FLOAT 

Monochrome floating point pixels.

ILB_PF_RGB_FLOAT 

Color floating point pixels.

ILB_PF_RGBA_FLOAT 

Color with alpha floating point pixels.

ILB_PF_MONO_BYTE 

Monochrome byte pixels.

ILB_PF_RGB_BYTE 

Color byte pixels.

ILB_PF_RGBA_BYTE 

Color with alpha byte pixels.

Function Documentation

ILBStatus ILBAddPixelDataHDR ( ILBTextureHandle  texture,
const float *  data,
int32  pixelCount 
)

Adds pixels to a texture.

This function should only be used on textures using FLOAT pixel formats. Pixel data is treated as a linear array of pixels line by line. It may be called multiple times avoid having to replicate the entire image in Beast format, but the total number of pixels must not exceed what was specified in beginTexture.
The lines are given from the bottom and up, the lines are stored left to right.

Parameters
texturethe texture to add the pixels for
datathe pixel data to add. Note this must correspond to the pixel format specified in the beginTexture call
pixelCountthe number of pixel (not data values) specified in this batch.
Returns
The result of the operation.
+ Examples:
ILBStatus ILBAddPixelDataLDR ( ILBTextureHandle  texture,
const unsigned char *  data,
int32  pixelCount 
)

Adds pixels to a texture.

This function should only be used on textures using BYTE pixel formats. Pixel data is treated as a linear array of pixels line by line. It may be called multiple times avoid having to replicate the entire image in Beast format, but the total number of pixels must not exceed what was specified in beginTexture.
The lines are given from the bottom and up, the lines are stored left to right.

Parameters
texturethe texture to add the pixels for
datathe pixel data to add. Note this must correspond to the pixel format specified in the beginTexture call
pixelCountthe number of pixels (not data values) specified in this batch.
Returns
The result of the operation.
+ Examples:
ILBStatus ILBBeginTexture ( ILBManagerHandle  beastManager,
ILBConstString  uniqueName,
int32  width,
int32  height,
ILBPixelFormat  inputFormat,
ILBTextureHandle target 
)

Begins creation of a texture.


Parameters
beastManagerthe beast manager this texture will be associated with
uniqueNamea unique name for the texture.
widththe width of the texture
heightthe height of the texture
inputFormatthe pixel format you intend to use to input data. This will not necessarily be the same format as Beast choose to save the image in.
targeta pointer to a ILBTextureHandle that will receive the created texture
Returns
The result of the operation.
+ Examples:
ILBStatus ILBEndTexture ( ILBTextureHandle  texture)

Finalizes creation of a texture.

Will fail unless it has got the width * height pixels added

Parameters
texturethe texture to finalize
Returns
The result of the operation.
+ Examples:
ILBStatus ILBFindTexture ( ILBManagerHandle  beastManager,
ILBConstString  uniqueName,
ILBTextureHandle target 
)

Finds a cached texture.


Parameters
beastManagerthe beast manager to check whether the texture is available in
uniqueNamethe unique name for texture.
targetthe texture handle to store the texture in
Returns
The result of the operation. ILB_ST_SUCCESS if the texture is available ILB_ST_UNKNOWN_OBJECT if the texture is not in the cache
+ Examples:
ILBStatus ILBReferenceTexture ( ILBManagerHandle  beastManager,
ILBConstString  uniqueName,
ILBConstString  filename,
ILBTextureHandle target 
)

References in an external texture.


Note, a referenced texture doesn't need a call to ILBEndTexture!

Parameters
beastManagerthe beast manager this texture will be associated with
uniqueNameA unique name for the texture.
filenamethe path to the file to use
targeta pointer to a ILBTextureHandle that will receive the new created texture
Returns
The result of the operation.
+ Examples:
ILBStatus ILBSetInputGamma ( ILBTextureHandle  texture,
ILBImageGammaType  type,
float  gamma 
)

Sets what gamma encoding the colors in LDR texture has.


This call is only valid on textures with an LDR pixel format. HDR textures are always regarded as linear. By default it's set to ILB_IG_GAMMA with gamma 2.2

Parameters
texturethe texture to set gamma on
typethe gamma ramp type
gammathe gamma value.
Returns
The result of the operation.
+ Examples:

Go to the source code of this file.