RImage

class RImage()

This adds a position attribute as a dyanmicProperty, for use as a mixin with objects that have x and y attributes.

box

Deprecated: use Image.bounds

brightness

Brightness value of the image.

contrast

Contras value of the image.

saturation

Saturation value of the image.

sharpness

Sharpness value of the image.

changed()

Tell the environment that something has changed in the object. The behavior of this method will vary from environment to environment. :

obj.changed()

updateSelection(sender)

Update the selection.

addObserver(observer, methodName, notification)

Add an observer object. that will receive notification for the given methodName.

getRepresentation(name, **kwargs)

Get a representation by name.

Optionally arguments could be provided if the representation factory requires arguments.

performUndo()

Create a undo item and add it the the undo manager.

prepareUndo(undoTitle='')

Save the current state of the object.

removeObserver(observer, notification)

Remove an observer object for a notification.

Inherits from subclass: fontParts.fontshell.image.RImage

color

The image’s color. This will be a color or None. :

>>> image.color
None
>>> image.color = (1, 0, 0, 0.5)

copyAttributes

data

The image’s raw byte data. The possible formats are defined by each environment.

font

The image’s parent BaseFont.

glyph

The image’s parent BaseGlyph.

offset

The image’s offset. This is a shortcut to the offset values in transformation. This must be an iterable containing two integer/float values defining the x and y values to offset the image by. :

>>> image.offset
(0, 0)
>>> image.offset = (100, -50)

scale

The image’s scale. This is a shortcut to the scale values in transformation. This must be an iterable containing two integer/float values defining the x and y values to scale the image by. :

>>> image.scale
(1, 1)
>>> image.scale = (2, 2)

transformation

The image’s transformation. This defines the image’s position, scale, and rotation. :

>>> image.transformation
(1, 0, 0, 1, 0, 0)
>>> image.transformation = (2, 0, 0, 2, 100, -50)

position

The point position.

selected

The object’s selection state.

>>> obj.selected
False
>>> obj.selected = True

naked()

round()

Round offset coordinates.

copyData(source)

Subclasses may override this method. If so, they should call the super.

moveBy(value)

Move the object.

>>> obj.transformBy((10, 0))

value must be an iterable containing two integer/float values defining the x and y values to move the object by.

rotateBy(value, origin=None)

Rotate the object.

>>> obj.transformBy(45)
>>> obj.transformBy(45, origin=(500, 500))

value must be a integer/float values defining the angle to rotate the object by. origin defines the point at with the rotation should originate. It must be a coordinate or None. The default is (0, 0).

scaleBy(value, origin=None)

Scale the object.

>>> obj.transformBy(2.0)
>>> obj.transformBy((0.5, 2.0), origin=(500, 500))

value must be an iterable containing two integer/float values defining the x and y values to scale the object by. origin defines the point at with the scale should originate. It must be a coordinate or None. The default is (0, 0).

skewBy(value, origin=None)

Skew the object.

>>> obj.skewBy(11)
>>> obj.skewBy((25, 10), origin=(500, 500))

value must be rone of the following:

  • single integer/float indicating the value to skew the x direction by.
  • iterable cointaining type integer/float defining the values to skew the x and y directions by.

origin defines the point at with the skew should originate. It must be a coordinate or None. The default is (0, 0).

transformBy(matrix, origin=None)

Transform the object.

>>> obj.transformBy((0.5, 0, 0, 2.0, 10, 0))
>>> obj.transformBy((0.5, 0, 0, 2.0, 10, 0), origin=(500, 500))

matrix must be a transformation. origin defines the point at with the transformation should originate. It must be a coordinate or None. The default is (0, 0).

getParent()

setChanged()

update()

setParent(parent)

Last edited on 16/07/2018