Functions

Score drawing and pages formating
[Guido Engine Adapter]

Functions

GuidoErrCode onDraw (GuidoOnDrawDesc *desc)
 Draws one page of score into a graphic device.
GuidoErrCode gr2SVG (const GRHandler handle, int page, std::ostream &out, bool embedFont=true, const char *font=0, const int mappingMode=0)
 Exports one page of score to SVG.
std::string gr2SVG (const GRHandler handle, int page, bool embedFont=true, const int mappingMode=0)
 Exports one page of score to SVG.
GuidoErrCode abstractExport (const GRHandler handle, int page, std::ostream &out)
 Exports an abstract representation of GUIDO draw commands.
std::string abstractExport (const GRHandler handle, int page)
 Exports an abstract representation of GUIDO draw commands.
GuidoErrCode binaryExport (const GRHandler handle, int page, std::ostream &out)
 Exports an representation of GUIDO draw commands in a data-reduced dsl.
std::string binaryExport (const GRHandler handle, int page)
 Exports an representation of GUIDO draw commands in a data-reduced dsl.
void setDrawBoundingBoxes (int bbMap)
 Control bounding boxes drawing.
int getDrawBoundingBoxes ()
 Gives bounding boxes drawing state.
GuidoPageFormat getPageFormat (CGRHandler inHandleGR, int pageNum)
 Gives a score page format.
void setDefaultPageFormat (const GuidoPageFormat &format)
 Sets the default score page format.
GuidoPageFormat getDefaultPageFormat ()
 Gives the default score page format.
float unit2CM (float val)
 Converts internal Guido units into centimeters.
float cm2Unit (float val)
 Converts centimeters into internal Guido units.
float unit2Inches (float val)
 Converts internal Guido units into inches.
float inches2Unit (float val)
 Converts inches into internal Guido units.
GuidoErrCode resizePageToMusic (GRHandler inHandleGR)
 Resize the page sizes to the music size.

Detailed Description

The GuidoEngine makes use of internal units for graphic operations. The functions that query or set graphic dimensions always makes use of this internal unit. Conversion functions are provided to convert to standard units.


Function Documentation

GuidoErrCode onDraw ( GuidoOnDrawDesc desc ) [inherited]

Draws one page of score into a graphic device.

Parameters:
descinformations about what to draw and how to draw.
Returns:
a Guido error code
GuidoErrCode gr2SVG ( const GRHandler  handle,
int  page,
std::ostream &  out,
bool  embedFont = true,
const char *  font = 0,
const int  mappingMode = 0 
) [inherited]

Exports one page of score to SVG.

Parameters:
handlea graphic representation.
pagethe page number.
outthe output stream.
embedFontif true, it use a embbed guido font and add it to the SVG.
fontpath of the guido svg font file or an svg font in text representation. Can be use if embedFont is set to false else it is unnecessary. If the library is compiled with INDEPENDENTSVG option, don't use a font file. The library cannot calculate font metric. You have better to use embedded font.
mappingModethe mapping mode (see mapping mode enum).
Returns:
a Guido error code
std::string gr2SVG ( const GRHandler  handle,
int  page,
bool  embedFont = true,
const int  mappingMode = 0 
) [inherited]

Exports one page of score to SVG.

Parameters:
handlea graphic representation.
pagethe page number.
embedFontif true, it use a embbed guido font and add it to the SVG.
mappingModethe mapping mode (see mapping mode enum).
Returns:
a Guido error code
GuidoErrCode abstractExport ( const GRHandler  handle,
int  page,
std::ostream &  out 
) [inherited]

Exports an abstract representation of GUIDO draw commands.

Parameters:
handlea graphic representation.
pagethe page number.
outthe output stream.
Returns:
a Guido error code
std::string abstractExport ( const GRHandler  handle,
int  page 
) [inherited]

Exports an abstract representation of GUIDO draw commands.

Parameters:
handlea graphic representation.
pagethe page number.
Returns:
the export in a string
GuidoErrCode binaryExport ( const GRHandler  handle,
int  page,
std::ostream &  out 
) [inherited]

Exports an representation of GUIDO draw commands in a data-reduced dsl.

Parameters:
handlea graphic representation.
pagethe page number.
outthe output stream.
Returns:
a Guido error code
std::string binaryExport ( const GRHandler  handle,
int  page 
) [inherited]

Exports an representation of GUIDO draw commands in a data-reduced dsl.

Parameters:
handlea graphic representation.
pagethe page number.
Returns:
a Guido error code
void setDrawBoundingBoxes ( int  bbMap ) [inherited]

Control bounding boxes drawing.

Parameters:
bbMapa bits field indicating the set of bounding boxes to draw (default to none).
int getDrawBoundingBoxes (  ) [inherited]

Gives bounding boxes drawing state.

Returns:
the bit field.
GuidoPageFormat getPageFormat ( CGRHandler  inHandleGR,
int  pageNum 
) [inherited]

Gives a score page format.

Parameters:
inHandleGRa Guido opaque handle to a GR structure.
pageNuma page number.
Returns:
the page format
void setDefaultPageFormat ( const GuidoPageFormat format ) [inherited]

Sets the default score page format.

The default page format is used when no \pageFormat tag is present. Parameters are Guido internal units. Default values for the default page format are:

  • paper size: A4
  • left margin: 2cm
  • right margin: 2cm
  • top margin: 5cm
  • bottom margin: 3cm
Parameters:
formatthe page format
GuidoPageFormat getDefaultPageFormat (  ) [inherited]

Gives the default score page format.

Returns:
the page format
float unit2CM ( float  val ) [inherited]

Converts internal Guido units into centimeters.

Parameters:
valthe value to be converted
Returns:
the converted value
float cm2Unit ( float  val ) [inherited]

Converts centimeters into internal Guido units.

Parameters:
valthe value to be converted
Returns:
the converted value
float unit2Inches ( float  val ) [inherited]

Converts internal Guido units into inches.

Parameters:
valthe value to be converted
Returns:
the converted value
float inches2Unit ( float  val ) [inherited]

Converts inches into internal Guido units.

Parameters:
valthe value to be converted
Returns:
the converted value
GuidoErrCode resizePageToMusic ( GRHandler  inHandleGR ) [inherited]

Resize the page sizes to the music size.

Parameters:
inHandleGRa Guido opaque handle to a GR structure.
Returns:
a Guido error code.