31 #include "../Render/graphic_context.h" 32 #include "../Render/texture_2d.h" 33 #include "../Image/pixel_buffer.h" 41 class CursorDescription_Impl;
42 class XMLResourceDocument;
86 const std::vector<CursorDescriptionFrame> &
get_frames()
const;
137 int width,
int height,
138 int xarray = 1,
int yarray = 1,
139 int array_skipframes = 0,
140 int xspacing = 0,
int yspacing = 0);
154 int xpos = 0,
int ypos = 0,
155 float trans_limit = 0.05
f);
168 int xpos = 0,
int ypos = 0,
169 float trans_limit = 0.05
f);
178 std::shared_ptr<CursorDescription_Impl> impl;
Point get_hotspot() const
the offset of where the cursor is drawn relative to cursor image
I/O Device interface.
Definition: iodevice.h:49
Pixel data container.
Definition: pixel_buffer.h:67
double delay
Definition: cursor_description.h:58
Image Import Description Class.
Definition: image_import_description.h:47
const std::vector< CursorDescriptionFrame > & get_frames() const
Returns a list over all available frames.
void add_alphaclipped_frames(const PixelBuffer &pixelbuffer, int xpos=0, int ypos=0, float trans_limit=0.05f)
Adds images separated with pure alpha (within trans_limit).
void set_frame_delay(int frame, double delay)
Sets the duration this frame is displayed, in seconds.
bool operator==(const CursorDescription &that) const
Definition: cursor_description.h:91
void add_gridclipped_frames(const PixelBuffer &pixelbuffer, int xpos, int ypos, int width, int height, int xarray=1, int yarray=1, int array_skipframes=0, int xspacing=0, int yspacing=0)
Adds images formed in a grid.
CursorDescription & operator=(const CursorDescription ©)
Copy assignment operator.
Rect rect
Definition: cursor_description.h:57
2D (left,top,right,bottom) rectangle structure - Integer
Definition: rect.h:488
bool operator>(const CursorDescription &that) const
Definition: cursor_description.h:94
PixelBuffer pixelbuffer
Definition: cursor_description.h:56
void add_alphaclipped_frames_free(const PixelBuffer &pixelbuffer, int xpos=0, int ypos=0, float trans_limit=0.05f)
Adds images separated with pure alpha (within trans_limit).
CursorDescription()
Constructs a cursor description.
Virtual File System (VFS).
Definition: file_system.h:46
bool operator<=(const CursorDescription &that) const
Definition: cursor_description.h:95
CursorDescriptionFrame(PixelBuffer pixelbuffer, Rect rect)
Constructs a CursorDescriptionFrame.
Definition: cursor_description.h:54
This class contains everything to construct a cursor - its data, default settings etc...
Definition: cursor_description.h:69
static CursorDescription load(GraphicContext &gc, const std::string &resource_id, const XMLResourceDocument &doc, const ImageImportDescription &import_desc=ImageImportDescription())
Loads a CursorDescription from a XML resource definition.
bool operator!=(const CursorDescription &that) const
Definition: cursor_description.h:92
void set_hotspot(const Point &hotspot)
Sets the offset of where the cursor is drawn relative to the cursor image.
Interface to drawing graphics.
Definition: graphic_context.h:256
2D (x,y) point structure - Integer
Definition: point.h:61
bool operator>=(const CursorDescription &that) const
Definition: cursor_description.h:96
XML Resource Document.
Definition: xml_resource_document.h:47
bool operator<(const CursorDescription &that) const
Definition: cursor_description.h:93
void add_frame(const PixelBuffer &pixelbuffer)
Adds a single image.
This class describes a single frame in a cursor description.
Definition: cursor_description.h:45