Dali: VectorImage -- C API

[ Header Files | Types | Constants | Allocation | Initialization | Queries | See Also ]

Header Files

#include <dvmbasic.h>

Type Definitions

Vector

A Vector represents a motion vector, (e.g., in a MPEG video). It has x and y components, and a flag to indicate if the vector exists. (The exists flags can be used for other purposes as the programmer sees fit.)

    typedef struct Vector {
        char exists;
        char down;
        char right;
    } Vector;
  
exists
0 if the vector is not initialized. 1 if the down and right are initialized. 2 if the vector is skipped (in MPEG B-frame encoding only).
down
Down vector component
right
Right vector component

VectorImage

A VectorImage is a buffer storing 2D array of Vector. Just like a ByteImage, a VectorImage can be either physical or virtual.

    typedef struct VectorImage {
        int width;
        int height;
        int x;
        int y;
        int parentWidth;
        unsigned char isVirtual;
        Vector *firstVector;
    } VectorImage;
  
width
the width of the VectorImage
height
the height of the VectorImage
x
the x-offset of the top-left corner of the VectorImage from it's parent.
y
the y-offset of the top-left corner of the VectorImage from it's parent.
parentWidth
the width of the physical parent of this VectorImage. (should be called rootWidth since the parent might not be physical)
virtual
1 iff the VectorImage is virtual. 0 otherwise.
firstVector
pointer to the first vector in this VectorImage.

Constants

Return Codes

Return codes from various vector primitives. DVM_VECTOR_OK indicates the primitives executed successfully. DVM_VECTOR_ERROR indicates some error has occurs. We may defined more error codes to indicates different type of errors.

    #define DVM_VECTOR_OK 0
    #define DVM_VECTOR_ERROR 1
  

Operators

Allocation

VectorNew *VectorNew (int w, int h)

void VectorFree (VectorImage *vectorImage)

VectorImage *VectorClip (VectorImage *vectorImage, int x, int y, int w, int h)

void VectorReclip (VectorImage *vectorImage, int x, int y, int w, int h, VectorImage *clipped)


Initialization

void VectorCopy (VectorImage *src, VectorImage *dest)


Queries

int VectorGetX(VectorImage *vectorImage)
int VectorGetY(VectorImage *vectorImage)
int VectorGetWidth(VectorImage *vectorImage)
int VectorGetHeight(VectorImage *vectorImage)
int VectorGetVirtual(VectorImage *vectorImage)


See Also

ByteImage , MPEG


Last updated : Tuesday, February 02, 1999, 04:51 PM