CL_PixelBuffer Class Reference
[clanDisplay Display]

Pixel data container. More...

#include <pixel_buffer.h>

List of all members.

Public Member Functions

Construction
 CL_PixelBuffer ()
 Constructs a pixel buffer.
 CL_PixelBuffer (const CL_PixelBufferRef &other)
 Constructs a PixelBuffer.
 CL_PixelBuffer (int width, int height, int pitch, const CL_PixelFormat &format, const void *data=0)
 Constructs a PixelBuffer.
 CL_PixelBuffer (int width, int height, int pitch, const CL_PixelFormat &format, const CL_Palette &palette, const void *data=0)
 Constructs a PixelBuffer.
 CL_PixelBuffer (const CL_PixelBuffer &copy)
 Constructs a PixelBuffer.
 CL_PixelBuffer (const CL_StringRef &fullname)
 Constructs a PixelBuffer.
 CL_PixelBuffer (const CL_StringRef &filename, const CL_VirtualDirectory &dir)
 Constructs a PixelBuffer.
 CL_PixelBuffer (CL_IODevice &file, const CL_String &image_type)
 Constructs a PixelBuffer.
virtual ~CL_PixelBuffer ()
Attributes
bool is_null () const
 Returns true if the PixelBuffer doesn't contain any data.
CL_PixelBuffer copy () const
 Create a copy of the pixelbuffer that doesn't share data with the original pixel buffer.
const CL_PixelFormatget_format () const
 Returns the pixel format of the pixel buffer.
const CL_Paletteget_palette () const
 Returns the palette of the pixel buffer.
int get_width () const
 Returns the buffer width.
int get_height () const
 Returns the buffer height.
CL_Size get_size () const
 Returns the width and height of the buffer.
unsigned int get_pitch () const
 Returns the pitch (bytes per scanline).
void * get_data ()
 Returns a pointer to the beginning of the pixel buffer.
const void * get_data () const
CL_Color get_pixel (int x, int y)
 Returns the pixel at coordinates x and y.
CL_PixelBufferRef get_subimage (const CL_Rect &rect) const
 Returns a new pixel buffer, copying the area specified by rect.
Operations
CL_PixelBufferoperator= (const CL_PixelBuffer &copy)
 Copy assignment operator.
 operator bool () const
 Return true if the CL_PixelBuffer is valid and usable.
void convert (CL_PixelBuffer target) const
 Convert pixel buffer to the pixel format of the target buffer, storing the result in the target buffer.
void convert (void *buffer, const CL_PixelFormat &format, int dest_pitch, const CL_Rect &dest_rect, const CL_Rect &src_rect=CL_Rect(0, 0, 0, 0)) const
void convert_line (void *buffer, const CL_PixelFormat &format, int y) const
 Convert one line of pixel data to target buffer.
CL_PixelBuffer to_format (const CL_PixelFormat &format) const
 Converts current buffer to a new pixel format and returns the result.
void set_colorkey (bool enabled, unsigned int colorkey)
 Sets a new colorkey without converting the buffer.
void draw_pixel (int x, int y, const CL_Colorf &color)
 Draw a pixel at (x, y) using the specified color.
void flip_vertical ()
 Flip the entire image vertically (turn it upside down).


Detailed Description

Pixel data container.


Constructor & Destructor Documentation

CL_PixelBuffer::CL_PixelBuffer  ) 
 

Constructs a pixel buffer.

Parameters:
width Width of pixel buffer, in pixels.
height Height of pixel buffer, in pixels.
pitch Bytes per line in pixel buffer.
format Pixel format of pixel buffer.
palette Palette used in pixel buffer.
data Data pointer to pixel data. If null, will construct a memory pixel buffer with the given dimensions.

CL_PixelBuffer::CL_PixelBuffer const CL_PixelBufferRef other  ) 
 

Constructs a PixelBuffer.

Parameters:
other = Pixel Buffer Ref

CL_PixelBuffer::CL_PixelBuffer int  width,
int  height,
int  pitch,
const CL_PixelFormat format,
const void *  data = 0
 

Constructs a PixelBuffer.

Parameters:
width = value
height = value
pitch = value
format = Pixel Format
data = void

CL_PixelBuffer::CL_PixelBuffer int  width,
int  height,
int  pitch,
const CL_PixelFormat format,
const CL_Palette palette,
const void *  data = 0
 

Constructs a PixelBuffer.

Parameters:
width = value
height = value
pitch = value
format = Pixel Format
palette = Palette
data = void

CL_PixelBuffer::CL_PixelBuffer const CL_PixelBuffer copy  ) 
 

Constructs a PixelBuffer.

Parameters:
copy = Pixel Buffer

CL_PixelBuffer::CL_PixelBuffer const CL_StringRef fullname  ) 
 

Constructs a PixelBuffer.

Parameters:
fullname = String Ref

CL_PixelBuffer::CL_PixelBuffer const CL_StringRef filename,
const CL_VirtualDirectory dir
 

Constructs a PixelBuffer.

Parameters:
filename = String Ref
dir = Virtual Directory

CL_PixelBuffer::CL_PixelBuffer CL_IODevice file,
const CL_String image_type
 

Constructs a PixelBuffer.

Parameters:
file = IODevice
image_type = String

virtual CL_PixelBuffer::~CL_PixelBuffer  )  [virtual]
 


Member Function Documentation

void CL_PixelBuffer::convert void *  buffer,
const CL_PixelFormat format,
int  dest_pitch,
const CL_Rect dest_rect,
const CL_Rect src_rect = CL_Rect(0, 0, 0, 0)
const
 

void CL_PixelBuffer::convert CL_PixelBuffer  target  )  const
 

Convert pixel buffer to the pixel format of the target buffer, storing the result in the target buffer.

Parameters:
target Target pixel buffer.
buffer Buffer getting stored pixels in the specified format and pitch.
format Pixel format of target buffer.
dest_pitch Bytes per line of target buffer.
dest_rect Destination rectangle for conversion.
src_rect Source rectangle for conversion.

void CL_PixelBuffer::convert_line void *  buffer,
const CL_PixelFormat format,
int  y
const
 

Convert one line of pixel data to target buffer.

Parameters:
buffer Buffer getting stored pixels in the specified format
format Pixel format of target buffer.
y Specifies which line to convert when converting one single line.

CL_PixelBuffer CL_PixelBuffer::copy  )  const
 

Create a copy of the pixelbuffer that doesn't share data with the original pixel buffer.

void CL_PixelBuffer::draw_pixel int  x,
int  y,
const CL_Colorf color
 

Draw a pixel at (x, y) using the specified color.

void CL_PixelBuffer::flip_vertical  ) 
 

Flip the entire image vertically (turn it upside down).

const void* CL_PixelBuffer::get_data  )  const
 

void* CL_PixelBuffer::get_data  ) 
 

Returns a pointer to the beginning of the pixel buffer.

const CL_PixelFormat& CL_PixelBuffer::get_format  )  const
 

Returns the pixel format of the pixel buffer.

int CL_PixelBuffer::get_height  )  const
 

Returns the buffer height.

const CL_Palette* CL_PixelBuffer::get_palette  )  const
 

Returns the palette of the pixel buffer.

unsigned int CL_PixelBuffer::get_pitch  )  const
 

Returns the pitch (bytes per scanline).

CL_Color CL_PixelBuffer::get_pixel int  x,
int  y
 

Returns the pixel at coordinates x and y.

CL_Size CL_PixelBuffer::get_size  )  const
 

Returns the width and height of the buffer.

CL_PixelBufferRef CL_PixelBuffer::get_subimage const CL_Rect rect  )  const
 

Returns a new pixel buffer, copying the area specified by rect.

int CL_PixelBuffer::get_width  )  const
 

Returns the buffer width.

bool CL_PixelBuffer::is_null  )  const
 

Returns true if the PixelBuffer doesn't contain any data.

CL_PixelBuffer::operator bool  )  const
 

Return true if the CL_PixelBuffer is valid and usable.

CL_PixelBuffer& CL_PixelBuffer::operator= const CL_PixelBuffer copy  ) 
 

Copy assignment operator.

void CL_PixelBuffer::set_colorkey bool  enabled,
unsigned int  colorkey
 

Sets a new colorkey without converting the buffer.

Parameters:
enabled Enable or disable the colorkey.
colorkey New colorkey to use.

CL_PixelBuffer CL_PixelBuffer::to_format const CL_PixelFormat format  )  const
 

Converts current buffer to a new pixel format and returns the result.


The documentation for this class was generated from the following file:
Generated on Thu Dec 3 02:39:39 2009 for ClanLib by  doxygen 1.4.6