## DfuImage DfuImage — Object representing a a firmware image |

## Functions

DfuImage * | dfu_image_new ()
GPtrArray * | dfu_image_get_elements ()
DfuElement * | dfu_image_get_element ()
DfuElement * | dfu_image_get_element_default ()
guint8 | dfu_image_get_alt_setting ()
const gchar * | dfu_image_get_name ()
guint32 | dfu_image_get_size ()
void | dfu_image_add_element ()
void | dfu_image_set_alt_setting ()
void | dfu_image_set_name ()
gchar * | dfu_image_to_string ()

## Types and Values

#define | DFU_TYPE_IMAGE
struct | DfuImageClass
| DfuImage

## Description

A DfuImage is typically made up of several DfuElements, although typically there will only be one.

See also: DfuElement

## Functions

### dfu_image_new ()

    DfuImage *
    dfu_image_new (void);

Creates a new DFU image object.

#### Returns

a new DfuImage

Since: 0.5.4

### dfu_image_get_elements ()

    GPtrArray *
    dfu_image_get_elements (DfuImage *image);

Gets the element data.

#### Parameters

image | a DfuImage |

#### Returns

element data.

[transfer none][element-type DfuElement]

Since: 0.5.4

### dfu_image_get_element ()

    DfuElement *
    dfu_image_get_element (DfuImage *image,
                           guint8 idx);

Gets the element.

#### Parameters

image | a DfuImage |
idx | an array index |

#### Returns

element data, or `NULL` for invalid.

[transfer none]

Since: 0.5.4

### dfu_image_get_element_default ()

    DfuElement *
    dfu_image_get_element_default (DfuImage *image);

Gets the default element.

#### Parameters

image | a DfuImage |

#### Returns

element data, or `NULL` for invalid.

[transfer none]

Since: 0.7.1

### dfu_image_get_alt_setting ()

    guint8
    dfu_image_get_alt_setting (DfuImage *image);

Gets the alternate setting.

#### Parameters

image | a DfuImage |

#### Returns

integer, or 0x00 for unset

Since: 0.5.4

### dfu_image_get_name ()

    const gchar *
    dfu_image_get_name (DfuImage *image);

Gets the target name.

#### Parameters

image | a DfuImage |

#### Returns

a string, or `NULL` for unset

Since: 0.5.4

### dfu_image_get_size ()

    guint32
    dfu_image_get_size (DfuImage *image);

Gets the size of all the elements in the image.

This only returns actual data that would be sent to the device and does not include any padding.

#### Parameters

image | a DfuImage |

#### Returns

a integer value, or 0 if there are no elements.

Since: 0.5.4

### dfu_image_add_element ()

    void
    dfu_image_add_element (DfuImage *image,
                           DfuElement *element);

Adds an element to the image.

#### Parameters

image | a DfuImage |
element | a DfuElement |

Since: 0.5.4

### dfu_image_set_alt_setting ()

    void
    dfu_image_set_alt_setting (DfuImage *image,
                               guint8 alt_setting);

Sets the vendor ID.

#### Parameters

image | a DfuImage |
alt_setting | vendor ID, or 0xffff for unset |

Since: 0.5.4

### dfu_image_set_name ()

    void
    dfu_image_set_name (DfuImage *image,
                        const gchar *name);

Sets the target name.

#### Parameters

image | a DfuImage |
name | a target string, or `NULL` |

Since: 0.5.4

### dfu_image_to_string ()

    gchar *
    dfu_image_to_string (DfuImage *image);

Returns a string representaiton of the object.

#### Parameters

image | a DfuImage |

#### Returns

NULL terminated string, or `NULL` for invalid

Since: 0.5.4

## Types and Values

### DFU_TYPE_IMAGE

    #define DFU_TYPE_IMAGE (dfu_image_get_type ())

### struct DfuImageClass

    struct DfuImageClass {
    	GObjectClass		 parent_class;
    };

### DfuImage

    typedef struct _DfuImage DfuImage;