GOffice.Image

g GObject.Object GObject.Object GOffice.Image GOffice.Image GObject.Object->GOffice.Image

Subclasses:GOffice.Emf, GOffice.Pixbuf, GOffice.Spectre, GOffice.Svg

Methods

Inherited:GObject.Object (37)
Structs:GObject.ObjectClass (5)
class format_to_mime (format)
class get_default_dpi (dpi_x, dpi_y)
class get_format_from_name (name)
class get_format_info (format)
class get_formats_with_pixbuf_saver ()
class new_for_format (format)
class new_from_data (type, data, length, format)
class new_from_file (filename)
class sel_new (doc, cc, image)
class set_default_dpi (dpi_x, dpi_y)
class type_for_format (format)
  differ (second)
  draw (cr)
  get_data (length)
  get_height ()
  get_info ()
  get_name ()
  get_pixbuf ()
  get_scaled_pixbuf (width, height)
  get_thumbnail ()
  get_width ()
  load_attrs (xin, attrs)
  load_data (xin)
  save (output)
  set_name (name)

Virtual Methods

Inherited:GObject.Object (7)
  do_differ (second)
  do_draw (cr)
  do_get_pixbuf ()
  do_get_scaled_pixbuf (width, height)
  do_load_attr (attr_name, attr_value)
  do_load_data (xin)
  do_save (output)

Properties

Name Type Flags Short Description
height int r/w Image height in pixels
width int r/w Image width in pixels

Signals

Inherited:GObject.Object (1)

Fields

Inherited:GObject.Object (1)
Name Type Access Description
data int r  
data_length int r  
height float r  
name str r  
parent GObject.Object r  
pixbuf GdkPixbuf.Pixbuf r  
thumbnail GdkPixbuf.Pixbuf r  
width float r  

Class Details

class GOffice.Image(**kwargs)
Bases:GObject.Object
Abstract:Yes
Structure:GOffice.ImageClass
classmethod format_to_mime(format)
Parameters:format (str) – a file extension string
Returns:corresponding mime type.
Return type:str
classmethod get_default_dpi(dpi_x, dpi_y)
Parameters:
classmethod get_format_from_name(name)
Parameters:name (str) – a string
Returns:corresponding GOffice.ImageFormat.
Return type:GOffice.ImageFormat
classmethod get_format_info(format)
Parameters:format (GOffice.ImageFormat) – a GOffice.ImageFormat
Returns:a GOffice.ImageFormatInfo struct.
Return type:GOffice.ImageFormatInfo

Retrieves information associated to format.

classmethod get_formats_with_pixbuf_saver()
Returns:a list of GOffice.ImageFormat that can be created from a pixbuf.
Return type:[GOffice.ImageFormat]
classmethod new_for_format(format)
Parameters:format (str) –
Return type:GOffice.Image
classmethod new_from_data(type, data, length, format)
Parameters:
  • type (str) –
  • data (int) –
  • length (int) –
  • format (str) –
Raises:

GLib.Error

Return type:

GOffice.Image

classmethod new_from_file(filename)
Parameters:filename (str) –
Raises:GLib.Error
Return type:GOffice.Image
classmethod sel_new(doc, cc, image)
Parameters:
Returns:

and shows new image selector.

Return type:

Gtk.Widget

classmethod set_default_dpi(dpi_x, dpi_y)
Parameters:
classmethod type_for_format(format)
Parameters:format (str) –
Return type:GObject.GType
differ(second)
Parameters:second (GOffice.Image) –
Return type:bool
draw(cr)
Parameters:cr (cairo.Context) –
get_data(length)
Parameters:length (int) –
Return type:int
get_height()
Return type:float
get_info()
Return type:GOffice.ImageFormatInfo
get_name()
Return type:str
get_pixbuf()
Returns:the pixbuf for self
Return type:GdkPixbuf.Pixbuf

Builds a pixbuf from the image if not already done and returns it, adding a reference.

get_scaled_pixbuf(width, height)
Parameters:
  • width (int) – the new pixbuf width
  • height (int) – the new pixbuf height
Returns:

the scaled pixbuf for self

Return type:

GdkPixbuf.Pixbuf

Builds a scaled pixbuf from the image and returns it. The caller needs to unref it. The pixbuf is scaled so that its width and height are not larger than, respectively, width and height, and preserving the aspect ratio.

get_thumbnail()
Returns:the thumbnail for self
Return type:GdkPixbuf.Pixbuf

Generates a thumbnail for self if not already done and returns it, adding a reference. The pixbuf is scaled so that its width and height are not larger than 64 pixels, and preserving the aspect ratio.

get_width()
Return type:float
load_attrs(xin, attrs)
Parameters:
load_data(xin)
Parameters:xin (Gsf.XMLIn) –
save(output)
Parameters:output (Gsf.XMLOut) –
set_name(name)
Parameters:name (str) –
do_differ(second) virtual
Parameters:second (GOffice.Image) –
Return type:bool
do_draw(cr) virtual
Parameters:cr (cairo.Context) –
do_get_pixbuf() virtual
Returns:the pixbuf for image
Return type:GdkPixbuf.Pixbuf

Builds a pixbuf from the image if not already done and returns it, adding a reference.

do_get_scaled_pixbuf(width, height) virtual
Parameters:
  • width (int) – the new pixbuf width
  • height (int) – the new pixbuf height
Returns:

the scaled pixbuf for image

Return type:

GdkPixbuf.Pixbuf

Builds a scaled pixbuf from the image and returns it. The caller needs to unref it. The pixbuf is scaled so that its width and height are not larger than, respectively, width and height, and preserving the aspect ratio.

do_load_attr(attr_name, attr_value) virtual
Parameters:
do_load_data(xin) virtual
Parameters:xin (Gsf.XMLIn) –
do_save(output) virtual
Parameters:output (Gsf.XMLOut) –

Property Details

GOffice.Image.props.height
Name:height
Type:int
Default Value:0
Flags:READABLE, WRITABLE

Image height in pixels

GOffice.Image.props.width
Name:width
Type:int
Default Value:0
Flags:READABLE, WRITABLE

Image width in pixels