#include "cii.h"
#include "cii←matrix.h"

void* const nil = (void*)0;

long bits[] = {
	0x0E0000,
	0x0927CE,
	0x090111,
	0x0E2108,
	0x092104,
	0x092102,
	0x092111,
	0x0E210E
	};

static void ciitestbitmaps(CII←Handle dev)
{
	CII←RasterRep raster = {
		0, 0,
		8, 21,
		1,
		32,
		bits,
		32-21,
		(void*)0
		};
	float save[6];
	float T[6];
	CII←VectorRep center = {300.0, 400.0};
	float right = -90.0;
	CII←VectorRep twotwo = {2.0, 2.0};
	CII←GetMatrix(dev, save);
	CII←GetMatrix(dev, T);
	CIU←ApplyPreTranslate(center.x, center.y, T);
	CII←SetMatrix(dev, T);
	CII←MaskBitmap(dev, &raster, nil);
	CIU←ApplyPreRotate(right, T);
	CIU←ApplyPreScale(2.0, T);
	CII←SetMatrix(dev, T);
	CII←MaskBitmap(dev, &raster, nil);
	CIU←ApplyPreRotate(right, T);
	CIU←ApplyPreScale(2.0, T);
	CII←SetMatrix(dev, T);
	CII←MaskBitmap(dev, &raster, nil);
	CIU←ApplyPreRotate(right, T);
	CIU←ApplyPreScale(2.0, T);
	CII←SetMatrix(dev, T);
	CII←MaskBitmap(dev, &raster, nil);
	CII←SetMatrix(dev, save);
}

void
XR←run←ciitestbitmaps()
{
	CII←Handle dev = ((CII←Handle)CII←TestDevice());
	float t[6];
	CII←GetInitialMatrix(dev, t);
	CII←SetMatrix(dev, t);
	ciitestbitmaps(dev);
	CII←Destroy(dev);
}