FLTK Imago
Main Page | Class List | File List | Class Members | File Members

Fl_SVG_Image Class Reference

#include <Fl_SVG_Image.H>

List of all members.

Public Member Functions

IMAGO_EXPORT Fl_SVG_Image (const char *bits, size_t len, int W=0, int H=0)
IMAGO_EXPORT Fl_SVG_Image (const char *filename, int W=0, int H=0)
virtual IMAGO_EXPORT ~Fl_SVG_Image ()
IMAGO_EXPORT int pt_width () const
IMAGO_EXPORT int pt_height () const
IMAGO_EXPORT void size (int W, int H)
IMAGO_EXPORT void destroy ()
IMAGO_EXPORT int svgdata (const char *data, size_t len)
virtual IMAGO_EXPORT void draw (int XP, int YP, int WP, int HP, int cx, int cy)
IMAGO_EXPORT bool hit (int at_x, int at_y, int thresh=1)

Static Protected Member Functions

char * decompGZ (const char *in, size_t size)


Constructor & Destructor Documentation

Fl_SVG_Image::Fl_SVG_Image const char *  bits,
size_t  len,
int  W = 0,
int  H = 0
 

Constructor for user provided data. The main difference between this and a normal image is that SVG images do not have any specific size and the size can be specified here.

Parameters:
bits SVG file data. This can be SVG XML text or SVGZ gzip format.
len Length of bits
W Initial width
H Initial height

Fl_SVG_Image::Fl_SVG_Image const char *  filename,
int  W = 0,
int  H = 0
 

Constructor for reading from file.

Parameters:
filename SVG file to read. Supports SVGZ gzip or SVG text format.
W Initial width
H Initial height

Fl_SVG_Image::~Fl_SVG_Image  )  [virtual]
 

Destructor


Member Function Documentation

char * Fl_SVG_Image::decompGZ const char *  in,
size_t  size
[static, protected]
 

GZip decompressor used for SVGZ files

Parameters:
in Input data (compressed with gzip)
size Length of input data
Returns:
Returns SVG text file (be sure to delete [] it) or null if error

void Fl_SVG_Image::destroy  ) 
 

This "cleans" the current state. Freeing any memory, etc.

void Fl_SVG_Image::draw int  XP,
int  YP,
int  WP,
int  HP,
int  cx,
int  cy
[virtual]
 

FLTK draw() method. Rebuilds the image if the dimensions have changed. SVG allows clean scaling to any size.

This caches the generated image so that the SVG data does not need to be reparsed and rescaled every time the image is drawn.

Parameters:
XP X position
YP Y position
WP Draw width
HP Draw height
cx ?? fltk option.. maybe clip x?
cy ?? fltk option.. maybe clip y?

bool Fl_SVG_Image::hit int  at_x,
int  at_y,
int  thresh = 1
 

Tests to see if a particular x/y coordinate "hit" the image in a non- transparent part. It might be worthwhile to make this inline by moving it to the header.

Parameters:
at_x X coordinate
at_y Y coordinate
thresh Alpha threshold (0-255; 255 is fully opaque; 1 is default)

IMAGO_EXPORT int Fl_SVG_Image::pt_height  )  const [inline]
 

IMAGO_EXPORT int Fl_SVG_Image::pt_width  )  const [inline]
 

IMAGO_EXPORT void Fl_SVG_Image::size int  W,
int  H
[inline]
 

int Fl_SVG_Image::svgdata const char *  data,
size_t  len
 

Parses the SVG data to be used in generating the image.

Parameters:
data SVG text (gzip or plain text XML)
len Length of SVG text
Returns:
0 on success


The documentation for this class was generated from the following files:
Generated on Mon Jan 10 16:50:18 2005 for FLTK Imago by doxygen 1.3.7