libSBML C API  5.18.0
Image_t Class Reference

Detailed Description

render Representation of images.

The image class represents a bitmap image representation. It is derived from Transformation2D_t and inherits all its attributes.

There is an attribute that can be used to specify a file URL where that specifies where the image data can be found. If the URL is a relative path, it is considered to be relative to the document that contains the render extension info. The path should be the location of a JPEG or PNG image, other image formats are currently not supported by the SBML Level 3 Render package.

Additionally it provides an id attribute as well as attributes that determine the dimensions and the position of the image relative to its viewport.

Public Member Functions

Image_tImage_clone (const Image_t *i)
 Creates and returns a deep copy of this Image_t object. More...
 
Image_tImage_create (unsigned int level, unsigned int version, unsigned int pkgVersion)
 Creates a new Image_t using the given SBML Level, Version and “render” package version. More...
 
void Image_free (Image_t *i)
 Frees this Image_t object. More...
 
RelAbsVector_tImage_getHeight (const Image_t *i)
 Returns the value of the "height" element of this Image_t. More...
 
char * Image_getHref (const Image_t *i)
 Returns the value of the "href" attribute of this Image_t. More...
 
char * Image_getId (const Image_t *i)
 Returns the value of the "id" attribute of this Image_t. More...
 
RelAbsVector_tImage_getWidth (const Image_t *i)
 Returns the value of the "width" element of this Image_t. More...
 
RelAbsVector_tImage_getX (const Image_t *i)
 Returns the value of the "x" element of this Image_t. More...
 
RelAbsVector_tImage_getY (const Image_t *i)
 Returns the value of the "y" element of this Image_t. More...
 
RelAbsVector_tImage_getZ (const Image_t *i)
 Returns the value of the "z" element of this Image_t. More...
 
int Image_hasRequiredAttributes (const Image_t *i)
 Predicate returning 1 (true) if all the required attributes for this Image_t object have been set. More...
 
int Image_isSetHeight (const Image_t *i)
 Predicate returning 1 (true) if this Image_t's "height" element is set. More...
 
int Image_isSetHref (const Image_t *i)
 Predicate returning 1 (true) if this Image_t's "href" attribute is set. More...
 
int Image_isSetId (const Image_t *i)
 Predicate returning 1 (true) if this Image_t's "id" attribute is set. More...
 
int Image_isSetWidth (const Image_t *i)
 Predicate returning 1 (true) if this Image_t's "width" element is set. More...
 
int Image_isSetX (const Image_t *i)
 Predicate returning 1 (true) if this Image_t's "x" element is set. More...
 
int Image_isSetY (const Image_t *i)
 Predicate returning 1 (true) if this Image_t's "y" element is set. More...
 
int Image_isSetZ (const Image_t *i)
 Predicate returning 1 (true) if this Image_t's "z" element is set. More...
 
int Image_setHeight (Image_t *i, const RelAbsVector_t *height)
 Sets the value of the "height" element of this Image_t. More...
 
int Image_setHref (Image_t *i, const char *href)
 Sets the value of the "href" attribute of this Image_t. More...
 
int Image_setId (Image_t *i, const char *id)
 Sets the value of the "id" attribute of this Image_t. More...
 
int Image_setWidth (Image_t *i, const RelAbsVector_t *width)
 Sets the value of the "width" element of this Image_t. More...
 
int Image_setX (Image_t *i, const RelAbsVector_t *x)
 Sets the value of the "x" element of this Image_t. More...
 
int Image_setY (Image_t *i, const RelAbsVector_t *y)
 Sets the value of the "y" element of this Image_t. More...
 
int Image_setZ (Image_t *i, const RelAbsVector_t *z)
 Sets the value of the "z" element of this Image_t. More...
 
int Image_unsetHeight (Image_t *i)
 Unsets the value of the "height" element of this Image_t. More...
 
int Image_unsetHref (Image_t *i)
 Unsets the value of the "href" attribute of this Image_t. More...
 
int Image_unsetId (Image_t *i)
 Unsets the value of the "id" attribute of this Image_t. More...
 
int Image_unsetWidth (Image_t *i)
 Unsets the value of the "width" element of this Image_t. More...
 
int Image_unsetX (Image_t *i)
 Unsets the value of the "x" element of this Image_t. More...
 
int Image_unsetY (Image_t *i)
 Unsets the value of the "y" element of this Image_t. More...
 
int Image_unsetZ (Image_t *i)
 Unsets the value of the "z" element of this Image_t. More...
 

Member Function Documentation

Image_t * Image_clone ( const Image_t i)

Creates and returns a deep copy of this Image_t object.

Parameters
ithe Image_t structure.
Returns
a (deep) copy of this Image_t object.
Warning
The pointer that is returned by this function is owned by the caller, who is responsible for deleting it. Any changes made to the element will not be reflected in any resulting SBML document unless the element is added to an SBML Document. Even in this case, the element's deletion is still the responsibility of the caller with two exceptions: if it is used as the "disownedItem" in the ListOf_appendAndOwn() or ListOf_insertAndOwn() functions. All other functions in libsbml add a copy of the element, and do not transfer ownership of the pointer.
Image_t * Image_create ( unsigned int  level,
unsigned int  version,
unsigned int  pkgVersion 
)

Creates a new Image_t using the given SBML Level, Version and “render” package version.

Parameters
levelan unsigned int, the SBML Level to assign to this Image_t.
versionan unsigned int, the SBML Version to assign to this Image_t.
pkgVersionan unsigned int, the SBML Render Version to assign to this Image_t.
Note
Attempting to add an object to an SBMLDocument_t having a different combination of SBML Level, Version and XML namespaces than the object itself will result in an error at the time a caller attempts to make the addition. A parent object must have compatible Level, Version and XML namespaces. (Strictly speaking, a parent may also have more XML namespaces than a child, but the reverse is not permitted.) The restriction is necessary to ensure that an SBML model has a consistent overall structure. This requires callers to manage their objects carefully, but the benefit is increased flexibility in how models can be created by permitting callers to create objects bottom-up if desired. In situations where objects are not yet attached to parents (e.g., SBMLDocument_t), knowledge of the intented SBML Level and Version help libSBML determine such things as whether it is valid to assign a particular value to an attribute. For packages, this means that the parent object to which this package element is being added must have been created with the package namespace, or that the package namespace was added to it, even if that parent is not a package object itself.
Warning
The pointer that is returned by this function is owned by the caller, who is responsible for deleting it. Any changes made to the element will not be reflected in any resulting SBML document unless the element is added to an SBML Document. Even in this case, the element's deletion is still the responsibility of the caller with two exceptions: if it is used as the "disownedItem" in the ListOf_appendAndOwn() or ListOf_insertAndOwn() functions. All other functions in libsbml add a copy of the element, and do not transfer ownership of the pointer.
void Image_free ( Image_t i)

Frees this Image_t object.

Parameters
ithe Image_t structure.
RelAbsVector_t * Image_getHeight ( const Image_t i)

Returns the value of the "height" element of this Image_t.

Parameters
ithe Image_t structure whose height is sought.
Returns
the value of the "height" element of this Image_t as a RelAbsVector_t.
char * Image_getHref ( const Image_t i)

Returns the value of the "href" attribute of this Image_t.

Parameters
ithe Image_t structure whose href is sought.
Returns
the value of the "href" attribute of this Image_t as a pointer to a string.
Warning
The string returned by this function is owned by the caller, who is responsible for deleting it. Any changes made to the string will not be reflected in any resulting SBML document unless the string is added to an SBML Document. Even in this case, the string should be deleted, as adding a string to an SBML Document adds a copy of the string, and does not transfer ownership of that string.
char * Image_getId ( const Image_t i)

Returns the value of the "id" attribute of this Image_t.

Parameters
ithe Image_t structure whose id is sought.
Returns
the value of the "id" attribute of this Image_t as a pointer to a string.
Warning
The string returned by this function is owned by the caller, who is responsible for deleting it. Any changes made to the string will not be reflected in any resulting SBML document unless the string is added to an SBML Document. Even in this case, the string should be deleted, as adding a string to an SBML Document adds a copy of the string, and does not transfer ownership of that string.
RelAbsVector_t * Image_getWidth ( const Image_t i)

Returns the value of the "width" element of this Image_t.

Parameters
ithe Image_t structure whose width is sought.
Returns
the value of the "width" element of this Image_t as a RelAbsVector_t.
RelAbsVector_t * Image_getX ( const Image_t i)

Returns the value of the "x" element of this Image_t.

Parameters
ithe Image_t structure whose x is sought.
Returns
the value of the "x" element of this Image_t as a RelAbsVector_t.
RelAbsVector_t * Image_getY ( const Image_t i)

Returns the value of the "y" element of this Image_t.

Parameters
ithe Image_t structure whose y is sought.
Returns
the value of the "y" element of this Image_t as a RelAbsVector_t.
RelAbsVector_t * Image_getZ ( const Image_t i)

Returns the value of the "z" element of this Image_t.

Parameters
ithe Image_t structure whose z is sought.
Returns
the value of the "z" element of this Image_t as a RelAbsVector_t.
int Image_hasRequiredAttributes ( const Image_t i)

Predicate returning 1 (true) if all the required attributes for this Image_t object have been set.

Parameters
ithe Image_t structure.
Returns
1 (true) to indicate that all the required attributes of this Image_t have been set, otherwise 0 (false) is returned.
Note
The required attributes for the Image_t object are:
  • "href"
  • "x"
  • "y"
  • "width"
  • "height"
int Image_isSetHeight ( const Image_t i)

Predicate returning 1 (true) if this Image_t's "height" element is set.

Parameters
ithe Image_t structure.
Returns
1 (true) if this Image_t's "height" element has been set, otherwise 0 (false) is returned.
int Image_isSetHref ( const Image_t i)

Predicate returning 1 (true) if this Image_t's "href" attribute is set.

Parameters
ithe Image_t structure.
Returns
1 (true) if this Image_t's "href" attribute has been set, otherwise 0 (false) is returned.
int Image_isSetId ( const Image_t i)

Predicate returning 1 (true) if this Image_t's "id" attribute is set.

Parameters
ithe Image_t structure.
Returns
1 (true) if this Image_t's "id" attribute has been set, otherwise 0 (false) is returned.
int Image_isSetWidth ( const Image_t i)

Predicate returning 1 (true) if this Image_t's "width" element is set.

Parameters
ithe Image_t structure.
Returns
1 (true) if this Image_t's "width" element has been set, otherwise 0 (false) is returned.
int Image_isSetX ( const Image_t i)

Predicate returning 1 (true) if this Image_t's "x" element is set.

Parameters
ithe Image_t structure.
Returns
1 (true) if this Image_t's "x" element has been set, otherwise 0 (false) is returned.
int Image_isSetY ( const Image_t i)

Predicate returning 1 (true) if this Image_t's "y" element is set.

Parameters
ithe Image_t structure.
Returns
1 (true) if this Image_t's "y" element has been set, otherwise 0 (false) is returned.
int Image_isSetZ ( const Image_t i)

Predicate returning 1 (true) if this Image_t's "z" element is set.

Parameters
ithe Image_t structure.
Returns
1 (true) if this Image_t's "z" element has been set, otherwise 0 (false) is returned.
int Image_setHeight ( Image_t i,
const RelAbsVector_t height 
)

Sets the value of the "height" element of this Image_t.

Parameters
ithe Image_t structure.
heightRelAbsVector_t value of the "height" element to be set.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int Image_setHref ( Image_t i,
const char *  href 
)

Sets the value of the "href" attribute of this Image_t.

Parameters
ithe Image_t structure.
hrefconst char * value of the "href" attribute to be set.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are: Calling this function with href = NULL or an empty string is equivalent to calling Image_unsetHref().
int Image_setId ( Image_t i,
const char *  id 
)

Sets the value of the "id" attribute of this Image_t.

Parameters
ithe Image_t structure.
idconst char * value of the "id" attribute to be set.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are: Calling this function with id = NULL or an empty string is equivalent to calling Image_unsetId().
int Image_setWidth ( Image_t i,
const RelAbsVector_t width 
)

Sets the value of the "width" element of this Image_t.

Parameters
ithe Image_t structure.
widthRelAbsVector_t value of the "width" element to be set.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int Image_setX ( Image_t i,
const RelAbsVector_t x 
)

Sets the value of the "x" element of this Image_t.

Parameters
ithe Image_t structure.
xRelAbsVector_t value of the "x" element to be set.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int Image_setY ( Image_t i,
const RelAbsVector_t y 
)

Sets the value of the "y" element of this Image_t.

Parameters
ithe Image_t structure.
yRelAbsVector_t value of the "y" element to be set.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int Image_setZ ( Image_t i,
const RelAbsVector_t z 
)

Sets the value of the "z" element of this Image_t.

Parameters
ithe Image_t structure.
zRelAbsVector_t value of the "z" element to be set.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int Image_unsetHeight ( Image_t i)

Unsets the value of the "height" element of this Image_t.

Parameters
ithe Image_t structure.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int Image_unsetHref ( Image_t i)

Unsets the value of the "href" attribute of this Image_t.

Parameters
ithe Image_t structure.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int Image_unsetId ( Image_t i)

Unsets the value of the "id" attribute of this Image_t.

Parameters
ithe Image_t structure.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int Image_unsetWidth ( Image_t i)

Unsets the value of the "width" element of this Image_t.

Parameters
ithe Image_t structure.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int Image_unsetX ( Image_t i)

Unsets the value of the "x" element of this Image_t.

Parameters
ithe Image_t structure.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int Image_unsetY ( Image_t i)

Unsets the value of the "y" element of this Image_t.

Parameters
ithe Image_t structure.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
int Image_unsetZ ( Image_t i)

Unsets the value of the "z" element of this Image_t.

Parameters
ithe Image_t structure.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are: