|
libvisual
0.5.0
|
Canvas class for drawing operations. More...
#include <libvisual/lv_video.h>
Public Member Functions | |
| Video (Video const &)=delete | |
| Video & | operator= (Video const &)=delete |
| ~Video () | |
| Destructor. | |
| int | get_width () const |
| Returns the video width. More... | |
| int | get_height () const |
| Returns the video height. More... | |
| void | set_depth (VisVideoDepth depth) |
| Sets the video depth. More... | |
| VisVideoDepth | get_depth () const |
| Returns the video depth. More... | |
| void | set_pitch (int pitch) |
| Sets the pixel pitch (or row stride). More... | |
| int | get_pitch () const |
| Returns the pitch. More... | |
| int | get_bpp () const |
| Returns the byte size of each pixel. More... | |
| bool | allocate_buffer () |
| Allocates a buffer based on the assigned dimensions and depth. More... | |
| void | free_buffer () |
| Frees the underlying pixel buffer. | |
| bool | has_allocated_buffer () const |
| Checks if this object has a private allocated buffer. More... | |
| BufferPtr | get_buffer () const |
| Retrieves the Buffer object. More... | |
| void | set_attrs (int width, int height, int pitch, VisVideoDepth depth) |
| Sets all attributes. More... | |
| void | copy_attrs (VideoConstPtr const &src) |
| Copies the attributes from another Video. More... | |
| bool | compare_attrs (VideoConstPtr const &src) const |
| Checks if this Video has the same attributes as another Video. More... | |
| bool | compare_attrs_ignore_pitch (VideoConstPtr const &src) const |
| Checks if this Video has the same attributes as another Video, ignoring pitch comparisons. More... | |
| std::size_t | get_size () const |
| Returns the size of the pixel buffer. More... | |
| void | set_palette (Palette const &palette) |
| Sets the color palette. More... | |
| void | set_palette (Palette &&palette) |
| Sets the color palette. More... | |
| Palette const & | get_palette () const |
| Returns the color palette. More... | |
| Palette & | get_palette () |
| Returns the color palette. More... | |
| void * | get_pixels () const |
| Returns a pointer to the pixel buffer. More... | |
| void * | get_pixel_ptr (int x, int y) const |
| Returns a pointer to a specific location in the pixel buffer. More... | |
| Rect const & | get_extents () const |
| Returns the extents of this Video. More... | |
| void | set_extents (Rect area) |
| void | set_compose_type (VisVideoComposeType type) |
| void | set_compose_colorkey (Color const &color) |
| void | set_compose_surface (uint8_t alpha) |
| void | set_compose_function (VisVideoComposeFunc func) |
| VisVideoComposeFunc | get_compose_function (VideoConstPtr const &src, bool alpha) |
| void | blit (VideoConstPtr const &src, int x, int y, bool alpha) |
| Draws a Video. More... | |
| void | blit (Rect const &drect, VideoConstPtr const &src, Rect const &srect, bool alpha) |
| Draws a Video. More... | |
| void | compose (VideoConstPtr const &src, int x, int y, VisVideoComposeFunc func) |
| void | compose (Rect const &drect, VideoConstPtr const &src, Rect const &srect, VisVideoComposeFunc func) |
| void | blit_scale (Rect const &drect, VideoConstPtr const &src, Rect const &srect, bool alpha, VisVideoScaleMethod scale_method) |
| void | compose_scale (Rect const &drect, VideoConstPtr const &src, Rect const &srect, VisVideoScaleMethod scale_method, VisVideoComposeFunc func) |
| void | fill_alpha (uint8_t alpha) |
| Fills the entire pixel buffer with a constant alpha value. More... | |
| void | fill_alpha (uint8_t alpha, Rect const &area) |
| void | fill_color (Color const &color) |
| Performs a color fill. More... | |
| void | fill_color (Color const &color, Rect const &area) |
| void | flip_pixel_bytes (VideoConstPtr const &src) |
| Flips the pixel byte ordering of a video. More... | |
| void | rotate (VideoConstPtr const &src, VisVideoRotateDegrees degrees) |
| void | mirror (VideoConstPtr const &src, VisVideoMirrorOrient orient) |
| void | convert_depth (VideoConstPtr const &src) |
| Performs a depth conversion of a video. More... | |
| void | scale (VideoConstPtr const &src, VisVideoScaleMethod method) |
| Scales a video. More... | |
| void | scale_depth (VideoConstPtr const &src, VisVideoScaleMethod method) |
| Scales a video and performs a depth conversion where necessary. More... | |
Static Public Member Functions | |
| static VideoPtr | create () |
| Creates a new empty Video object. | |
| static VideoPtr | create (int width, int height, VisVideoDepth depth) |
| Creates a new Video object with an allocated buffer. More... | |
| static VideoPtr | wrap (void *buffer, bool owner, int width, int height, VisVideoDepth depth, int pitch=0) |
| static VideoPtr | create_sub (VideoConstPtr const &src, Rect const &srect) |
| static VideoPtr | create_sub (Rect const &drect, VideoConstPtr const &src, Rect const &srect) |
| static VideoPtr | create_from_file (std::string const &path) |
| Creates a new Video object from an image file. More... | |
| static VideoPtr | create_from_stream (std::istream &input) |
| Creates a new Video object from a input data stream. More... | |
| static VideoPtr | create_scale_depth (VideoConstPtr const &src, int width, int height, VisVideoDepth depth, VisVideoScaleMethod scale_method) |
Friends | |
| void | intrusive_ptr_add_ref (Video const *video) |
| void | intrusive_ptr_release (Video const *video) |
Canvas class for drawing operations.
Definition at line 133 of file lv_video.h.
| bool LV::Video::allocate_buffer | ( | ) |
Allocates a buffer based on the assigned dimensions and depth.
Definition at line 230 of file lv_video.cpp.
| void LV::Video::blit | ( | VideoConstPtr const & | src, |
| int | x, | ||
| int | y, | ||
| bool | alpha | ||
| ) |
Draws a Video.
| src | Video to draw |
| x | x-coordinate of draw position |
| y | y-coordinate of draw position |
| alpha | set to true if alpha channel is to be checked |
Definition at line 513 of file lv_video.cpp.
| void LV::Video::blit | ( | Rect const & | drect, |
| VideoConstPtr const & | src, | ||
| Rect const & | srect, | ||
| bool | alpha | ||
| ) |
Draws a Video.
| drect | Area to draw to |
| src | Video to draw |
| srect | Area of Video to draw |
| alpha | set to true if alpha channel is to be checked |
Definition at line 453 of file lv_video.cpp.
| bool LV::Video::compare_attrs | ( | VideoConstPtr const & | src | ) | const |
Checks if this Video has the same attributes as another Video.
| src | Video to compare against |
Definition at line 269 of file lv_video.cpp.
| bool LV::Video::compare_attrs_ignore_pitch | ( | VideoConstPtr const & | src | ) | const |
Checks if this Video has the same attributes as another Video, ignoring pitch comparisons.
| src | Video to compare against |
Definition at line 280 of file lv_video.cpp.
| void LV::Video::convert_depth | ( | VideoConstPtr const & | src | ) |
Performs a depth conversion of a video.
| src | source Video |
Definition at line 697 of file lv_video.cpp.
| void LV::Video::copy_attrs | ( | VideoConstPtr const & | src | ) |
Copies the attributes from another Video.
| src | Video object to copy attributes from |
Definition at line 262 of file lv_video.cpp.
|
static |
Creates a new Video object with an allocated buffer.
| width | The width for the new buffer. |
| height | The height for the new buffer. |
| depth | The depth being used. |
Definition at line 109 of file lv_video.cpp.
|
static |
Creates a new Video object from an image file.
| path | path to file to load |
Definition at line 181 of file lv_video.cpp.
|
static |
Creates a new Video object from a input data stream.
| input | input stream |
Definition at line 191 of file lv_video.cpp.
| void LV::Video::fill_alpha | ( | uint8_t | alpha | ) |
Fills the entire pixel buffer with a constant alpha value.
| alpha | alpha value for filling |
Definition at line 571 of file lv_video.cpp.
| void LV::Video::fill_color | ( | Color const & | color | ) |
| void LV::Video::flip_pixel_bytes | ( | VideoConstPtr const & | src | ) |
Flips the pixel byte ordering of a video.
| src | source Video |
Definition at line 628 of file lv_video.cpp.
| int LV::Video::get_bpp | ( | ) | const |
Returns the byte size of each pixel.
Definition at line 362 of file lv_video.cpp.
| BufferPtr LV::Video::get_buffer | ( | ) | const |
| VisVideoDepth LV::Video::get_depth | ( | ) | const |
| Rect const & LV::Video::get_extents | ( | ) | const |
| int LV::Video::get_height | ( | ) | const |
| Palette const & LV::Video::get_palette | ( | ) | const |
Returns the color palette.
Definition at line 305 of file lv_video.cpp.
Referenced by LV::Morph::run().
| Palette & LV::Video::get_palette | ( | ) |
| int LV::Video::get_pitch | ( | ) | const |
| void * LV::Video::get_pixel_ptr | ( | int | x, |
| int | y | ||
| ) | const |
Returns a pointer to a specific location in the pixel buffer.
Definition at line 389 of file lv_video.cpp.
| void * LV::Video::get_pixels | ( | ) | const |
Returns a pointer to the pixel buffer.
Definition at line 384 of file lv_video.cpp.
| std::size_t LV::Video::get_size | ( | ) | const |
Returns the size of the pixel buffer.
Definition at line 374 of file lv_video.cpp.
| int LV::Video::get_width | ( | ) | const |
| bool LV::Video::has_allocated_buffer | ( | ) | const |
Checks if this object has a private allocated buffer.
Definition at line 257 of file lv_video.cpp.
| void LV::Video::scale | ( | VideoConstPtr const & | src, |
| VisVideoScaleMethod | method | ||
| ) |
Scales a video.
| src | source Video |
| method | scaling method to use |
Definition at line 795 of file lv_video.cpp.
| void LV::Video::scale_depth | ( | VideoConstPtr const & | src, |
| VisVideoScaleMethod | method | ||
| ) |
Scales a video and performs a depth conversion where necessary.
| src | source Video |
| method | scaling method to use |
Definition at line 847 of file lv_video.cpp.
| void LV::Video::set_attrs | ( | int | width, |
| int | height, | ||
| int | pitch, | ||
| VisVideoDepth | depth | ||
| ) |
Sets all attributes.
| width | width in pixels |
| height | height in pixels |
| pitch | pitch (row stride) |
| depth | colour depth |
Definition at line 367 of file lv_video.cpp.
| void LV::Video::set_depth | ( | VisVideoDepth | depth | ) |
Sets the video depth.
| depth | video depth |
Definition at line 351 of file lv_video.cpp.
Referenced by create().
| void LV::Video::set_palette | ( | Palette const & | palette | ) |
| void LV::Video::set_palette | ( | Palette && | palette | ) |
| void LV::Video::set_pitch | ( | int | pitch | ) |
Sets the pixel pitch (or row stride).
| pitch | pitch in bytes |
Definition at line 336 of file lv_video.cpp.