Graphics.h File Reference


Detailed Description

A translation/clipping stack for MoSync graphics.

This file contains a set of graphics functions that closely mirror the ones available as MoSync syscalls. However, these functions make use of a transformation stack similar to ones commonly found in other graphics libraries. It simplifies managing transformations, removing the need to manually keep track of the current transformation state. Currently, only translation is supported.

Author:
Patrick Broman

#include <ma.h>

Defines

#define _NO_OLDNAMES

Functions

void Gfx_clearClipRect (void)
int Gfx_restoreClipRect (void)
int Gfx_pushClipRect (int left, int top, int width, int height)
int Gfx_intersectClipRect (int left, int top, int width, int height)
int Gfx_popClipRect (void)
void Gfx_clearMatrix (void)
void Gfx_pushMatrix (void)
void Gfx_popMatrix (void)
void Gfx_translate (int x, int y)
MAPoint2d Gfx_getTranslation (void)
int Gfx_pushRect (int x, int y, int width, int height)
int Gfx_popRect (void)
void Gfx_plot (int x, int y)
void Gfx_line (int x1, int y1, int x2, int y2)
void Gfx_fillRect (int left, int top, int width, int height)
void Gfx_drawText (int left, int top, const char *text)
void Gfx_drawImage (MAHandle image, int left, int top)
void Gfx_drawRGB (const MAPoint2d *dstPoint, const void *src, const MARect *srcRect, int scanlength)
void Gfx_drawImageRegion (MAHandle image, const MARect *srcRect, const MAPoint2d *dstPoint, int transformMode)


Define Documentation

#define _NO_OLDNAMES
 


Function Documentation

void Gfx_clearClipRect void   ) 
 

Clears the clip rect stack.

int Gfx_restoreClipRect void   ) 
 

Sets the clip rect to the content of the top of the stack without changing the stack. Returns true if the area of the restored clip rect is > 0, otherwise false.

int Gfx_pushClipRect int  left,
int  top,
int  width,
int  height
 

Pushes the specified clip rect on the stack and sets it as the current. Returns true if the area of the clip rect is > 0, otherwise false.

int Gfx_intersectClipRect int  left,
int  top,
int  width,
int  height
 

Computes the intersection rectangle of the specified clip rect and the current, pushing the result on the stack. Returns true if the area of the resulting clip rect is > 0, otherwise false.

int Gfx_popClipRect void   ) 
 

Pops a clip rect off the stack and sets is as the current. Returns true if the area of the resulting clip rect is > 0, otherwise false.

void Gfx_clearMatrix void   ) 
 

Clears the transform stack.

void Gfx_pushMatrix void   ) 
 

Pushes the current transform on the stack

void Gfx_popMatrix void   ) 
 

Pops the previous transform off the stack

void Gfx_translate int  x,
int  y
 

Translates the current transform by x,y

MAPoint2d Gfx_getTranslation void   ) 
 

int Gfx_pushRect int  x,
int  y,
int  width,
int  height
 

Combines clipping and translation.

See also:
Gfx_intersectClipRect()

int Gfx_popRect void   ) 
 

See also:
Gfx_popClipRect()

void Gfx_plot int  x,
int  y
 

Plots a pixel with the current color at x, y with respect to the current transform

void Gfx_line int  x1,
int  y1,
int  x2,
int  y2
 

Draws a line with the current color from x1, y1 to x2, y2 with respect to the current transform

void Gfx_fillRect int  left,
int  top,
int  width,
int  height
 

Draws a line with the current color from x1, y1 to x2, y2 with respect to the current transform

void Gfx_drawText int  left,
int  top,
const char *  text
 

void Gfx_drawImage MAHandle  image,
int  left,
int  top
 

void Gfx_drawRGB const MAPoint2d dstPoint,
const void *  src,
const MARect srcRect,
int  scanlength
 

void Gfx_drawImageRegion MAHandle  image,
const MARect srcRect,
const MAPoint2d dstPoint,
int  transformMode
 


Generated on Sat Feb 13 00:15:38 2010 for MoSync 2 beta 1 by  doxygen 1.4.6-NO