Dali VM : Mosaic API
Header Files
#include <dvmmosaic.h>
Type Definition
A mosaicis composed of nodes. Each node has links which connects them to various nodes.
The links store the transformbetween the nodes they connect.
typedef struct mosaic {
unsigned char rows;
unsigned char cols;
Node *first;
BitImage *final;
} Mosaic;
- rows
- Number of rows (height) in the mosaic.
- cols
- Number of columns (width) in the mosaic.
- first
- Pointer to the first node at left top [position (0,0)]
- final
- Pointer to the final image.
typedef struct node {
BitImage *image;
unsigned char found; /* Will have 1 if transform found. */
Link left;
Link right;
Link top;
Link bottom;
int xPos, yPos;
MTransform comp;
} Node;
- image
- The image corresponding to the node
- found
- set if the composite transform for this node has been found
- left
- Link to the left node
- right
- Link to the right node.
- top
- Link to the top node.
- bottom
- Link to the bottom node.
- xPos, yPos
- Postion of the node in the mosaic.
- comp
- Composite transform for this node.
typedef struct link {
MTransform trans;
unsigned char fpresent;
struct node *toNode;
} Link;
- trans
- Transform for this link
- fpresent
- Set to 1 if the transform is present
- toNode
- Pointer to the node it connects to.
typedef struct mtrasform {
int x;
int y;
double scX;
double scY;
double confidence;
} MTransform;
- x
- Translation in X direction
- y
- Translation in Y direction
- scX
- Scaling in X direction
- scY
- Scaling in Y direction
- confidence
- Confidence level for the transform [0..1]
Return Code
#define MOSAIC_OK 1
#define MOSAIC_ERROR -1
Mosaic Processing
int MosaicAddNext(Iterator *iterate, ByteImage *image);
- Adds image to the next position in the serpentine order to the mosaic associated with
the iterator iterate. Returns MOSAIC_OK if successful and MOSAIC_ERROR if the try to
add to mosaic which is already full.
int MosaicSetRightTransform(Mosaic *mos, int xPos, int yPos, int x, int y, double scX,
double scY, double confidence);
- Sets the right transform for the node at position (xPos, yPos) in the mosaic mos with
the remaining values. Returns MOSAIC_ERROR if (xPos, yPos) out of mosaic's range.
int MosaicSetBottomTransform(Mosaic *mos, int xPos, int yPos, int x, int y, double
scX, double scY, double confidence);
- Sets the bottom transform for the node at position (xPos, yPos) in the mosaic mos with
the remaining values. Returns MOSAIC_ERROR if (xPos, yPos) out of mosaic's range.
BitImage* MosaicGetImage(Mosaic *mos, int xPos, int yPos);
- Returns the BitImage associated with node at position (xPos, yPos) in the mosaic mos..
int MosaicFillGaps(Mosaic *mos);
- Fills up the gaps in the mosaic mos for the right and bottom transform of the
nodes.
int MosaicCheckAllConnected(Mosaic *mos);
- Checks the right and bottom links for all the nodes in the mosaic mos. Returns MOSAIC_OK
if mosaic is fully connected, otherwise returns negative number which is the number of
missing links.
int MosaicComputeComposite(Mosaic *mos);
- Computes the composite transform for each node of mosaic mos. The composite transform is
based upon the path with the best confidence level.
See Also
BitImage
Last Updated : 10/25/04 10:33:49 PM