33 #include "servers/visual_server.h" 48 static void _bind_methods();
52 FLAG_MIPMAPS=VisualServer::TEXTURE_FLAG_MIPMAPS,
53 FLAG_REPEAT=VisualServer::TEXTURE_FLAG_REPEAT,
54 FLAG_FILTER=VisualServer::TEXTURE_FLAG_FILTER,
55 FLAG_ANISOTROPIC_FILTER=VisualServer::TEXTURE_FLAG_ANISOTROPIC_FILTER,
56 FLAG_CONVERT_TO_LINEAR=VisualServer::TEXTURE_FLAG_CONVERT_TO_LINEAR,
57 FLAG_VIDEO_SURFACE=VisualServer::TEXTURE_FLAG_VIDEO_SURFACE,
58 FLAGS_DEFAULT=FLAG_MIPMAPS|FLAG_REPEAT|FLAG_FILTER,
59 FLAG_MIRRORED_REPEAT=VisualServer::TEXTURE_FLAG_MIRRORED_REPEAT
63 virtual int get_width()
const=0;
64 virtual int get_height()
const=0;
65 virtual Size2 get_size()
const;
66 virtual RID get_rid()
const=0;
68 virtual bool has_alpha()
const=0;
70 virtual void set_flags(uint32_t p_flags)=0;
71 virtual uint32_t get_flags()
const=0;
73 virtual void draw(
RID p_canvas_item,
const Point2& p_pos,
const Color& p_modulate=
Color(1,1,1),
bool p_transpose=
false)
const;
74 virtual void draw_rect(
RID p_canvas_item,
const Rect2& p_rect,
bool p_tile=
false,
const Color& p_modulate=
Color(1,1,1),
bool p_transpose=
false)
const;
75 virtual void draw_rect_region(
RID p_canvas_item,
const Rect2& p_rect,
const Rect2& p_src_rect,
const Color& p_modulate=
Color(1,1,1),
bool p_transpose=
false)
const;
76 virtual bool get_rect_region(
const Rect2& p_rect,
const Rect2& p_src_rect,
Rect2& r_rect,
Rect2& r_src_rect)
const;
83 VARIANT_ENUM_CAST( Texture::Flags );
89 RES_BASE_EXTENSION(
"tex");
93 STORAGE_COMPRESS_LOSSY,
94 STORAGE_COMPRESS_LOSSLESS
103 float lossy_storage_quality;
106 virtual bool can_reload_from_file();
107 virtual void reload_from_file();
113 void _reload_hook(
const RID& p_hook);
114 virtual void _resource_path_changed();
115 static void _bind_methods();
122 void create(
int p_width,
int p_height,
Image::Format p_format,uint32_t p_flags=FLAGS_DEFAULT);
123 void create_from_image(
const Image& p_image, uint32_t p_flags=FLAGS_DEFAULT);
126 void set_flags(uint32_t p_flags);
127 uint32_t get_flags()
const;
129 void load(
const String& p_path);
130 void set_data(
const Image& p_image);
131 Image get_data()
const;
133 int get_width()
const;
134 int get_height()
const;
136 virtual RID get_rid()
const;
138 bool has_alpha()
const;
139 virtual void draw(
RID p_canvas_item,
const Point2& p_pos,
const Color& p_modulate=
Color(1,1,1),
bool p_transpose=
false)
const;
140 virtual void draw_rect(
RID p_canvas_item,
const Rect2& p_rect,
bool p_tile=
false,
const Color& p_modulate=
Color(1,1,1),
bool p_transpose=
false)
const;
141 virtual void draw_rect_region(
RID p_canvas_item,
const Rect2& p_rect,
const Rect2& p_src_rect,
const Color& p_modulate=
Color(1,1,1),
bool p_transpose=
false)
const;
142 void set_storage(Storage p_storage);
143 Storage get_storage()
const;
145 void set_lossy_storage_quality(
float p_lossy_storage_quality);
146 float get_lossy_storage_quality()
const;
148 void fix_alpha_edges();
149 void premultiply_alpha();
151 void shrink_x2_and_keep_size();
154 void set_size_override(
const Size2& p_size);
156 virtual void set_path(
const String& p_path,
bool p_take_over=
false);
164 VARIANT_ENUM_CAST( ImageTexture::Storage );
169 RES_BASE_EXTENSION(
"atex");
177 static void _bind_methods();
180 virtual int get_width()
const;
181 virtual int get_height()
const;
182 virtual RID get_rid()
const;
184 virtual bool has_alpha()
const;
186 virtual void set_flags(uint32_t p_flags);
187 virtual uint32_t get_flags()
const;
192 void set_region(
const Rect2& p_region);
193 Rect2 get_region()
const ;
195 void set_margin(
const Rect2& p_margin);
196 Rect2 get_margin()
const ;
198 virtual void draw(
RID p_canvas_item,
const Point2& p_pos,
const Color& p_modulate=
Color(1,1,1),
bool p_transpose=
false)
const;
199 virtual void draw_rect(
RID p_canvas_item,
const Rect2& p_rect,
bool p_tile=
false,
const Color& p_modulate=
Color(1,1,1),
bool p_transpose=
false)
const;
200 virtual void draw_rect_region(
RID p_canvas_item,
const Rect2& p_rect,
const Rect2& p_src_rect,
const Color& p_modulate=
Color(1,1,1),
bool p_transpose=
false)
const;
201 virtual bool get_rect_region(
const Rect2& p_rect,
const Rect2& p_src_rect,
Rect2& r_rect,
Rect2& r_src_rect)
const;
210 RES_BASE_EXTENSION(
"ltex");
223 Array _get_data()
const;
224 void _set_data(
const Array& p_array);
225 static void _bind_methods();
228 virtual int get_width()
const;
229 virtual int get_height()
const;
230 virtual RID get_rid()
const;
232 virtual bool has_alpha()
const;
234 virtual void set_flags(uint32_t p_flags);
235 virtual uint32_t get_flags()
const;
238 void set_piece_offset(
int p_idx,
const Point2& p_offset);
239 void set_piece_texture(
int p_idx,
const Ref<Texture>& p_texture);
241 void set_size(
const Size2& p_size);
244 int get_piece_count()
const;
245 Vector2 get_piece_offset(
int p_idx)
const;
248 virtual void draw(
RID p_canvas_item,
const Point2& p_pos,
const Color& p_modulate=
Color(1,1,1),
bool p_transpose=
false)
const;
249 virtual void draw_rect(
RID p_canvas_item,
const Rect2& p_rect,
bool p_tile=
false,
const Color& p_modulate=
Color(1,1,1),
bool p_transpose=
false)
const;
250 virtual void draw_rect_region(
RID p_canvas_item,
const Rect2& p_rect,
const Rect2& p_src_rect,
const Color& p_modulate=
Color(1,1,1),
bool p_transpose=
false)
const;
261 RES_BASE_EXTENSION(
"cbm");
265 STORAGE_COMPRESS_LOSSY,
266 STORAGE_COMPRESS_LOSSLESS
280 FLAG_MIPMAPS=VisualServer::TEXTURE_FLAG_MIPMAPS,
281 FLAG_REPEAT=VisualServer::TEXTURE_FLAG_REPEAT,
282 FLAG_FILTER=VisualServer::TEXTURE_FLAG_FILTER,
283 FLAGS_DEFAULT=FLAG_MIPMAPS|FLAG_REPEAT|FLAG_FILTER,
295 float lossy_storage_quality;
297 _FORCE_INLINE_
bool _is_valid()
const {
for(
int i=0;i<6;i++) {
if (valid[i])
return true; }
return false; }
305 static void _bind_methods();
308 void set_flags(uint32_t p_flags);
309 uint32_t get_flags()
const;
310 void set_side(Side p_side,
const Image& p_image);
311 Image get_side(Side p_side)
const;
314 int get_width()
const;
315 int get_height()
const;
317 virtual RID get_rid()
const;
319 void set_storage(Storage p_storage);
320 Storage get_storage()
const;
322 void set_lossy_storage_quality(
float p_lossy_storage_quality);
323 float get_lossy_storage_quality()
const;
325 virtual void set_path(
const String& p_path,
bool p_take_over=
false);
332 VARIANT_ENUM_CAST( CubeMap::Flags );
333 VARIANT_ENUM_CAST( CubeMap::Side );
334 VARIANT_ENUM_CAST( CubeMap::Storage );
Definition: math_2d.h:369
Format
Definition: image.h:57
Definition: texture.h:258
Definition: math_2d.h:204
Definition: string_db.h:48
Definition: texture.h:207
Definition: resource.h:89
Definition: dictionary.h:42
Definition: texture.h:166
Definition: texture.h:213