LibCapy - colorPatch

Class to manipulate patches of color.

Macros:

Enumerations:

None.

Typedefs:

None.

Struct CapyColorPatch :

Struct CapyColorPatch's properties:

Set of pixels in the patch

Index of the patch (default: 0)

Average color of the patch, to be updated by the user with getAvgColor

Center of mass of the patch, to be updated by the user with getPosCenterOfMass

Approximating quadrilateral

Struct CapyColorPatch's methods:

Destructor

Update the rasterised quadrilateral approximating the color patch. The corners of the resulting quadrilateral are guaranteed to be in clockwise order. The first corner is guaranted to be the one nearest to the origin.

Update the center of mass of the color patch.

Update the average color of the color patch

Struct CapyColorPatches :

Struct CapyColorPatches's properties:

The list of patches

Struct CapyColorPatches's methods:

Destructor

Get the color patch at a given index

Input argument(s):

idx: the index

Output and side effect(s):

Return the CapyColorPatch

Get the number of patches

Output and side effect(s):

Return the number of patches

Add a CapyColorPatch to the patches

Input argument(s):

patch: the patch to add

Functions:

Create a CapyColorPatch of given dimensions and mode

Output and side effect(s):

Return a CapyColorPatch

Exception(s):

May raise CapyExc_MallocFailed.

Allocate memory for a new CapyColorPatch and create it

Output and side effect(s):

Return a CapyColorPatch

Exception(s):

May raise CapyExc_MallocFailed.

Free the memory used by a CapyColorPatch* and reset '*that' to NULL

Input argument(s):

that: a pointer to the CapyColorPatch to free

Create a CapyColorPatches of given dimensions and mode

Output and side effect(s):

Return a CapyColorPatches

Exception(s):

May raise CapyExc_MallocFailed.

Allocate memory for a new CapyColorPatches and create it

Output and side effect(s):

Return a CapyColorPatches

Exception(s):

May raise CapyExc_MallocFailed.

Free the memory used by a CapyColorPatches* and reset '*that' to NULL

Input argument(s):

that: a pointer to the CapyColorPatches to free

2022-06-21
in LibCapy,
43 views
Copyright 2021-2024 Baillehache Pascal