ClanSoft logo
ClanSoft logo

    CL_Target

Target class in ClanLib.

Description

The CL_Target class represents a renderer target in ClanLib. This can be a part of the framebuffer, or a piece of memory specified by the application.

This class contains a set of functions used to describe a piece of memory, things such as the width, height, color masks and depth. This information can then be used by ClanLib or the application to access the given piece of memory.

To access the memory itself, call get_data() after a call to lock(). When you are finished accessing the memory, call unlock(). Note that after the unlock() call, the pointer obtained from get_data() will be invalid, and new call to lock() is required before get_data() will return anything valid.

CL_Target contain a set of functions doing simple primitive operations: draw boxes, lines and clipping. These are provided for convience so you won't have to do such simple things manually in a lock session.

CL_Surface supports blitting to a target and all surface providers are inheritated from a target. This means that you can do surface to provider blitting. ClanLib has a special surface provider called CL_Canvas which you should use to easilly build a new image.

Class members

virtual ~CL_Target()
virtual bool is_video()
virtual void lock()
virtual void unlock()
virtual void *get_data()
virtual unsigned int get_num_frames()
virtual unsigned int get_width()
virtual unsigned int get_height()
virtual unsigned int get_pitch()
virtual unsigned int get_depth()
virtual unsigned int get_bytes_per_pixel()
virtual bool is_indexed()
virtual unsigned int get_red_mask()
virtual unsigned int get_green_mask()
virtual unsigned int get_blue_mask()
virtual unsigned int get_alpha_mask()
virtual CL_Palette *get_palette()
virtual void push_clip_rect()
virtual void push_clip_rect(const CL_ClipRect &rect)
virtual CL_ClipRect get_clip_rect()
virtual void set_clip_rect(const CL_ClipRect &rect)
virtual void pop_clip_rect()
void draw_pixel( int x1, int y1, int color)
virtual void draw_pixel( int x, int y, float r, float g, float b, float a = 1.0)
virtual void get_pixel( int x, int y, float *r, float *g, float *b, float *a)
virtual int get_pixel( int x, int y)
virtual void fill_rect( int x1, int y1, int x2, int y2, float r, float g, float b, float a = 1.0)
virtual void draw_line( int x1, int y1, int x2, int y2, float r, float g, float b, float a = 1.0)

See Also

None


Back to index



This page was built using the Perceps documentation system.