HomeForumSourceResearchGuide
Sign in to contribute to source. how it works
Type definition file media.image.ImageTransform by barry
expand copy to clipboardexpand
/* {"description" : "This API supports common transform functions for images." } */

uses media.PixelMap
uses media.PixelMapYUV

data ChromaKeySpec {
	byte r
	byte g
	byte b
	byte fgTolerance
	byte bgTolerance
}

interface ImageTransform {

	/* {"@description" : "Convert an RGBA image to YUV." } */
	PixelMapYUV rgbaToYUV(PixelMap p)

	/* {"@description" : "Convert a YUV image to RGBA." } */
	PixelMap yuvToRGBA(PixelMapYUV p, opt ChromaKeySpec spec)
	
	/* {"@description" : "Crop an image, by identifying a rectangle within that image. The identified rectangle is extracted as a new image and returned." } */
	PixelMap crop(PixelMap p, int x, int y, int width, int height)

	/* {"@description" : "Set pixels matching the given colour to be transparent." } */
	PixelMap chromaKey(PixelMap p, ChromaKeySpec spec)

	}
Revision history
To propose a new revision to this entity, use dana source put -ut your/new/version.dn -n media.image.ImageTransform -m "reason for update" -u yourUsername
Version 5 by barry
Version 4 by barry
Version 3 by barry
Version 2 (this version) by barry
Notes for this version: Adds expanded image transform APIs, with RGBA/YUV conversions and chroma keying
Version 1 by barry