spriteimage.h




Functions

ImageCopy
get_key
MorpheusImageCopy

ImageCopy

void ImageCopy(
    SpriteImage *si1,
    SpriteImage *si2,
    int sx,
    int sy,
    int x,
    int y,
    int cx,
    int cy,
    int flags,
    long key );

SpriteCore's basic blitter. Copies one SpriteImage onto another with optional color-key compositing and other features. If any of the coordinates specified exceed the bounds of the source or destination images, clipping is automatically performed.

Parameter Descriptions
si1
Source image.
si2
Destination image.
sx
Coordinate of left edge of source rectangle to copy.
sy
Coordinate of top edge of source rectangle to copy.
x
Coordinate of left edge of copied rectangle in destination image.
y
Coordinate of top edge of copied rectangle in destination image.
cx
Width of rectangle.
cy
Height of rectangle.
flags
Special flags which affect the operation.
key
Key color to use in compositing.

MorpheusImageCopy

void MorpheusImageCopy(
    SpriteImage *si1,
    SpriteImage *si2,
    int sx,
    int sy,
    int cx,
    int cy,
    s_matp mat,
    int flags,
    long key );

SpriteCore's matrix-transform blitter. Copies one SpriteImage onto another with optional color-key compositing, transforming the source image according to the given matrix. Clipping is naive, and so very very slow if you scale the image to huge size (or have a huge image to begin with). I hope to change this in the near future.

Parameter Descriptions
si1
Source image.
si2
Destination image.
sx
Coordinate of left edge of source rectangle to copy.
sy
Coordinate of top edge of source rectangle to copy.
cx
Width of rectangle.
cy
Height of rectangle.
mat
Pointer to transformation matrix.
flags
Special flags which affect the operation.
key
Key color to use in compositing.

get_key

long get_key(
    SpriteImage *si );

Gets the key color of the upper-left-hand corner of a SpriteImage and stores it in a long int value, regardless of depth or endianness.

Parameter Descriptions
si
The SpriteImage whose key color we want

Typedefs


SpriteImage

See Also:
tagSpriteImage
typedef struct tagSpriteImage {
    unsigned int cx;
    unsigned int cy;
    unsigned int depth;
    unsigned int scan_length;
    unsigned int endian;
    void *bits;
    void *img;
    int auto_free;
} SpriteImage;

Platform independent representation of a bitmap image

Field Descriptions
cx
Width of image in pixels
cy
Height of image in pixels
depth
Depth in bits per pixel
scan_length
Length of one scan line
endian
Byte order of pixels
bits
Pointer to actual image pixels
img
Pointer to window-system-dependent representation of image
auto_free
Reserved for future use.

Structs and Unions


tagSpriteImage

See Also:
SpriteImage
typedef struct tagSpriteImage {
    unsigned int cx;
    unsigned int cy;
    unsigned int depth;
    unsigned int scan_length;
    unsigned int endian;
    void *bits;
    void *img;
    int auto_free;
} SpriteImage;

Platform independent representation of a bitmap image

Field Descriptions
cx
Width of image in pixels
cy
Height of image in pixels
depth
Depth in bits per pixel
scan_length
Length of one scan line
endian
Byte order of pixels
bits
Pointer to actual image pixels
img
Pointer to window-system-dependent representation of image
auto_free
Reserved for future use.

© 2005 Jeffrey T. Read (Last Updated 7/27/2005)