#include <dvmbasic.h>
A Byte32Image is a buffer storing 2D array of int. Just like a ByteImage, a Byte32Image can be either physical or virtual.
typedef struct Byte32Image {
int width;
int height;
int x;
int y;
int parentWidth;
unsigned char isVirtual;
int *firstByte;
} Byte32Image;
- width
- the width of the Byte32Image
- height
- the height of the Byte32Image
- x
- the x-offset of the top-left corner of the Byte32Image from it's parent.
- y
- the y-offset of the top-left corner of the Byte32Image from it's parent.
- parentWidth
- the width of the physical parent of this Byte32Image. (should be called rootWidth since the parent might not be physical)
- virtual
- 1 iff the Byte32Image is virtual. 0 otherwise.
- firstByte
- pointer to the first short in this Byte32Image.
Return codes from various byte32 primitives. DVM_BYTE32_OK indicates the primitives executed successfully. DVM_BYTE32_ERROR indicates some error has occurs. We may defined more error codes to indicates different type of errors.
#define DVM_BYTE32_OK 0
#define DVM_BYTE32_ERROR 1
Byte32Image *Byte32New (int w, int h)
Create a new physical Byte32Image with w x h shorts and return a pointer to that Byte32Image.
void Byte32Free (Byte32Image *image)
Deallocate image.
Byte32Image *Byte32Clip (Byte32Image *image, int x, int y, int w, int h)
Create a virtual Byte32Image of size w by h, with image as the parent, and offset (x, y) from the upper-left corner of image. A pointer to the new Byte32Image is returned.
void Byte32Reclip (Byte32Image *image, int x, int y, int w, int h, Byte32Image *clipped)
This function is identical to Byte32Clip, except that it destructively modifies the virtual Byte32Image clipped (instead of creating a new virtual Byte32Image). Warning : memory leaks will occurs if clipped is a physical Byte32Image.
void Byte32Copy (Byte32Image *src, Byte32Image *dest)
Copy the top-left w x h area of Byte32Image src into Byte32Image dest, where w and h are minimum width and height of src and dest.
int Byte32GetX(Byte32Image *image)
int Byte32GetY(Byte32Image *image)
int Byte32GetWidth(Byte32Image *image)
int Byte32GetHeight(Byte32Image *image)
int Byte32GetVirtual(Byte32Image *image)
These functions (macros in the C version) access various fields in the Byte32Image data structure. The first two function return the x or y offset of image within its parent, the next two return the width or height of image, and the last function returns 1 if image is virtual, 0 otherwise.
Last updated : Monday, February 01, 1999, 04:44 PM