25 #ifndef SFML_IMAGE_HPP
26 #define SFML_IMAGE_HPP
31 #include <SFML/System/Resource.hpp>
32 #include <SFML/Graphics/Color.hpp>
33 #include <SFML/Graphics/Rect.hpp>
72 Image(
unsigned int Width,
unsigned int Height,
const Color& Col =
Color(0, 0, 0, 255));
82 Image(
unsigned int Width,
unsigned int Height,
const Uint8* Data);
98 bool LoadFromFile(
const std::string& Filename);
109 bool LoadFromMemory(
const char* Data, std::size_t SizeInBytes);
121 bool LoadFromPixels(
unsigned int Width,
unsigned int Height,
const Uint8* Data);
131 bool SaveToFile(
const std::string& Filename)
const;
143 bool Create(
unsigned int Width,
unsigned int Height,
Color Col =
Color(0, 0, 0, 255));
152 void CreateMaskFromColor(
Color ColorKey, Uint8 Alpha = 0);
166 void Copy(
const Image& Source,
unsigned int DestX,
unsigned int DestY,
const IntRect& SourceRect =
IntRect(0, 0, 0, 0),
bool ApplyAlpha =
false);
188 void SetPixel(
unsigned int X,
unsigned int Y,
const Color& Col);
199 const Color& GetPixel(
unsigned int X,
unsigned int Y)
const;
209 const Uint8* GetPixelsPtr()
const;
224 void SetSmooth(
bool Smooth);
232 unsigned int GetWidth()
const;
240 unsigned int GetHeight()
const;
248 bool IsSmooth()
const;
269 static unsigned int GetValidTextureSize(
unsigned int Size);
289 bool CreateTexture();
295 void EnsureTextureUpdate()
const;
301 void EnsureArrayUpdate()
const;
313 void DestroyTexture();
318 unsigned int myWidth;
319 unsigned int myHeight;
320 unsigned int myTextureWidth;
321 unsigned int myTextureHeight;
322 unsigned int myTexture;
324 mutable std::vector<Color> myPixels;
325 mutable bool myNeedTextureUpdate;
326 mutable bool myNeedArrayUpdate;
332 #endif // SFML_IMAGE_HPP