ai_texture.h
1 /*
2  * Arnold API header file
3  * Copyright (c) 1998-2009 Marcos Fajardo, (c) 2009-2013 Solid Angle SL
4  */
5 
11 #pragma once
12 #include "ai_color.h"
13 #include "ai_api.h"
14 #include "ai_shaderglobals.h"
15 
26 #define AI_WRAP_PERIODIC 0x00
27 #define AI_WRAP_BLACK 0x01
28 #define AI_WRAP_CLAMP 0x02
29 #define AI_WRAP_MIRROR 0x03
30 #define AI_WRAP_FILE 0x04
31 /*\}*/
32 
39 #define AI_TEXTURE_CLOSEST 0
40 #define AI_TEXTURE_BILINEAR 1
41 #define AI_TEXTURE_BICUBIC 2
42 #define AI_TEXTURE_SMART_BICUBIC 3
43 /*\}*/
44 
51 #define AI_TEXTURE_MIPMODE_DEFAULT 0
52 #define AI_TEXTURE_MIPMODE_NONE 1
53 #define AI_TEXTURE_MIPMODE_ONE 2
54 #define AI_TEXTURE_MIPMODE_TRILINEAR 3
55 #define AI_TEXTURE_MIPMODE_ANISOTROPIC 4
56 /*\}*/
57 
59 typedef struct AtTextureParams {
60  int filter;
65  float fill;
66  bool flip_s;
67  bool flip_t;
68  bool swap_st;
69  float scale_s;
70  float scale_t;
71  int wrap_s;
72  int wrap_t;
73  float width_s;
74  float width_t;
75  float blur_s;
76  float blur_t;
78 
79 AI_API void AiTextureParamsSetDefaults(AtTextureParams* params);
80 
90 struct AtTextureHandle;
91 
92 AI_API AtTextureHandle* AiTextureHandleCreate(const char* filename);
93 AI_API AtRGBA AiTextureHandleAccess(const AtShaderGlobals* sg, AtTextureHandle* handle, const AtTextureParams* params, bool* success = NULL);
94 AI_API void AiTextureHandleDestroy(AtTextureHandle* handle);
95 
96 AI_API AtRGBA AiTextureAccess(const AtShaderGlobals* sg, const char* filename, const AtTextureParams* params, bool* success = NULL);
97 
98 AI_API bool AiTextureGetResolution(const char* filename, unsigned int* width, unsigned int* height);
99 AI_API bool AiTextureGetNumChannels(const char* filename, unsigned int* num_channels);
100 AI_API const char* AiTextureGetChannelName(const char* filename, unsigned int channel_index);
101 AI_API bool AiTextureGetFormat(const char* filename, unsigned int* format);
102 AI_API bool AiTextureGetBitDepth(const char* filename, unsigned int* bit_depth);
103 AI_API bool AiTextureGetMatrices(const char* filename, AtMatrix world_to_screen, AtMatrix world_to_camera);
104 
105 /*\}*/

© 2009-2013 Solid Angle SL · all rights reserved · www.solidangle.com