# The "iedit" Package

These routines provide a simple interface to the recursive, heirarchical data structure supported in Karma, to define 2-dimensional (image) editing instructions.

Library: karma
Link With: -lkarma

#### Functions

iedit_create_list | Create a managed image edit instruction list.
iedit_free_list | Destroy image edit list.
iedit_get_instruction_desc | Get the list descriptor for image edit instructions.
iedit_alloc_edit_coords | Allocate an array of edit co-ordinates.
iedit_get_edit_coords | Get a number of editing co-ordinates from a co-ordinate list.
iedit_add_instruction | Add an image edit instruction to a list.
iedit_remove_instructions | Remove instructions from an image edit list.
iedit_apply_instructions | Apply image edit instructions.
iedit_get_list | Get list of edits in an image edit list.
iedit_make_list_default_master | Prepare image edit list for mastery.
iedit_make_list_default_slave | Prepare image edit list for slavery.

#### Prototype Functions

iedit_PROTO_add_func | Image edit instruction add callback.
iedit_PROTO_loss_func | Image edit instruction loss callback.
iedit_PROTO_apply_func | Image edit instruction apply callback.

## Functions

KImageEditList iedit_create_list (void (*add_func) (), void (*loss_func) (), void (*apply_func) (), void *info)

Create a managed image edit instruction list.

Parameters:

- add_func : The function which will be called when a new instruction has been added to the list. The prototype function is iedit_PROTO_add_func. The interface to this routine is as follows:
- loss_func : The function which will be called when an instruction has been removed from the list. The prototype function is iedit_PROTO_loss_func.
- apply_func : The function which will be called when the edit instructions are to be applied (prior to clearing of the list). The prototype function is iedit_PROTO_apply_func.
- info : The arbitrary information pointer for the edit list. This may be NULL.

Returns: A KImageEditList object on success, else NULL.
Multithreading Level: Unsafe

#### EXPERIMENTAL FUNCTION: subject to change without notice

void iedit_free_list (KImageEditList ilist)

Destroy image edit list.

Parameters:

- ilist : The list to destroy.

Returns: Nothing.
Multithreading Level: Unsafe

packet_desc * iedit_get_instruction_desc ()

Get the list descriptor for image edit instructions.

Parameters:

This function takes no parameters

Returns: A pointer to the descriptor.
Multithreading Level: Unsafe

edit_coord * iedit_alloc_edit_coords (unsigned int num_coords)

Allocate an array of edit co-ordinates.

Parameters:

- num_coords : The number of co-ordinates to allocate.

Returns: A pointer to a statically allocated array of co-ordinate structures on success, else NULL.
Multithreading Level: Unsafe

flag iedit_get_edit_coords (list_header *list_head, edit_coord **coords)

The routine will get a number of editing co-ordinates from a co-ordinate list. The routine will extract all co-ordinates in the list.

Parameters:

- list_head : The list header.
- coords : The pointer to an internally allocated array of extracted co-ordinates is written here.

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe

flag iedit_add_instruction (KImageEditList ilist, unsigned int instruction_code, edit_coord *coords, unsigned int num_coords, double intensity[2])

This routine will add a single edit instruction to a managed image edit instruction list. The add_func function registered for this instruction list will be called at a future time with a copy of the instruction to be added.

Parameters:

- ilist : The instruction list.
- instruction_code : The instruction code.
- coords : The instruction co-ordinates.
- num_coords : The number of co-ordinates.
- intensity : The intensity value of the instruction.

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe

flag iedit_remove_instructions (KImageEditList ilist, unsigned int num_to_remove)

This routine will remove a number of edit instructions from a managed image edit instruction list. The loss_func function registered for this instruction list will be called at a future time.

Parameters:

- ilist : The instruction list.
- num_to_remove : The number of instructions to remove. If this is 0, all instructions are removed.

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe

flag iedit_apply_instructions (KImageEditList ilist)

This routine will issue an apply (commit) request for a managed image edit instruction list. The apply_func function registered for this instruction list will be called at a future time. Some time after this, the loss_func registered will also be called.

Parameters:

- ilist : The instruction list.

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe

list_header * iedit_get_list (KImageEditList ilist)

This routine will get the list of edit instructions associated with a managed image edit instruction list.

Parameters:

- ilist : The managed list.

Returns: The list of edit instructions.
Multithreading Level: Unsafe

void iedit_make_list_default_master (KImageEditList ilist)

This routine will make a managed image edit instruction list the default list for accepting slave list connections.

Parameters:

- ilist : The managed list.

Returns: Nothing.
Multithreading Level: Unsafe

void iedit_make_list_default_slave (KImageEditList ilist)

This routine will make a managed image edit instruction list the default list for making slave list connections.

Parameters:

- ilist : The managed list.

Returns: Nothing.
Multithreading Level: Unsafe

## Prototype Functions

void iedit_PROTO_add_func (KImageEditList ilist, list_entry *instruction, void **info)

This routine will process a single edit instruction which has been added to a managed image edit instruction list.

Parameters:

- ilist : The managed image edit instruction list.
- instruction : The edit instruction.
- info : A pointer to the arbitrary information pointer for the list.

Returns: Nothing.
Multithreading Level: Unsafe

void iedit_PROTO_loss_func (KImageEditList ilist, void **info)

This routine will process the loss of an edit instruction from a managed image edit instruction list.

Parameters:

- ilist : The managed image edit instruction list.
- info : A pointer to the arbitrary information pointer for the list.

Returns: Nothing.
Multithreading Level: Unsafe

void iedit_PROTO_apply_func (KImageEditList ilist, void **info)

This routine will apply (commit) an edit list prior to the list being cleared.

Parameters:

- ilist : The managed image edit instruction list.
- info : A pointer to the arbitrary information pointer for the list.

Returns: Nothing.
Multithreading Level: Unsafe

Back to Karma Home Page