BKE_texture.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /*
  2. * ***** BEGIN GPL LICENSE BLOCK *****
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version 2
  7. * of the License, or (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software Foundation,
  16. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  17. *
  18. * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
  19. * All rights reserved.
  20. *
  21. * The Original Code is: all of this file.
  22. *
  23. * Contributor(s): none yet.
  24. *
  25. * ***** END GPL LICENSE BLOCK *****
  26. */
  27. #ifndef __BKE_TEXTURE_H__
  28. #define __BKE_TEXTURE_H__
  29. /** \file BKE_texture.h
  30. * \ingroup bke
  31. * \since March 2001
  32. * \author nzc
  33. */
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37. struct bNode;
  38. struct Brush;
  39. struct ColorBand;
  40. struct EnvMap;
  41. struct FreestyleLineStyle;
  42. struct ImagePool;
  43. struct Lamp;
  44. struct Main;
  45. struct Material;
  46. struct MTex;
  47. struct OceanTex;
  48. struct ParticleSettings;
  49. struct PointDensity;
  50. struct Tex;
  51. struct TexMapping;
  52. struct TexResult;
  53. struct VoxelData;
  54. struct World;
  55. /* in ColorBand struct */
  56. #define MAXCOLORBAND 32
  57. void init_colorband(struct ColorBand *coba, bool rangetype);
  58. struct ColorBand *add_colorband(bool rangetype);
  59. bool do_colorband(const struct ColorBand *coba, float in, float out[4]);
  60. void colorband_table_RGBA(struct ColorBand *coba, float **array, int *size);
  61. struct CBData *colorband_element_add(struct ColorBand *coba, float position);
  62. int colorband_element_remove(struct ColorBand *coba, int index);
  63. void colorband_update_sort(struct ColorBand *coba);
  64. void BKE_texture_free(struct Tex *tex);
  65. void BKE_texture_default(struct Tex *tex);
  66. struct Tex *BKE_texture_copy(struct Main *bmain, const struct Tex *tex);
  67. struct Tex *BKE_texture_add(struct Main *bmain, const char *name);
  68. struct Tex *BKE_texture_localize(struct Tex *tex);
  69. void BKE_texture_make_local(struct Main *bmain, struct Tex *tex, const bool lib_local);
  70. void BKE_texture_type_set(struct Tex *tex, int type);
  71. void BKE_texture_mtex_default(struct MTex *mtex);
  72. struct MTex *BKE_texture_mtex_add(void);
  73. struct MTex *BKE_texture_mtex_add_id(struct ID *id, int slot);
  74. /* UNUSED */
  75. // void autotexname(struct Tex *tex);
  76. struct Tex *give_current_object_texture(struct Object *ob);
  77. struct Tex *give_current_material_texture(struct Material *ma);
  78. struct Tex *give_current_lamp_texture(struct Lamp *la);
  79. struct Tex *give_current_linestyle_texture(struct FreestyleLineStyle *linestyle);
  80. struct Tex *give_current_world_texture(struct World *world);
  81. struct Tex *give_current_brush_texture(struct Brush *br);
  82. struct Tex *give_current_particle_texture(struct ParticleSettings *part);
  83. struct bNode *give_current_material_texture_node(struct Material *ma);
  84. bool give_active_mtex(struct ID *id, struct MTex ***mtex_ar, short *act);
  85. void set_active_mtex(struct ID *id, short act);
  86. void set_current_brush_texture(struct Brush *br, struct Tex *tex);
  87. void set_current_world_texture(struct World *wo, struct Tex *tex);
  88. void set_current_material_texture(struct Material *ma, struct Tex *tex);
  89. void set_current_lamp_texture(struct Lamp *la, struct Tex *tex);
  90. void set_current_linestyle_texture(struct FreestyleLineStyle *linestyle, struct Tex *tex);
  91. void set_current_particle_texture(struct ParticleSettings *part, struct Tex *tex);
  92. bool has_current_material_texture(struct Material *ma);
  93. struct TexMapping *BKE_texture_mapping_add(int type);
  94. void BKE_texture_mapping_default(struct TexMapping *texmap, int type);
  95. void BKE_texture_mapping_init(struct TexMapping *texmap);
  96. struct ColorMapping *BKE_texture_colormapping_add(void);
  97. void BKE_texture_colormapping_default(struct ColorMapping *colormap);
  98. void BKE_texture_envmap_free_data(struct EnvMap *env);
  99. void BKE_texture_envmap_free(struct EnvMap *env);
  100. struct EnvMap *BKE_texture_envmap_add(void);
  101. struct EnvMap *BKE_texture_envmap_copy(const struct EnvMap *env);
  102. void BKE_texture_pointdensity_init_data(struct PointDensity *pd);
  103. void BKE_texture_pointdensity_free_data(struct PointDensity *pd);
  104. void BKE_texture_pointdensity_free(struct PointDensity *pd);
  105. struct PointDensity *BKE_texture_pointdensity_add(void);
  106. struct PointDensity *BKE_texture_pointdensity_copy(const struct PointDensity *pd);
  107. void BKE_texture_voxeldata_free_data(struct VoxelData *vd);
  108. void BKE_texture_voxeldata_free(struct VoxelData *vd);
  109. struct VoxelData *BKE_texture_voxeldata_add(void);
  110. struct VoxelData *BKE_texture_voxeldata_copy(struct VoxelData *vd);
  111. void BKE_texture_ocean_free(struct OceanTex *ot);
  112. struct OceanTex *BKE_texture_ocean_add(void);
  113. struct OceanTex *BKE_texture_ocean_copy(const struct OceanTex *ot);
  114. bool BKE_texture_dependsOnTime(const struct Tex *texture);
  115. bool BKE_texture_is_image_user(const struct Tex *tex);
  116. void BKE_texture_get_value_ex(
  117. const struct Scene *scene, struct Tex *texture,
  118. float *tex_co, struct TexResult *texres,
  119. struct ImagePool *pool,
  120. bool use_color_management);
  121. void BKE_texture_get_value(
  122. const struct Scene *scene, struct Tex *texture,
  123. float *tex_co, struct TexResult *texres, bool use_color_management);
  124. void BKE_texture_fetch_images_for_pool(struct Tex *texture, struct ImagePool *pool);
  125. #ifdef __cplusplus
  126. }
  127. #endif
  128. #endif