Data Structures
ai_texture.h File Reference

Texture mapping system. More...

#include "ai_allocate.h"
#include "ai_api.h"
#include "ai_color.h"
#include "ai_shaderglobals.h"

Go to the source code of this file.

Data Structures

struct  AtTextureParams
 Structure that holds all of the available texture map look-up options. More...
 
struct  AtImage
 Structure that holds infromation for reading, writing and resizing images. More...
 

Macros

Wrapping Modes

Wrap mode describes what happens when texture coordinates describe a value outside the usual [0,1] range in (s,t)-space where a texture is defined.

#define AI_WRAP_PERIODIC   0
 the texture repeats itself outside the [0,1] range
 
#define AI_WRAP_BLACK   1
 return black outside the [0,1] range

 
#define AI_WRAP_CLAMP   2
 clamp to the closest texture edge

 
#define AI_WRAP_MIRROR   3
 mirror the image across the boundaries

 
#define AI_WRAP_FILE   4
 use wrap mode found in the EXR file's metadata

 
Texture Look-Up/Interpolation Modes

The look-up mode determines how we sample within a mimap level.

#define AI_TEXTURE_CLOSEST   0
 force the closest texel

 
#define AI_TEXTURE_BILINEAR   1
 force bilinear look-up within a mip level

 
#define AI_TEXTURE_BICUBIC   2
 force bicubic look-up within a mip level

 
#define AI_TEXTURE_SMART_BICUBIC   3
 bicubic when maxifying, else use bilinear look-up
 

MIP modes

The MIP mode determines how we sample between mipmap levels.

#define AI_TEXTURE_MIPMODE_DEFAULT   0
 use the default mode (auto-selected)

 
#define AI_TEXTURE_MIPMODE_NONE   1
 use highest-res mip level only

 
#define AI_TEXTURE_MIPMODE_ONE   2
 just use one mip level (closest)

 
#define AI_TEXTURE_MIPMODE_TRILINEAR   3
 trilinear blending of two closest mip levels

 
#define AI_TEXTURE_MIPMODE_ANISOTROPIC   4
 use two closest mip levels with anisotropic filtering
 
enum  AtMakeTxStatus {
  AiTxPending , AiTxError , AiTxUpdated , AiTxUpdate_unneeded ,
  AiTxAborted
}
 Status of AiMakeTx jobs.
 
AI_API void AiTextureParamsSetDefaults (AtTextureParams &params)
 Initialize an AtTextureParams object with default values. More...
 
AI_API AtTextureHandleAiTextureHandleCreate (const char *filename, AtString color_space=AtString())
 Create a handle for a given texture filename. More...
 
AI_API AtRGBA AiTextureHandleAccess (const AtShaderGlobals *sg, AtTextureHandle *handle, const AtTextureParams &params, bool *success=NULL)
 Perform a texture look-up through a handle. More...
 
AI_API void AiTextureHandleDestroy (AtTextureHandle *handle)
 Destroy an existing texture handle and its associated resources. More...
 
AI_API AtRGBA AiTextureAccess (const AtShaderGlobals *sg, AtString filename, AtString color_space, const AtTextureParams &params, bool *success=NULL)
 Perform a texture look-up through a filename string. More...
 
AI_API bool AiTextureLoad (const AtString filename, const bool use_float, const unsigned int miplevel, void *image)
 This is currently an EXPERIMENTAL function and might be modified in future Arnold releases. More...
 
AI_API bool AiTextureGetResolution (const char *filename, unsigned int *width, unsigned int *height)
 Query resolution info about a texture. More...
 
AI_API bool AiTextureGetNumChannels (const char *filename, unsigned int *num_channels)
 Query the number of channels in the specified image. More...
 
AI_API AI_PURE const char * AiTextureGetChannelName (const char *filename, unsigned int channel_index)
 Query the name of a channel in the specified image. More...
 
AI_API bool AiTextureGetFormat (const char *filename, unsigned int *format)
 Query the format of the specified image. More...
 
AI_API bool AiTextureGetBitDepth (const char *filename, unsigned int *bit_depth)
 Query the bit depth of the specified image. More...
 
AI_API bool AiTextureGetMatrices (const char *filename, AtMatrix &world_to_screen, AtMatrix &world_to_camera)
 Query the matrices associated with the specified texture. More...
 
AI_API void AiTextureInvalidate (const char *filename)
 Invalidate a specific texture from the cache. More...
 
AI_API AtString AiTextureGetTxFileName (const char *filename, AtString texture_color_space, AtString render_color_space, const AtUniverse *universe)
 Return the name of the TX filename that would be generated from the source texture by auto TX. More...
 
AI_API AtString AiTextureAutoTxFlags (const char *texture_file, AtString texture_color_space, const AtUniverse *universe)
 Return the flags passed to the "maketx" command during auto TX generation. More...
 
AI_API bool AiReadImage (const char *filename, const uint8_t format, AtImage &image, AtParamValueMap *params=nullptr)
 Read in the image at filename into image . More...
 
AI_API bool AiWriteImage (const char *filename, const AtImage &image, AtParamValueMap *params=nullptr)
 Write the image in image out to the file specified by filename. More...
 
AI_API bool AiResizeImage (const AtImage &inImage, AtImage &outImage, AtParamValueMap *params=nullptr)
 Resize the image in inImage into outImage , overwrites the buffer of outImage. More...
 
AI_DEPRECATED bool AiLoadImage (const char *filename, const uint8_t format, AtImage &image)
 
AI_API void AiMakeTx (const char *filename, const char *flags, const AtUniverse *universe=NULL)
 Asynchronously runs a maketx job in the background. More...
 
AI_API unsigned AiMakeTxWaitJob (AtMakeTxStatus *&statuses, const char **&source_files, unsigned int &num_submitted_textures)
 This function will block until at least one job has been finished. More...
 
AI_API void AiMakeTxAbort (AtMakeTxStatus *&statuses, const char **&source_files, unsigned int &num_submitted_textures)
 Abort pending maketx jobs. More...
 

Detailed Description

Texture mapping system.


© 2022 Autodesk, Inc. · All rights reserved · www.arnoldrenderer.com