/* {"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, opt byte pixelFormat)
/* {"@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, opt byte pixelFormat)
}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 3 (this version) by barry
Notes for this version: Adds optional pixel format input selection for rbgaToYUV() and chromaKey()