#include <dvmbasic.h>
A FloatImage is a buffer storing 2D array of int. Just like a ByteImage, a FloatImage can be either physical or virtual.
typedef struct FloatImage {
int width;
int height;
int x;
int y;
int parentWidth;
unsigned char isVirtual;
float *firstByte;
} FloatImage;
- width
- the width of the FloatImage
- height
- the height of the FloatImage
- x
- the x-offset of the top-left corner of the FloatImage from it's parent.
- y
- the y-offset of the top-left corner of the FloatImage from it's parent.
- parentWidth
- the width of the physical parent of this FloatImage. (should be called rootWidth since the parent might not be physical)
- virtual
- 1 iff the FloatImage is virtual. 0 otherwise.
- firstByte
- pointer to the first short in this FloatImage.
Return codes from various byte32 primitives. DVM_FLOAT_OK indicates the primitives executed successfully. DVM_FLOAT_ERROR indicates some error has occurs. We may defined more error codes to indicates different type of errors.
#define DVM_FLOAT_OK 0
#define DVM_FLOAT_ERROR 1
FloatImage *FloatNew (int w, int h)
Create a new physical FloatImage with w x h shorts and return a pointer to that FloatImage.
void FloatFree (FloatImage *image)
Deallocate image.
FloatImage *FloatClip (FloatImage *image, int x, int y, int w, int h)
Create a virtual FloatImage 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 FloatImage is returned.
void FloatReclip (FloatImage *image, int x, int y, int w, int h, FloatImage *clipped)
This function is identical to FloatClip, except that it destructively modifies the virtual FloatImage clipped (instead of creating a new virtual FloatImage). Warning : memory leaks will occurs if clipped is a physical FloatImage.
void FloatCopy (FloatImage *src, FloatImage *dest)
Copy the top-left w x h area of FloatImage src into FloatImage dest, where w and h are minimum width and height of src and dest.
int FloatGetX(FloatImage *image)
int FloatGetY(FloatImage *image)
int FloatGetWidth(FloatImage *image)
int FloatGetHeight(FloatImage *image)
int FloatGetVirtual(FloatImage *image)
These functions (macros in the C version) access various fields in the FloatImage 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