uicore::StagingTexture Class Referenceabstract

Texture Transfer class. More...

#include <staging_texture.h>

+ Inheritance diagram for uicore::StagingTexture:

Public Member Functions

virtual void lock (const GraphicContextPtr &gc, BufferAccess access)=0
 Maps buffer into system memory. More...
 
virtual void unlock ()=0
 Unmaps buffer. More...
 
virtual void upload_data (const GraphicContextPtr &gc, const Rect &dest_rect, const void *data)=0
 Uploads data to buffer. More...
 
- Public Member Functions inherited from uicore::PixelBuffer
unsigned int bytes_per_block () const
 Returns the number of bytes per compression block. More...
 
unsigned int bytes_per_pixel () const
 Returns the number of bytes per pixel. More...
 
std::shared_ptr< PixelBuffercopy () const
 Create a copy of the pixelbuffer that doesn't share data with the original pixel buffer. More...
 
std::shared_ptr< PixelBuffercopy (const Rect &rect) const
 
virtual void * data ()=0
 Returns a pointer to the beginning of the pixel buffer. More...
 
virtual const void * data () const =0
 
template<typename Type >
Type * data ()
 
template<typename Type >
const Type * data () const
 
unsigned int data_size () const
 Returns the size in bytes of the image data. More...
 
unsigned short * data_uint16 ()
 Returns a pointer to the beginning of the pixel buffer as 16 bit data. More...
 
const unsigned short * data_uint16 () const
 
unsigned int * data_uint32 ()
 Returns a pointer to the beginning of the pixel buffer as 32 bit data. More...
 
const unsigned int * data_uint32 () const
 
unsigned char * data_uint8 ()
 Returns a pointer to the beginning of the pixel buffer as 8 bit data. More...
 
const unsigned char * data_uint8 () const
 
float dip_height () const
 Returns the device independent height of this texture. More...
 
Sizef dip_size () const
 Returns the device independent size of this texture. More...
 
float dip_width () const
 Returns the device independent width of this texture. More...
 
void flip_vertical ()
 Flip the entire image vertically (turn it upside down) More...
 
virtual TextureFormat format () const =0
 Returns the pixel format. More...
 
bool has_transparency () const
 Returns true if format has an alpha channel. More...
 
virtual int height () const =0
 Retrieves the height of the buffer. More...
 
bool is_compressed () const
 Returns true if compressed. More...
 
void * line (int line)
 Returns a pointer to the beginning of a specific line. More...
 
const void * line (int line) const
 
template<typename T >
T * line (int line)
 
template<typename T >
const T * line (int line) const
 
unsigned short * line_uint16 (int index)
 Returns a pointer to the beginning of a specific line as 16 bit data. More...
 
const unsigned short * line_uint16 (int index) const
 
unsigned int * line_uint32 (int index)
 Returns a pointer to the beginning of a specific line as 32 bit data. More...
 
const unsigned int * line_uint32 (int index) const
 
unsigned char * line_uint8 (int index)
 Returns a pointer to the beginning of a specific line as 8 bit data. More...
 
const unsigned char * line_uint8 (int index) const
 
virtual int pitch () const =0
 Returns the pitch (bytes allocated per row). More...
 
virtual float pixel_ratio () const =0
 
void premultiply_alpha ()
 Multiply the RGB components by the Alpha component. More...
 
void premultiply_gamma (float gamma)
 Multiply the RGB components by gamma value. More...
 
void set_image (const std::shared_ptr< PixelBuffer > &source)
 Copy source pixel buffer into this buffer, doing a format conversion if needed. More...
 
void set_image (const std::shared_ptr< PixelBuffer > &source, const PixelConverterPtr &converter)
 Copy source pixel buffer into this buffer, doing a format conversion if needed. More...
 
virtual void set_pixel_ratio (float ratio)=0
 Sets the display pixel ratio for this image. More...
 
void set_subimage (const std::shared_ptr< PixelBuffer > &source, const Point &dest_pos, const Rect &src_rect)
 Copy source pixel buffer into this buffer, doing a format conversion if needed. More...
 
void set_subimage (const std::shared_ptr< PixelBuffer > &source, const Point &dest_pos, const Rect &src_rect, const PixelConverterPtr &converter)
 Copy source pixel buffer into this buffer, doing a format conversion if needed. More...
 
Size size () const
 Retrieves the size of the buffer. More...
 
std::shared_ptr< PixelBufferto_format (TextureFormat texture_format) const
 Converts current buffer to a new pixel format and returns the result. More...
 
std::shared_ptr< PixelBufferto_format (TextureFormat texture_format, const PixelConverterPtr &converter) const
 Converts current buffer to a new pixel format and returns the result. More...
 
virtual int width () const =0
 Retrieves the width of the buffer. More...
 

Static Public Member Functions

static std::shared_ptr< StagingTexturecreate (const GraphicContextPtr &gc, int width, int height, StagingDirection direction=StagingDirection::to_gpu, TextureFormat texture_format=tf_rgba8, const void *data=nullptr, BufferUsage usage=usage_stream_draw)
 Constructs a GPU Transfer Buffer. More...
 
static std::shared_ptr< StagingTexturecreate (const GraphicContextPtr &gc, const PixelBufferPtr &pbuff, StagingDirection direction=StagingDirection::to_gpu, BufferUsage usage=usage_stream_draw)
 
- Static Public Member Functions inherited from uicore::PixelBuffer
static std::shared_ptr< PixelBufferadd_border (const std::shared_ptr< PixelBuffer > &pb, int border_size, const Rect &rect)
 Add a border around a pixelbuffer, duplicating the edge pixels. More...
 
static unsigned int bytes_per_block (TextureFormat texture_format)
 Returns the number of bytes per compression block. More...
 
static unsigned int bytes_per_pixel (TextureFormat texture_format)
 Returns the number of bytes per pixel. More...
 
static std::shared_ptr< PixelBuffercreate (int width, int height, TextureFormat texture_format, const void *data=nullptr, bool only_reference_data=false)
 Constructs a PixelBuffer. More...
 
static unsigned int data_size (const Size &size, TextureFormat texture_format)
 Returns the size in bytes of the image data. More...
 
static bool is_compressed (TextureFormat texture_format)
 Tests if the specified texture format is a compressed format. More...
 

Detailed Description

Texture Transfer class.

Member Function Documentation

static std::shared_ptr<StagingTexture> uicore::StagingTexture::create ( const GraphicContextPtr gc,
int  width,
int  height,
StagingDirection  direction = StagingDirection::to_gpu,
TextureFormat  texture_format = tf_rgba8,
const void *  data = nullptr,
BufferUsage  usage = usage_stream_draw 
)
static

Constructs a GPU Transfer Buffer.

Parameters
gc= Graphic Context
width= value
height= value
direction= prefered direction that you will use tranferring the pixel buffer data
sized_format= Texture Format
data= data to copy from (May be nullptr)
usage= Buffer Usage
pbuff= The pixelbuffer to copy from
static std::shared_ptr<StagingTexture> uicore::StagingTexture::create ( const GraphicContextPtr gc,
const PixelBufferPtr pbuff,
StagingDirection  direction = StagingDirection::to_gpu,
BufferUsage  usage = usage_stream_draw 
)
static
virtual void uicore::StagingTexture::lock ( const GraphicContextPtr gc,
BufferAccess  access 
)
pure virtual

Maps buffer into system memory.

Locking before accessing data is only required for GPU based buffers.

virtual void uicore::StagingTexture::unlock ( )
pure virtual

Unmaps buffer.

virtual void uicore::StagingTexture::upload_data ( const GraphicContextPtr gc,
const Rect dest_rect,
const void *  data 
)
pure virtual

Uploads data to buffer.


The documentation for this class was generated from the following file: