Documentation
¶
Overview ¶
Package vimage provides purego-based Go bindings for the macOS vImage framework.
Apple documentation: https://developer.apple.com/documentation/vimage
Index ¶
- Constants
- func KvImageDecodeArray_16Q12Format() *float64
- func SymbolAvailable(symbol string) bool
- func VImageAffineWarpARGB16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageAffineWarpARGB16S(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageAffineWarpARGB16U(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageAffineWarpARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageAffineWarpARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageAffineWarpCGARGB16S(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageAffineWarpCGARGB16U(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageAffineWarpCGARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageAffineWarpCGARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageAffineWarpCGPlanar8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageAffineWarpCGPlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageAffineWarpCbCr16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageAffineWarpDARGB16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageAffineWarpDARGB16S(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageAffineWarpDARGB16U(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageAffineWarpDARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageAffineWarpDARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageAffineWarpDCbCr16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageAffineWarpDPlanar8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageAffineWarpDPlanar16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageAffineWarpDPlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageAffineWarpPlanar8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageAffineWarpPlanar16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageAffineWarpPlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageAlphaBlendARGB8888(srcTop *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, ...) int
- func VImageAlphaBlendARGBFFFF(srcTop *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, ...) int
- func VImageAlphaBlendNonpremultipliedToPremultipliedARGB8888(srcTop *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, ...) int
- func VImageAlphaBlendNonpremultipliedToPremultipliedARGBFFFF(srcTop *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, ...) int
- func VImageAlphaBlendNonpremultipliedToPremultipliedPlanar8(srcTop *VImageBuffer, srcTopAlpha *VImageBuffer, srcBottom *VImageBuffer, ...) int
- func VImageAlphaBlendNonpremultipliedToPremultipliedPlanarF(srcTop *VImageBuffer, srcTopAlpha *VImageBuffer, srcBottom *VImageBuffer, ...) int
- func VImageAlphaBlendPlanar8(srcTop *VImageBuffer, srcTopAlpha *VImageBuffer, srcBottom *VImageBuffer, ...) int
- func VImageAlphaBlendPlanarF(srcTop *VImageBuffer, srcTopAlpha *VImageBuffer, srcBottom *VImageBuffer, ...) int
- func VImageBoxConvolveARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageBoxConvolvePlanar8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageBufferCopyToCVPixelBuffer(buffer *VImageBuffer, bufferFormat *VImageCGImageFormat, ...) int
- func VImageBufferFillARGB16F(dest *VImageBuffer, color *uint16, flags uint32) int
- func VImageBufferFillARGB16S(dest *VImageBuffer, color *int16, flags uint32) int
- func VImageBufferFillARGB16U(dest *VImageBuffer, color *uint16, flags uint32) int
- func VImageBufferFillARGB8888(dest *VImageBuffer, color *uint8, flags uint32) int
- func VImageBufferFillARGBFFFF(dest *VImageBuffer, color *float32, flags uint32) int
- func VImageBufferFillCbCr8(dest *VImageBuffer, color *uint8, flags uint32) int
- func VImageBufferFillCbCr16S(dest *VImageBuffer, color *int16, flags uint32) int
- func VImageBufferFillCbCr16U(dest *VImageBuffer, color *uint16, flags uint32) int
- func VImageBufferGetSize(buf *VImageBuffer) corefoundation.CGSize
- func VImageBufferInit(buf *VImageBuffer, height uint, width uint, pixelBits uint32, flags uint32) int
- func VImageBufferInitForCopyFromCVPixelBuffer(buffers *VImageBuffer, converter unsafe.Pointer, pixelBuffer unsafe.Pointer, ...) int
- func VImageBufferInitForCopyToCVPixelBuffer(buffers *VImageBuffer, converter unsafe.Pointer, pixelBuffer unsafe.Pointer, ...) int
- func VImageBufferInitWithCGImage(buf *VImageBuffer, format *VImageCGImageFormat, backgroundColor *float64, ...) int
- func VImageBufferInitWithCVPixelBuffer(buffer *VImageBuffer, desiredFormat *VImageCGImageFormat, ...) int
- func VImageByteSwapPlanar16U(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageCGImageFormatGetComponentCount(format *VImageCGImageFormat) uint32
- func VImageCGImageFormatIsEqual(f1 *VImageCGImageFormat, f2 *VImageCGImageFormat) uint8
- func VImageCVImageFormatCopy(format unsafe.Pointer) unsafe.Pointer
- func VImageCVImageFormatCopyChannelDescription(format unsafe.Pointer, desc *VImageChannelDescription, type_ uint32) int
- func VImageCVImageFormatCopyConversionMatrix(format unsafe.Pointer, matrix unsafe.Pointer, inType uint32) int
- func VImageCVImageFormatCreate(imageFormatType uint32, matrix *VImageARGBToYpCbCrMatrix, ...) unsafe.Pointer
- func VImageCVImageFormatCreateWithCVPixelBuffer(buffer unsafe.Pointer) unsafe.Pointer
- func VImageCVImageFormatGetAlphaHint(format unsafe.Pointer) int
- func VImageCVImageFormatGetChannelCount(format unsafe.Pointer) uint32
- func VImageCVImageFormatGetChannelNames(format unsafe.Pointer) *uint32
- func VImageCVImageFormatGetChromaSiting(format unsafe.Pointer) unsafe.Pointer
- func VImageCVImageFormatGetColorSpace(format unsafe.Pointer) unsafe.Pointer
- func VImageCVImageFormatGetConversionMatrix(format unsafe.Pointer, outType *uint32) unsafe.Pointer
- func VImageCVImageFormatGetFormatCode(format unsafe.Pointer) uint32
- func VImageCVImageFormatGetUserData(format unsafe.Pointer) unsafe.Pointer
- func VImageCVImageFormatRelease(fmt_ unsafe.Pointer)
- func VImageCVImageFormatRetain(fmt_ unsafe.Pointer)
- func VImageCVImageFormatSetAlphaHint(format unsafe.Pointer, alphaIsOne int) int
- func VImageCVImageFormatSetChromaSiting(format unsafe.Pointer, siting unsafe.Pointer) int
- func VImageCVImageFormatSetColorSpace(format unsafe.Pointer, colorspace unsafe.Pointer) int
- func VImageCVImageFormatSetUserData(format unsafe.Pointer, userData unsafe.Pointer, ...) int
- func VImageClipPlanarF(src *VImageBuffer, dest *VImageBuffer, maxFloat float32, minFloat float32, ...) int
- func VImageClipToAlphaARGB8888(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageClipToAlphaARGBFFFF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageClipToAlphaPlanar8(src *VImageBuffer, alpha *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageClipToAlphaPlanarF(src *VImageBuffer, alpha *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageClipToAlphaRGBA8888(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageClipToAlphaRGBAFFFF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageContrastStretchARGB8888(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageContrastStretchARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageContrastStretchPlanar8(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageContrastStretchPlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageConvert8to16Q12(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvert12UTo16U(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvert16Fto16Q12(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvert16Fto16U(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvert16Q12to8(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvert16Q12to16F(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvert16Q12to16U(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvert16Q12toF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvert16SToF(src *VImageBuffer, dest *VImageBuffer, offset float32, scale float32, ...) int
- func VImageConvert16UTo12U(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvert16UToF(src *VImageBuffer, dest *VImageBuffer, offset float32, scale float32, ...) int
- func VImageConvert16UToPlanar8(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvert16Uto16F(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvert16Uto16Q12(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvert420Yp8Cb8Cr8ToARGB8888(srcYp *VImageBuffer, srcCb *VImageBuffer, srcCr *VImageBuffer, ...) int
- func VImageConvert420Yp8CbCr8ToARGB8888(srcYp *VImageBuffer, srcCbCr *VImageBuffer, dest *VImageBuffer, ...) int
- func VImageConvert422CbYpCrYp8AA8ToARGB8888(src *VImageBuffer, srcA *VImageBuffer, dest *VImageBuffer, ...) int
- func VImageConvert422CbYpCrYp8ToARGB8888(src *VImageBuffer, dest *VImageBuffer, info *VImageYpCbCrToARGB, ...) int
- func VImageConvert422CbYpCrYp16ToARGB16U(src *VImageBuffer, dest *VImageBuffer, info *VImageYpCbCrToARGB, ...) int
- func VImageConvert422CbYpCrYp16ToARGB8888(src *VImageBuffer, dest *VImageBuffer, info *VImageYpCbCrToARGB, ...) int
- func VImageConvert422CrYpCbYpCbYpCbYpCrYpCrYp10ToARGB16Q12(src *VImageBuffer, dest *VImageBuffer, info *VImageYpCbCrToARGB, ...) int
- func VImageConvert422CrYpCbYpCbYpCbYpCrYpCrYp10ToARGB8888(src *VImageBuffer, dest *VImageBuffer, info *VImageYpCbCrToARGB, ...) int
- func VImageConvert422YpCbYpCr8ToARGB8888(src *VImageBuffer, dest *VImageBuffer, info *VImageYpCbCrToARGB, ...) int
- func VImageConvert444AYpCbCr8ToARGB8888(src *VImageBuffer, dest *VImageBuffer, info *VImageYpCbCrToARGB, ...) int
- func VImageConvert444AYpCbCr16ToARGB16U(src *VImageBuffer, dest *VImageBuffer, info *VImageYpCbCrToARGB, ...) int
- func VImageConvert444AYpCbCr16ToARGB8888(src *VImageBuffer, dest *VImageBuffer, info *VImageYpCbCrToARGB, ...) int
- func VImageConvert444CbYpCrA8ToARGB8888(src *VImageBuffer, dest *VImageBuffer, info *VImageYpCbCrToARGB, ...) int
- func VImageConvert444CrYpCb8ToARGB8888(src *VImageBuffer, dest *VImageBuffer, info *VImageYpCbCrToARGB, ...) int
- func VImageConvert444CrYpCb10ToARGB16Q12(src *VImageBuffer, dest *VImageBuffer, info *VImageYpCbCrToARGB, ...) int
- func VImageConvert444CrYpCb10ToARGB8888(src *VImageBuffer, dest *VImageBuffer, info *VImageYpCbCrToARGB, ...) int
- func VImageConvertARGB16Q12To422CrYpCbYpCbYpCbYpCrYpCrYp10(src *VImageBuffer, dest *VImageBuffer, info *VImageARGBToYpCbCr, ...) int
- func VImageConvertARGB16Q12To444CrYpCb10(src *VImageBuffer, dest *VImageBuffer, info *VImageARGBToYpCbCr, ...) int
- func VImageConvertARGB16Q12ToARGB2101010(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, ...) int
- func VImageConvertARGB16Q12ToRGBA1010102(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, ...) int
- func VImageConvertARGB16Q12ToXRGB2101010(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, ...) int
- func VImageConvertARGB16UTo422CbYpCrYp16(src *VImageBuffer, dest *VImageBuffer, info *VImageARGBToYpCbCr, ...) int
- func VImageConvertARGB16UTo444AYpCbCr16(src *VImageBuffer, dest *VImageBuffer, info *VImageARGBToYpCbCr, ...) int
- func VImageConvertARGB16UToARGB8888(src *VImageBuffer, dest *VImageBuffer, permuteMap *uint8, copyMask uint8, ...) int
- func VImageConvertARGB16UToARGB2101010(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, ...) int
- func VImageConvertARGB16UToRGBA1010102(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, ...) int
- func VImageConvertARGB16UToXRGB2101010(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, ...) int
- func VImageConvertARGB16UtoARGB8888Dithered(src *VImageBuffer, dest *VImageBuffer, dither int, permuteMap *uint8, ...) int
- func VImageConvertARGB16UtoPlanar16U(argbSrc *VImageBuffer, aDest *VImageBuffer, rDest *VImageBuffer, ...) int
- func VImageConvertARGB16UtoRGB16U(argbSrc *VImageBuffer, rgbDest *VImageBuffer, flags uint32) int
- func VImageConvertARGB1555toARGB8888(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvertARGB1555toPlanar8(src *VImageBuffer, destA *VImageBuffer, destR *VImageBuffer, ...) int
- func VImageConvertARGB1555toRGB565(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvertARGB8888To420Yp8Cb8Cr8(src *VImageBuffer, destYp *VImageBuffer, destCb *VImageBuffer, ...) int
- func VImageConvertARGB8888To420Yp8CbCr8(src *VImageBuffer, destYp *VImageBuffer, destCbCr *VImageBuffer, ...) int
- func VImageConvertARGB8888To422CbYpCrYp8(src *VImageBuffer, dest *VImageBuffer, info *VImageARGBToYpCbCr, ...) int
- func VImageConvertARGB8888To422CbYpCrYp8AA8(src *VImageBuffer, dest *VImageBuffer, destA *VImageBuffer, ...) int
- func VImageConvertARGB8888To422CbYpCrYp16(src *VImageBuffer, dest *VImageBuffer, info *VImageARGBToYpCbCr, ...) int
- func VImageConvertARGB8888To422CrYpCbYpCbYpCbYpCrYpCrYp10(src *VImageBuffer, dest *VImageBuffer, info *VImageARGBToYpCbCr, ...) int
- func VImageConvertARGB8888To422YpCbYpCr8(src *VImageBuffer, dest *VImageBuffer, info *VImageARGBToYpCbCr, ...) int
- func VImageConvertARGB8888To444AYpCbCr8(src *VImageBuffer, dest *VImageBuffer, info *VImageARGBToYpCbCr, ...) int
- func VImageConvertARGB8888To444AYpCbCr16(src *VImageBuffer, dest *VImageBuffer, info *VImageARGBToYpCbCr, ...) int
- func VImageConvertARGB8888To444CbYpCrA8(src *VImageBuffer, dest *VImageBuffer, info *VImageARGBToYpCbCr, ...) int
- func VImageConvertARGB8888To444CrYpCb8(src *VImageBuffer, dest *VImageBuffer, info *VImageARGBToYpCbCr, ...) int
- func VImageConvertARGB8888To444CrYpCb10(src *VImageBuffer, dest *VImageBuffer, info *VImageARGBToYpCbCr, ...) int
- func VImageConvertARGB8888ToARGB16U(src *VImageBuffer, dest *VImageBuffer, permuteMap *uint8, copyMask uint8, ...) int
- func VImageConvertARGB8888ToARGB2101010(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, ...) int
- func VImageConvertARGB8888ToRGB16U(src *VImageBuffer, dest *VImageBuffer, permuteMap *uint8, copyMask uint8, ...) int
- func VImageConvertARGB8888ToRGBA1010102(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, ...) int
- func VImageConvertARGB8888ToXRGB2101010(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, ...) int
- func VImageConvertARGB8888toARGB1555(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvertARGB8888toARGB1555Dithered(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, dither int, ...) int
- func VImageConvertARGB8888toPlanar8(srcARGB *VImageBuffer, destA *VImageBuffer, destR *VImageBuffer, ...) int
- func VImageConvertARGB8888toPlanar16Q12(src *VImageBuffer, alpha *VImageBuffer, red *VImageBuffer, green *VImageBuffer, ...) int
- func VImageConvertARGB8888toPlanarF(src *VImageBuffer, alpha *VImageBuffer, red *VImageBuffer, green *VImageBuffer, ...) int
- func VImageConvertARGB8888toRGB565(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvertARGB8888toRGB565Dithered(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, dither int, ...) int
- func VImageConvertARGB8888toRGB888(arg *VImageBuffer, arg2 *VImageBuffer, arg3 uint32) int
- func VImageConvertARGB2101010ToARGB16F(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, ...) int
- func VImageConvertARGB2101010ToARGB16Q12(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, ...) int
- func VImageConvertARGB2101010ToARGB16U(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, ...) int
- func VImageConvertARGB2101010ToARGB8888(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, ...) int
- func VImageConvertARGB2101010ToARGBFFFF(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, ...) int
- func VImageConvertARGBFFFFToARGB2101010(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, ...) int
- func VImageConvertARGBFFFFToXRGB2101010(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, ...) int
- func VImageConvertARGBFFFFtoARGB8888Dithered(src *VImageBuffer, dest *VImageBuffer, maxFloat *float32, minFloat *float32, ...) int
- func VImageConvertARGBFFFFtoPlanar8(src *VImageBuffer, alpha *VImageBuffer, red *VImageBuffer, green *VImageBuffer, ...) int
- func VImageConvertARGBFFFFtoPlanarF(srcARGB *VImageBuffer, destA *VImageBuffer, destR *VImageBuffer, ...) int
- func VImageConvertARGBFFFFtoRGBFFF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvertARGBToYpCbCrGenerateConversion(matrix *VImageARGBToYpCbCrMatrix, pixelRange *VImageYpCbCrPixelRange, ...) int
- func VImageConvertAnyToAny(converter unsafe.Pointer, srcs *VImageBuffer, dests *VImageBuffer, ...) int
- func VImageConvertBGRA16UtoRGB16U(bgraSrc *VImageBuffer, rgbDest *VImageBuffer, flags uint32) int
- func VImageConvertBGRA8888toRGB565(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvertBGRA8888toRGB565Dithered(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, dither int, ...) int
- func VImageConvertBGRA8888toRGB888(arg *VImageBuffer, arg2 *VImageBuffer, arg3 uint32) int
- func VImageConvertBGRAFFFFtoRGBFFF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvertBGRX8888ToPlanar8(src *VImageBuffer, blue *VImageBuffer, green *VImageBuffer, red *VImageBuffer, ...) int
- func VImageConvertBGRXFFFFToPlanarF(src *VImageBuffer, blue *VImageBuffer, green *VImageBuffer, red *VImageBuffer, ...) int
- func VImageConvertChunkyToPlanar8(srcChannels unsafe.Pointer, destPlanarBuffers *VImageBuffer, channelCount uint, ...) int
- func VImageConvertChunkyToPlanarF(srcChannels unsafe.Pointer, destPlanarBuffers *VImageBuffer, channelCount uint, ...) int
- func VImageConvertFTo16S(src *VImageBuffer, dest *VImageBuffer, offset float32, scale float32, ...) int
- func VImageConvertFTo16U(src *VImageBuffer, dest *VImageBuffer, offset float32, scale float32, ...) int
- func VImageConvertFto16Q12(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvertIndexed1toPlanar8(src *VImageBuffer, dest *VImageBuffer, colors *uint8, flags uint32) int
- func VImageConvertIndexed2toPlanar8(src *VImageBuffer, dest *VImageBuffer, colors *uint8, flags uint32) int
- func VImageConvertIndexed4toPlanar8(src *VImageBuffer, dest *VImageBuffer, colors *uint8, flags uint32) int
- func VImageConvertPlanar1toPlanar8(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvertPlanar2toPlanar8(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvertPlanar4toPlanar8(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvertPlanar8To16U(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvertPlanar8ToARGBFFFF(alpha *VImageBuffer, red *VImageBuffer, green *VImageBuffer, ...) int
- func VImageConvertPlanar8ToBGRX8888(blue *VImageBuffer, green *VImageBuffer, red *VImageBuffer, alpha uint8, ...) int
- func VImageConvertPlanar8ToBGRXFFFF(blue *VImageBuffer, green *VImageBuffer, red *VImageBuffer, alpha float32, ...) int
- func VImageConvertPlanar8ToXRGB8888(alpha uint8, red *VImageBuffer, green *VImageBuffer, blue *VImageBuffer, ...) int
- func VImageConvertPlanar8ToXRGBFFFF(alpha float32, red *VImageBuffer, green *VImageBuffer, blue *VImageBuffer, ...) int
- func VImageConvertPlanar8toARGB1555(srcA *VImageBuffer, srcR *VImageBuffer, srcG *VImageBuffer, srcB *VImageBuffer, ...) int
- func VImageConvertPlanar8toARGB8888(srcA *VImageBuffer, srcR *VImageBuffer, srcG *VImageBuffer, srcB *VImageBuffer, ...) int
- func VImageConvertPlanar8toIndexed1(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageConvertPlanar8toIndexed2(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageConvertPlanar8toIndexed4(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageConvertPlanar8toPlanar1(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, dither int, ...) int
- func VImageConvertPlanar8toPlanar2(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, dither int, ...) int
- func VImageConvertPlanar8toPlanar4(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, dither int, ...) int
- func VImageConvertPlanar8toPlanar16F(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvertPlanar8toPlanarF(src *VImageBuffer, dest *VImageBuffer, maxFloat float32, minFloat float32, ...) int
- func VImageConvertPlanar8toRGB565(srcR *VImageBuffer, srcG *VImageBuffer, srcB *VImageBuffer, dest *VImageBuffer, ...) int
- func VImageConvertPlanar8toRGB888(planarRed *VImageBuffer, planarGreen *VImageBuffer, planarBlue *VImageBuffer, ...) int
- func VImageConvertPlanar16FtoPlanar8(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvertPlanar16FtoPlanarF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvertPlanar16Q12toARGB16F(alpha *VImageBuffer, red *VImageBuffer, green *VImageBuffer, ...) int
- func VImageConvertPlanar16Q12toARGB8888(alpha *VImageBuffer, red *VImageBuffer, green *VImageBuffer, ...) int
- func VImageConvertPlanar16Q12toRGB16F(red *VImageBuffer, green *VImageBuffer, blue *VImageBuffer, dest *VImageBuffer, ...) int
- func VImageConvertPlanar16Q12toRGB888(red *VImageBuffer, green *VImageBuffer, blue *VImageBuffer, dest *VImageBuffer, ...) int
- func VImageConvertPlanar16UtoARGB16U(aSrc *VImageBuffer, rSrc *VImageBuffer, gSrc *VImageBuffer, bSrc *VImageBuffer, ...) int
- func VImageConvertPlanar16UtoPlanar8Dithered(src *VImageBuffer, dest *VImageBuffer, dither int, flags uint32) int
- func VImageConvertPlanar16UtoRGB16U(rSrc *VImageBuffer, gSrc *VImageBuffer, bSrc *VImageBuffer, ...) int
- func VImageConvertPlanarFToARGB8888(alpha *VImageBuffer, red *VImageBuffer, green *VImageBuffer, ...) int
- func VImageConvertPlanarFToBGRX8888(blue *VImageBuffer, green *VImageBuffer, red *VImageBuffer, alpha uint8, ...) int
- func VImageConvertPlanarFToBGRXFFFF(blue *VImageBuffer, green *VImageBuffer, red *VImageBuffer, alpha float32, ...) int
- func VImageConvertPlanarFToXRGB8888(alpha uint8, red *VImageBuffer, green *VImageBuffer, blue *VImageBuffer, ...) int
- func VImageConvertPlanarFToXRGBFFFF(alpha float32, red *VImageBuffer, green *VImageBuffer, blue *VImageBuffer, ...) int
- func VImageConvertPlanarFtoARGBFFFF(srcA *VImageBuffer, srcR *VImageBuffer, srcG *VImageBuffer, srcB *VImageBuffer, ...) int
- func VImageConvertPlanarFtoPlanar8(src *VImageBuffer, dest *VImageBuffer, maxFloat float32, minFloat float32, ...) int
- func VImageConvertPlanarFtoPlanar8Dithered(src *VImageBuffer, dest *VImageBuffer, maxFloat float32, minFloat float32, ...) int
- func VImageConvertPlanarFtoPlanar16F(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvertPlanarFtoRGBFFF(planarRed *VImageBuffer, planarGreen *VImageBuffer, planarBlue *VImageBuffer, ...) int
- func VImageConvertPlanarToChunky8(srcPlanarBuffers *VImageBuffer, destChannels unsafe.Pointer, channelCount uint, ...) int
- func VImageConvertPlanarToChunkyF(srcPlanarBuffers *VImageBuffer, destChannels unsafe.Pointer, channelCount uint, ...) int
- func VImageConvertRGB16UToARGB8888(src *VImageBuffer, dest *VImageBuffer, permuteMap *uint8, copyMask uint8, ...) int
- func VImageConvertRGB16UtoARGB16U(rgbSrc *VImageBuffer, aSrc *VImageBuffer, alpha uint16, argbDest *VImageBuffer, ...) int
- func VImageConvertRGB16UtoBGRA16U(rgbSrc *VImageBuffer, aSrc *VImageBuffer, alpha uint16, bgraDest *VImageBuffer, ...) int
- func VImageConvertRGB16UtoPlanar16U(rgbSrc *VImageBuffer, rDest *VImageBuffer, gDest *VImageBuffer, ...) int
- func VImageConvertRGB16UtoRGB888Dithered(src *VImageBuffer, dest *VImageBuffer, dither int, flags uint32) int
- func VImageConvertRGB16UtoRGBA16U(rgbSrc *VImageBuffer, aSrc *VImageBuffer, alpha uint16, rgbaDest *VImageBuffer, ...) int
- func VImageConvertRGB565toARGB1555(src *VImageBuffer, dest *VImageBuffer, dither int, flags uint32) int
- func VImageConvertRGB565toARGB8888(alpha uint8, src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvertRGB565toBGRA8888(alpha uint8, src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvertRGB565toPlanar8(src *VImageBuffer, destR *VImageBuffer, destG *VImageBuffer, ...) int
- func VImageConvertRGB565toRGB888(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvertRGB565toRGBA5551(src *VImageBuffer, dest *VImageBuffer, dither int, flags uint32) int
- func VImageConvertRGB565toRGBA8888(alpha uint8, src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvertRGB888toARGB8888(arg *VImageBuffer, arg2 *VImageBuffer, arg3 uint8, arg4 *VImageBuffer, ...) int
- func VImageConvertRGB888toBGRA8888(arg *VImageBuffer, arg2 *VImageBuffer, arg3 uint8, arg4 *VImageBuffer, ...) int
- func VImageConvertRGB888toPlanar8(rgbSrc *VImageBuffer, redDest *VImageBuffer, greenDest *VImageBuffer, ...) int
- func VImageConvertRGB888toPlanar16Q12(src *VImageBuffer, red *VImageBuffer, green *VImageBuffer, blue *VImageBuffer, ...) int
- func VImageConvertRGB888toRGB565Dithered(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, dither int, ...) int
- func VImageConvertRGB888toRGBA8888(arg *VImageBuffer, arg2 *VImageBuffer, arg3 uint8, arg4 *VImageBuffer, ...) int
- func VImageConvertRGBA16UtoRGB16U(rgbaSrc *VImageBuffer, rgbDest *VImageBuffer, flags uint32) int
- func VImageConvertRGBA5551toRGB565(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvertRGBA5551toRGBA8888(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvertRGBA8888toRGB565(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvertRGBA8888toRGB565Dithered(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, dither int, ...) int
- func VImageConvertRGBA8888toRGB888(arg *VImageBuffer, arg2 *VImageBuffer, arg3 uint32) int
- func VImageConvertRGBA8888toRGBA5551(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvertRGBA8888toRGBA5551Dithered(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, dither int, ...) int
- func VImageConvertRGBA1010102ToARGB16Q12(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, ...) int
- func VImageConvertRGBA1010102ToARGB16U(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, ...) int
- func VImageConvertRGBA1010102ToARGB8888(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, ...) int
- func VImageConvertRGBAFFFFtoRGBFFF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageConvertRGBFFFtoARGBFFFF(arg *VImageBuffer, arg2 *VImageBuffer, arg3 float32, arg4 *VImageBuffer, ...) int
- func VImageConvertRGBFFFtoBGRAFFFF(arg *VImageBuffer, arg2 *VImageBuffer, arg3 float32, arg4 *VImageBuffer, ...) int
- func VImageConvertRGBFFFtoPlanarF(rgbSrc *VImageBuffer, redDest *VImageBuffer, greenDest *VImageBuffer, ...) int
- func VImageConvertRGBFFFtoRGB888Dithered(src *VImageBuffer, dest *VImageBuffer, maxFloat *float32, minFloat *float32, ...) int
- func VImageConvertRGBFFFtoRGBAFFFF(arg *VImageBuffer, arg2 *VImageBuffer, arg3 float32, arg4 *VImageBuffer, ...) int
- func VImageConvertXRGB8888ToPlanar8(src *VImageBuffer, red *VImageBuffer, green *VImageBuffer, blue *VImageBuffer, ...) int
- func VImageConvertXRGB2101010ToARGB16F(src *VImageBuffer, alpha float32, dest *VImageBuffer, rgb101010RangeMin int32, ...) int
- func VImageConvertXRGB2101010ToARGB16Q12(src *VImageBuffer, alpha int16, dest *VImageBuffer, rgb101010RangeMin int32, ...) int
- func VImageConvertXRGB2101010ToARGB16U(src *VImageBuffer, alpha uint16, dest *VImageBuffer, rgb101010RangeMin int32, ...) int
- func VImageConvertXRGB2101010ToARGB8888(src *VImageBuffer, alpha uint8, dest *VImageBuffer, rgb101010RangeMin int32, ...) int
- func VImageConvertXRGB2101010ToARGBFFFF(src *VImageBuffer, alpha float32, dest *VImageBuffer, rgb101010RangeMin int32, ...) int
- func VImageConvertXRGBFFFFToPlanarF(src *VImageBuffer, red *VImageBuffer, green *VImageBuffer, blue *VImageBuffer, ...) int
- func VImageConvertYpCbCrToARGBGenerateConversion(matrix *VImageYpCbCrToARGBMatrix, pixelRange *VImageYpCbCrPixelRange, ...) int
- func VImageConverterCreateForCGToCVImageFormat(srcFormat *VImageCGImageFormat, destFormat unsafe.Pointer, ...) unsafe.Pointer
- func VImageConverterCreateForCVToCGImageFormat(srcFormat unsafe.Pointer, destFormat *VImageCGImageFormat, ...) unsafe.Pointer
- func VImageConverterCreateWithCGColorConversionInfo(colorConversionInfoRef unsafe.Pointer, sFormat *VImageCGImageFormat, ...) unsafe.Pointer
- func VImageConverterCreateWithCGImageFormat(srcFormat *VImageCGImageFormat, destFormat *VImageCGImageFormat, ...) unsafe.Pointer
- func VImageConverterCreateWithColorSyncCodeFragment(codeFragment unsafe.Pointer, srcFormat *VImageCGImageFormat, ...) unsafe.Pointer
- func VImageConverterGetDestinationBufferOrder(converter unsafe.Pointer) *uint32
- func VImageConverterGetNumberOfDestinationBuffers(converter unsafe.Pointer) uint
- func VImageConverterGetNumberOfSourceBuffers(converter unsafe.Pointer) uint
- func VImageConverterGetSourceBufferOrder(converter unsafe.Pointer) *uint32
- func VImageConverterMustOperateOutOfPlace(converter unsafe.Pointer, srcs *VImageBuffer, dests *VImageBuffer, ...) int
- func VImageConverterRelease(converter unsafe.Pointer)
- func VImageConverterRetain(converter unsafe.Pointer)
- func VImageConvolveARGB16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageConvolveARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageConvolveARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageConvolveFloatKernelARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageConvolveMultiKernelARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageConvolveMultiKernelARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageConvolvePlanar8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageConvolvePlanar16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageConvolvePlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageConvolveWithBiasARGB16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageConvolveWithBiasARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageConvolveWithBiasARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageConvolveWithBiasPlanar8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageConvolveWithBiasPlanar16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageConvolveWithBiasPlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageCopyBuffer(src *VImageBuffer, dest *VImageBuffer, pixelSize uint, flags uint32) int
- func VImageCreateCGImageFromBuffer(buf *VImageBuffer, format *VImageCGImageFormat, callback unsafe.Pointer, ...) unsafe.Pointer
- func VImageCreateGammaFunction(gamma float32, gammaType int, flags uint32) unsafe.Pointer
- func VImageCreateMonochromeColorSpaceWithWhitePointAndTransferFunction(whitePoint *VImageWhitePoint, tf *VImageTransferFunction, ...) unsafe.Pointer
- func VImageCreateRGBColorSpaceWithPrimariesAndTransferFunction(primaries *VImageRGBPrimaries, tf *VImageTransferFunction, ...) unsafe.Pointer
- func VImageDestroyGammaFunction(f unsafe.Pointer)
- func VImageDestroyResamplingFilter(filter unsafe.Pointer)
- func VImageDilateARGB8888(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageDilateARGBFFFF(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageDilatePlanar8(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageDilatePlanarF(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageEndsInContrastStretchARGB8888(src *VImageBuffer, dest *VImageBuffer, percentLow *uint32, percentHigh *uint32, ...) int
- func VImageEndsInContrastStretchARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageEndsInContrastStretchPlanar8(src *VImageBuffer, dest *VImageBuffer, percentLow uint, percentHigh uint, ...) int
- func VImageEndsInContrastStretchPlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageEqualizationARGB8888(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageEqualizationARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageEqualizationPlanar8(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageEqualizationPlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageErodeARGB8888(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageErodeARGBFFFF(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageErodePlanar8(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageErodePlanarF(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageExtractChannelARGB16U(src *VImageBuffer, dest *VImageBuffer, channelIndex int, flags uint32) int
- func VImageExtractChannelARGB8888(src *VImageBuffer, dest *VImageBuffer, channelIndex int, flags uint32) int
- func VImageExtractChannelARGBFFFF(src *VImageBuffer, dest *VImageBuffer, channelIndex int, flags uint32) int
- func VImageFlattenARGB16Q12(argbSrc *VImageBuffer, argbDst *VImageBuffer, argbBackgroundColorPtr *int16, ...) int
- func VImageFlattenARGB16U(argbSrc *VImageBuffer, argbDst *VImageBuffer, argbBackgroundColorPtr *uint16, ...) int
- func VImageFlattenARGB8888(argbSrc *VImageBuffer, argbDst *VImageBuffer, argbBackgroundColorPtr *uint8, ...) int
- func VImageFlattenARGB8888ToRGB888(arg *VImageBuffer, arg2 *VImageBuffer, arg3 *uint8, arg4 bool, arg5 uint32) int
- func VImageFlattenARGBFFFF(argbSrc *VImageBuffer, argbDst *VImageBuffer, argbBackgroundColorPtr *float32, ...) int
- func VImageFlattenARGBFFFFToRGBFFF(arg *VImageBuffer, arg2 *VImageBuffer, arg3 *float32, arg4 bool, arg5 uint32) int
- func VImageFlattenBGRA8888ToRGB888(arg *VImageBuffer, arg2 *VImageBuffer, arg3 *uint8, arg4 bool, arg5 uint32) int
- func VImageFlattenBGRAFFFFToRGBFFF(arg *VImageBuffer, arg2 *VImageBuffer, arg3 *float32, arg4 bool, arg5 uint32) int
- func VImageFlattenRGBA16Q12(argbSrc *VImageBuffer, argbDst *VImageBuffer, argbBackgroundColorPtr *int16, ...) int
- func VImageFlattenRGBA16U(rgbaSrc *VImageBuffer, rgbaDst *VImageBuffer, rgbaBackgroundColorPtr *uint16, ...) int
- func VImageFlattenRGBA8888(rgbaSrc *VImageBuffer, rgbaDst *VImageBuffer, rgbaBackgroundColorPtr *uint8, ...) int
- func VImageFlattenRGBA8888ToRGB888(arg *VImageBuffer, arg2 *VImageBuffer, arg3 *uint8, arg4 bool, arg5 uint32) int
- func VImageFlattenRGBAFFFF(rgbaSrc *VImageBuffer, rgbaDst *VImageBuffer, rgbaBackgroundColorPtr *float32, ...) int
- func VImageFlattenRGBAFFFFToRGBFFF(arg *VImageBuffer, arg2 *VImageBuffer, arg3 *float32, arg4 bool, arg5 uint32) int
- func VImageFloodFillARGB16U(srcDest *VImageBuffer, tempBuffer unsafe.Pointer, seedX uint, seedY uint, ...) int
- func VImageFloodFillARGB8888(srcDest *VImageBuffer, tempBuffer unsafe.Pointer, seedX uint, seedY uint, ...) int
- func VImageFloodFillPlanar8(srcDest *VImageBuffer, tempBuffer unsafe.Pointer, seedX uint, seedY uint, ...) int
- func VImageFloodFillPlanar16U(srcDest *VImageBuffer, tempBuffer unsafe.Pointer, seedX uint, seedY uint, ...) int
- func VImageGammaPlanar8toPlanarF(src *VImageBuffer, dest *VImageBuffer, gamma unsafe.Pointer, flags uint32) int
- func VImageGammaPlanarF(src *VImageBuffer, dest *VImageBuffer, gamma unsafe.Pointer, flags uint32) int
- func VImageGammaPlanarFtoPlanar8(src *VImageBuffer, dest *VImageBuffer, gamma unsafe.Pointer, flags uint32) int
- func VImageGetPerspectiveWarp(srcPoints unsafe.Pointer, destPoints unsafe.Pointer, ...) int
- func VImageGetResamplingFilterExtent(filter unsafe.Pointer, flags uint32) uint
- func VImageGetResamplingFilterSize(scale float32, kernelFunc unsafe.Pointer, kernelWidth float32, flags uint32) uint
- func VImageHistogramCalculationARGB8888(src *VImageBuffer, histogram *uint, flags uint32) int
- func VImageHistogramCalculationARGBFFFF(src *VImageBuffer, histogram *uint, histogramEntries uint, minVal float32, ...) int
- func VImageHistogramCalculationPlanar8(src *VImageBuffer, histogram *uint, flags uint32) int
- func VImageHistogramCalculationPlanarF(src *VImageBuffer, histogram *uint, histogramEntries uint, minVal float32, ...) int
- func VImageHistogramSpecificationARGB8888(src *VImageBuffer, dest *VImageBuffer, desiredHistogram *uint, flags uint32) int
- func VImageHistogramSpecificationARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageHistogramSpecificationPlanar8(src *VImageBuffer, dest *VImageBuffer, desiredHistogram *uint, flags uint32) int
- func VImageHistogramSpecificationPlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageHorizontalReflectARGB16F(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageHorizontalReflectARGB16S(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageHorizontalReflectARGB16U(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageHorizontalReflectARGB8888(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageHorizontalReflectARGBFFFF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageHorizontalReflectCbCr16F(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageHorizontalReflectPlanar8(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageHorizontalReflectPlanar16F(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageHorizontalReflectPlanar16U(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageHorizontalReflectPlanarF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageHorizontalShearARGB16F(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageHorizontalShearARGB16S(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageHorizontalShearARGB16U(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageHorizontalShearARGB8888(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageHorizontalShearARGBFFFF(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageHorizontalShearCbCr8(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageHorizontalShearCbCr16F(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageHorizontalShearCbCr16S(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageHorizontalShearCbCr16U(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageHorizontalShearDARGB16F(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageHorizontalShearDARGB16S(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageHorizontalShearDARGB16U(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageHorizontalShearDARGB8888(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageHorizontalShearDARGBFFFF(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageHorizontalShearDCbCr16F(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageHorizontalShearDCbCr16S(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageHorizontalShearDCbCr16U(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageHorizontalShearDPlanar8(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageHorizontalShearDPlanar16F(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageHorizontalShearDPlanarF(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageHorizontalShearPlanar8(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageHorizontalShearPlanar16F(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageHorizontalShearPlanar16S(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageHorizontalShearPlanar16U(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageHorizontalShearPlanarF(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageHorizontalShearXRGB2101010W(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageInterpolatedLookupTablePlanarF(src *VImageBuffer, dest *VImageBuffer, table *float32, tableEntries uint, ...) int
- func VImageLookupTable8to64U(src *VImageBuffer, dest *VImageBuffer, lut *uint64, flags uint32) int
- func VImageLookupTablePlanar8toPlanar16(src *VImageBuffer, dest *VImageBuffer, table *uint16, flags uint32) int
- func VImageLookupTablePlanar8toPlanar24(src *VImageBuffer, dest *VImageBuffer, table *uint32, flags uint32) int
- func VImageLookupTablePlanar8toPlanar48(src *VImageBuffer, dest *VImageBuffer, table *uint64, flags uint32) int
- func VImageLookupTablePlanar8toPlanar96(src *VImageBuffer, dest *VImageBuffer, table *[4]float32, flags uint32) int
- func VImageLookupTablePlanar8toPlanar128(src *VImageBuffer, dest *VImageBuffer, table *[4]float32, flags uint32) int
- func VImageLookupTablePlanar8toPlanarF(src *VImageBuffer, dest *VImageBuffer, table *float32, flags uint32) int
- func VImageLookupTablePlanar16(src *VImageBuffer, dest *VImageBuffer, table *uint16, flags uint32) int
- func VImageLookupTablePlanarFtoPlanar8(src *VImageBuffer, dest *VImageBuffer, table *uint8, flags uint32) int
- func VImageMatrixMultiplyARGB8888(src *VImageBuffer, dest *VImageBuffer, matrix *int16, divisor int32, ...) int
- func VImageMatrixMultiplyARGB8888ToPlanar8(src *VImageBuffer, dest *VImageBuffer, matrix *int16, divisor int32, ...) int
- func VImageMatrixMultiplyARGBFFFF(src *VImageBuffer, dest *VImageBuffer, matrix *float32, preBias *float32, ...) int
- func VImageMatrixMultiplyARGBFFFFToPlanarF(src *VImageBuffer, dest *VImageBuffer, matrix *float32, preBias *float32, ...) int
- func VImageMatrixMultiplyPlanar8(srcs *VImageBuffer, dests *VImageBuffer, srcPlanes uint32, destPlanes uint32, ...) int
- func VImageMatrixMultiplyPlanar16S(srcs *VImageBuffer, dests *VImageBuffer, srcPlanes uint32, destPlanes uint32, ...) int
- func VImageMatrixMultiplyPlanarF(srcs *VImageBuffer, dests *VImageBuffer, srcPlanes uint32, destPlanes uint32, ...) int
- func VImageMaxARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageMaxARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageMaxPlanar8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageMaxPlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageMinARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageMinARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageMinPlanar8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageMinPlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageMultiDimensionalInterpolatedLookupTablePlanar16Q12(srcs *VImageBuffer, dests *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageMultiDimensionalInterpolatedLookupTablePlanarF(srcs *VImageBuffer, dests *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageMultidimensionalTableCreate(tableData *uint16, numSrcChannels uint32, numDestChannels uint32, ...) unsafe.Pointer
- func VImageMultidimensionalTableRelease(table unsafe.Pointer) int
- func VImageMultidimensionalTableRetain(table unsafe.Pointer) int
- func VImageNewResamplingFilter(scale float32, flags uint32) unsafe.Pointer
- func VImageNewResamplingFilterForFunctionUsingBuffer(filter unsafe.Pointer, scale float32, kernelFunc unsafe.Pointer, ...) int
- func VImageOverwriteChannelsARGB8888(newSrc *VImageBuffer, origSrc *VImageBuffer, dest *VImageBuffer, ...) int
- func VImageOverwriteChannelsARGBFFFF(newSrc *VImageBuffer, origSrc *VImageBuffer, dest *VImageBuffer, ...) int
- func VImageOverwriteChannelsWithPixelARGB16U(thePixel *uint16, src *VImageBuffer, dest *VImageBuffer, copyMask uint8, ...) int
- func VImageOverwriteChannelsWithPixelARGB8888(thePixel *uint8, src *VImageBuffer, dest *VImageBuffer, copyMask uint8, ...) int
- func VImageOverwriteChannelsWithPixelARGBFFFF(thePixel *float32, src *VImageBuffer, dest *VImageBuffer, copyMask uint8, ...) int
- func VImageOverwriteChannelsWithScalarARGB8888(scalar uint8, src *VImageBuffer, dest *VImageBuffer, copyMask uint8, ...) int
- func VImageOverwriteChannelsWithScalarARGBFFFF(scalar float32, src *VImageBuffer, dest *VImageBuffer, copyMask uint8, ...) int
- func VImageOverwriteChannelsWithScalarPlanar8(scalar uint8, dest *VImageBuffer, flags uint32) int
- func VImageOverwriteChannelsWithScalarPlanar16F(scalar uint16, dest *VImageBuffer, flags uint32) int
- func VImageOverwriteChannelsWithScalarPlanar16S(scalar int16, dest *VImageBuffer, flags uint32) int
- func VImageOverwriteChannelsWithScalarPlanar16U(scalar uint16, dest *VImageBuffer, flags uint32) int
- func VImageOverwriteChannelsWithScalarPlanarF(scalar float32, dest *VImageBuffer, flags uint32) int
- func VImagePNGDecompressionFilter(buffer *VImageBuffer, startScanline uint, scanlineCount uint, ...) int
- func VImagePermuteChannelsARGB16F(src *VImageBuffer, dest *VImageBuffer, permuteMap *uint8, flags uint32) int
- func VImagePermuteChannelsARGB16U(src *VImageBuffer, dest *VImageBuffer, permuteMap *uint8, flags uint32) int
- func VImagePermuteChannelsARGB8888(src *VImageBuffer, dest *VImageBuffer, permuteMap *uint8, flags uint32) int
- func VImagePermuteChannelsARGBFFFF(src *VImageBuffer, dest *VImageBuffer, permuteMap *uint8, flags uint32) int
- func VImagePermuteChannelsRGB888(src *VImageBuffer, dest *VImageBuffer, permuteMap *uint8, flags uint32) int
- func VImagePermuteChannelsWithMaskedInsertARGB16U(src *VImageBuffer, dest *VImageBuffer, permuteMap *uint8, copyMask uint8, ...) int
- func VImagePermuteChannelsWithMaskedInsertARGB8888(src *VImageBuffer, dest *VImageBuffer, permuteMap *uint8, copyMask uint8, ...) int
- func VImagePermuteChannelsWithMaskedInsertARGBFFFF(src *VImageBuffer, dest *VImageBuffer, permuteMap *uint8, copyMask uint8, ...) int
- func VImagePerspectiveWarpARGB16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImagePerspectiveWarpARGB16U(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImagePerspectiveWarpARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImagePerspectiveWarpPlanar8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImagePerspectiveWarpPlanar16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImagePerspectiveWarpPlanar16U(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImagePiecewiseGammaPlanar8(src *VImageBuffer, dest *VImageBuffer, exponentialCoeffs *float32, ...) int
- func VImagePiecewiseGammaPlanar8toPlanar16Q12(src *VImageBuffer, dest *VImageBuffer, exponentialCoeffs *float32, ...) int
- func VImagePiecewiseGammaPlanar8toPlanarF(src *VImageBuffer, dest *VImageBuffer, exponentialCoeffs *float32, ...) int
- func VImagePiecewiseGammaPlanar16Q12(src *VImageBuffer, dest *VImageBuffer, exponentialCoeffs *float32, ...) int
- func VImagePiecewiseGammaPlanar16Q12toPlanar8(src *VImageBuffer, dest *VImageBuffer, exponentialCoeffs *float32, ...) int
- func VImagePiecewiseGammaPlanarF(src *VImageBuffer, dest *VImageBuffer, exponentialCoeffs *float32, ...) int
- func VImagePiecewiseGammaPlanarFtoPlanar8(src *VImageBuffer, dest *VImageBuffer, exponentialCoeffs *float32, ...) int
- func VImagePiecewisePolynomialPlanar8toPlanarF(src *VImageBuffer, dest *VImageBuffer, coefficients *float32, ...) int
- func VImagePiecewisePolynomialPlanarF(src *VImageBuffer, dest *VImageBuffer, coefficients *float32, ...) int
- func VImagePiecewisePolynomialPlanarFtoPlanar8(src *VImageBuffer, dest *VImageBuffer, coefficients *float32, ...) int
- func VImagePiecewiseRationalPlanarF(src *VImageBuffer, dest *VImageBuffer, topCoefficients *float32, ...) int
- func VImagePremultipliedAlphaBlendARGB8888(srcTop *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, ...) int
- func VImagePremultipliedAlphaBlendARGBFFFF(srcTop *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, ...) int
- func VImagePremultipliedAlphaBlendBGRA8888(srcTop *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, ...) int
- func VImagePremultipliedAlphaBlendBGRAFFFF(srcTop *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, ...) int
- func VImagePremultipliedAlphaBlendDarkenRGBA8888(srcTop *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, ...) int
- func VImagePremultipliedAlphaBlendLightenRGBA8888(srcTop *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, ...) int
- func VImagePremultipliedAlphaBlendMultiplyRGBA8888(srcTop *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, ...) int
- func VImagePremultipliedAlphaBlendPlanar8(srcTop *VImageBuffer, srcTopAlpha *VImageBuffer, srcBottom *VImageBuffer, ...) int
- func VImagePremultipliedAlphaBlendPlanarF(srcTop *VImageBuffer, srcTopAlpha *VImageBuffer, srcBottom *VImageBuffer, ...) int
- func VImagePremultipliedAlphaBlendScreenRGBA8888(srcTop *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, ...) int
- func VImagePremultipliedAlphaBlendWithPermuteARGB8888(srcTop *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, ...) int
- func VImagePremultipliedAlphaBlendWithPermuteRGBA8888(srcTop *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, ...) int
- func VImagePremultipliedConstAlphaBlendARGB8888(srcTop *VImageBuffer, constAlpha uint8, srcBottom *VImageBuffer, ...) int
- func VImagePremultipliedConstAlphaBlendARGBFFFF(srcTop *VImageBuffer, constAlpha float32, srcBottom *VImageBuffer, ...) int
- func VImagePremultipliedConstAlphaBlendPlanar8(srcTop *VImageBuffer, constAlpha uint8, srcTopAlpha *VImageBuffer, ...) int
- func VImagePremultipliedConstAlphaBlendPlanarF(srcTop *VImageBuffer, constAlpha float32, srcTopAlpha *VImageBuffer, ...) int
- func VImagePremultiplyDataARGB16Q12(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImagePremultiplyDataARGB16U(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImagePremultiplyDataARGB8888(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImagePremultiplyDataARGBFFFF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImagePremultiplyDataPlanar8(src *VImageBuffer, alpha *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImagePremultiplyDataPlanarF(src *VImageBuffer, alpha *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImagePremultiplyDataRGBA16F(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImagePremultiplyDataRGBA16Q12(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImagePremultiplyDataRGBA16U(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImagePremultiplyDataRGBA8888(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImagePremultiplyDataRGBAFFFF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageRichardsonLucyDeConvolveARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageRichardsonLucyDeConvolveARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageRichardsonLucyDeConvolvePlanar8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageRichardsonLucyDeConvolvePlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageRotate90ARGB16F(src *VImageBuffer, dest *VImageBuffer, rotationConstant uint8, ...) int
- func VImageRotate90ARGB16S(src *VImageBuffer, dest *VImageBuffer, rotationConstant uint8, ...) int
- func VImageRotate90ARGB16U(src *VImageBuffer, dest *VImageBuffer, rotationConstant uint8, ...) int
- func VImageRotate90ARGB8888(src *VImageBuffer, dest *VImageBuffer, rotationConstant uint8, ...) int
- func VImageRotate90ARGBFFFF(src *VImageBuffer, dest *VImageBuffer, rotationConstant uint8, ...) int
- func VImageRotate90CbCr16F(src *VImageBuffer, dest *VImageBuffer, rotationConstant uint8, ...) int
- func VImageRotate90Planar8(src *VImageBuffer, dest *VImageBuffer, rotationConstant uint8, backColor uint8, ...) int
- func VImageRotate90Planar16F(src *VImageBuffer, dest *VImageBuffer, rotationConstant uint8, ...) int
- func VImageRotate90Planar16U(src *VImageBuffer, dest *VImageBuffer, rotationConstant uint8, ...) int
- func VImageRotate90PlanarF(src *VImageBuffer, dest *VImageBuffer, rotationConstant uint8, ...) int
- func VImageRotateARGB16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageRotateARGB16S(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageRotateARGB16U(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageRotateARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageRotateARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageRotateCbCr16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageRotatePlanar8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageRotatePlanar16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageRotatePlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageScaleARGB16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, flags uint32) int
- func VImageScaleARGB16S(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, flags uint32) int
- func VImageScaleARGB16U(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, flags uint32) int
- func VImageScaleARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, flags uint32) int
- func VImageScaleARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, flags uint32) int
- func VImageScaleCbCr8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, flags uint32) int
- func VImageScaleCbCr16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, flags uint32) int
- func VImageScaleCbCr16U(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, flags uint32) int
- func VImageScalePlanar8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, flags uint32) int
- func VImageScalePlanar16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, flags uint32) int
- func VImageScalePlanar16S(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, flags uint32) int
- func VImageScalePlanar16U(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, flags uint32) int
- func VImageScalePlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, flags uint32) int
- func VImageScaleXRGB2101010W(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, flags uint32) int
- func VImageSelectChannelsARGB8888(newSrc *VImageBuffer, origSrc *VImageBuffer, dest *VImageBuffer, ...) int
- func VImageSelectChannelsARGBFFFF(newSrc *VImageBuffer, origSrc *VImageBuffer, dest *VImageBuffer, ...) int
- func VImageSepConvolveARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageSepConvolvePlanar8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageSepConvolvePlanar8to16U(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageSepConvolvePlanar16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageSepConvolvePlanar16U(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageSepConvolvePlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageSymmetricPiecewiseGammaPlanar16Q12(src *VImageBuffer, dest *VImageBuffer, exponentialCoeffs *float32, ...) int
- func VImageSymmetricPiecewiseGammaPlanarF(src *VImageBuffer, dest *VImageBuffer, exponentialCoeffs *float32, ...) int
- func VImageSymmetricPiecewisePolynomialPlanarF(src *VImageBuffer, dest *VImageBuffer, coefficients *float32, ...) int
- func VImageTableLookUpARGB8888(src *VImageBuffer, dest *VImageBuffer, alphaTable *uint8, redTable *uint8, ...) int
- func VImageTableLookUpPlanar8(src *VImageBuffer, dest *VImageBuffer, table *uint8, flags uint32) int
- func VImageTentConvolveARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageTentConvolvePlanar8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, ...) int
- func VImageUnpremultiplyDataARGB16Q12(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageUnpremultiplyDataARGB16U(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageUnpremultiplyDataARGB8888(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageUnpremultiplyDataARGBFFFF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageUnpremultiplyDataPlanar8(src *VImageBuffer, alpha *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageUnpremultiplyDataPlanarF(src *VImageBuffer, alpha *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageUnpremultiplyDataRGBA16F(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageUnpremultiplyDataRGBA16Q12(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageUnpremultiplyDataRGBA16U(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageUnpremultiplyDataRGBA8888(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageUnpremultiplyDataRGBAFFFF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageVerticalReflectARGB16F(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageVerticalReflectARGB16S(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageVerticalReflectARGB16U(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageVerticalReflectARGB8888(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageVerticalReflectARGBFFFF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageVerticalReflectCbCr16F(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageVerticalReflectPlanar8(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageVerticalReflectPlanar16F(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageVerticalReflectPlanar16U(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageVerticalReflectPlanarF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
- func VImageVerticalShearARGB16F(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageVerticalShearARGB16S(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageVerticalShearARGB16U(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageVerticalShearARGB8888(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageVerticalShearARGBFFFF(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageVerticalShearCbCr8(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageVerticalShearCbCr16F(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageVerticalShearCbCr16S(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageVerticalShearCbCr16U(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageVerticalShearDARGB16F(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageVerticalShearDARGB16S(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageVerticalShearDARGB16U(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageVerticalShearDARGB8888(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageVerticalShearDARGBFFFF(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageVerticalShearDCbCr16F(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageVerticalShearDCbCr16S(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageVerticalShearDCbCr16U(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageVerticalShearDPlanar8(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageVerticalShearDPlanar16F(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageVerticalShearDPlanarF(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageVerticalShearPlanar8(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageVerticalShearPlanar16F(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageVerticalShearPlanar16S(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageVerticalShearPlanar16U(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageVerticalShearPlanarF(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- func VImageVerticalShearXRGB2101010W(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, ...) int
- type Acl_entry_id_t
- type Acl_flag_t
- type Acl_perm_t
- type Acl_tag_t
- type Acl_type_t
- type Clockid_t
- type Dispatch_autorelease_frequency_t
- type Dispatch_block_flags_t
- type EvCmd
- type Filesec_property_t
- type Idtype_t
- type Ipc_info_object_type_t
- type Launch_data_type_t
- type MDLabelDomain
- type MDQueryOptionFlags
- type MDQuerySortOptionFlags
- type Mach_vm_range_flags_t
- type Mach_vm_range_flavor_t
- type Mach_vm_range_tag_t
- type Mpo_flags_t
- type NXMouseButton
- type Os_clockid_t
- type PMPageToPaperMappingType
- type Ptrauth_key
- type Qos_class_t
- type VImageARGBToYpCbCr
- type VImageARGBToYpCbCrMatrix
- type VImageARGBType
- type VImageAffineTransform
- type VImageAffineTransformDouble
- type VImageBuffer
- type VImageCGImageFormat
- type VImageCVImageFormat
- type VImageChannelDescription
- type VImageConverter
- type VImageMDTableUsageHint
- type VImageMultidimensionalTableData
- type VImagePerpsectiveTransform
- type VImageRGBPrimaries
- type VImageTransferFunction
- type VImageWhitePoint
- type VImageYpCbCrPixelRange
- type VImageYpCbCrToARGB
- type VImageYpCbCrToARGBMatrix
- type VImageYpCbCrType
- type VImage_InterpolationMethod
- type Virtual_memory_guard_exception_code_t
- type Xpc_listener_create_flags_t
- type Xpc_session_create_flags_t
Constants ¶
const ( KRotate0DegreesClockwise = 0 KRotate0DegreesCounterClockwise = 0 KRotate180DegreesClockwise = 2 KRotate180DegreesCounterClockwise = 2 KRotate270DegreesClockwise = 1 KRotate270DegreesCounterClockwise = 3 KRotate90DegreesClockwise = 3 KRotate90DegreesCounterClockwise = 1 )
const ( KvImageBufferTypeCode_Alpha = 17 KvImageBufferTypeCode_CGFormat = 24 KvImageBufferTypeCode_CMYK_Black = 4 KvImageBufferTypeCode_CMYK_Cyan = 1 KvImageBufferTypeCode_CMYK_Magenta = 2 KvImageBufferTypeCode_CMYK_Yellow = 3 KvImageBufferTypeCode_CVPixelBuffer_YCbCr = 19 KvImageBufferTypeCode_Cb = 22 KvImageBufferTypeCode_Chroma = 21 KvImageBufferTypeCode_Chunky = 25 KvImageBufferTypeCode_ColorSpaceChannel1 = 1 KvImageBufferTypeCode_ColorSpaceChannel10 = 10 KvImageBufferTypeCode_ColorSpaceChannel11 = 11 KvImageBufferTypeCode_ColorSpaceChannel12 = 12 KvImageBufferTypeCode_ColorSpaceChannel13 = 13 KvImageBufferTypeCode_ColorSpaceChannel14 = 14 KvImageBufferTypeCode_ColorSpaceChannel15 = 15 KvImageBufferTypeCode_ColorSpaceChannel16 = 16 KvImageBufferTypeCode_ColorSpaceChannel2 = 2 KvImageBufferTypeCode_ColorSpaceChannel3 = 3 KvImageBufferTypeCode_ColorSpaceChannel4 = 4 KvImageBufferTypeCode_ColorSpaceChannel5 = 5 KvImageBufferTypeCode_ColorSpaceChannel6 = 6 KvImageBufferTypeCode_ColorSpaceChannel7 = 7 KvImageBufferTypeCode_ColorSpaceChannel8 = 8 KvImageBufferTypeCode_ColorSpaceChannel9 = 9 KvImageBufferTypeCode_Cr = 23 KvImageBufferTypeCode_EndOfList = 0 KvImageBufferTypeCode_Indexed = 18 KvImageBufferTypeCode_LAB_A = 2 KvImageBufferTypeCode_LAB_B = 3 KvImageBufferTypeCode_LAB_L = 1 KvImageBufferTypeCode_Luminance = 20 KvImageBufferTypeCode_Monochrome = 1 KvImageBufferTypeCode_RGB_Blue = 3 KvImageBufferTypeCode_RGB_Green = 2 KvImageBufferTypeCode_RGB_Red = 1 KvImageBufferTypeCode_UniqueFormatCount = 26 KvImageBufferTypeCode_XYZ_X = 1 KvImageBufferTypeCode_XYZ_Y = 2 KvImageBufferTypeCode_XYZ_Z = 3 )
const ( KvImageCVImageFormat_AlphaIsOneHint = -21604 KvImageCVImageFormat_ChromaSiting = -21601 KvImageCVImageFormat_ColorSpace = -21602 KvImageCVImageFormat_ConversionMatrix = -21600 KvImageCVImageFormat_NoError = 0 KvImageCVImageFormat_VideoChannelDescription = -21603 )
const ( KvImageConvert_DitherAtkinson = 4 KvImageConvert_DitherFloydSteinberg = 3 KvImageConvert_DitherNone = 0 KvImageConvert_DitherOrdered = 1 KvImageConvert_DitherOrderedReproducible = 2 KvImageConvert_OrderedGaussianBlue = 0 KvImageConvert_OrderedNoiseShapeMask = 4026531840 KvImageConvert_OrderedUniformBlue = 268435456 )
const ( KvImageGamma_11_over_5_half_precision = 5 KvImageGamma_11_over_9_half_precision = 8 KvImageGamma_5_over_11_half_precision = 4 KvImageGamma_5_over_9_half_precision = 2 KvImageGamma_9_over_11_half_precision = 9 KvImageGamma_9_over_5_half_precision = 3 KvImageGamma_BT709_forward_half_precision = 10 KvImageGamma_BT709_reverse_half_precision = 11 KvImageGamma_UseGammaValue = 0 KvImageGamma_UseGammaValue_half_precision = 1 KvImageGamma_sRGB_forward_half_precision = 6 KvImageGamma_sRGB_reverse_half_precision = 7 )
const ( KvImageInterpolationLinear = 1 KvImageInterpolationNearest = 0 )
const ( KvImageMatrixType_ARGBToYpCbCrMatrix = 1 KvImageMatrixType_None = 0 )
const ( KvImageBufferSizeMismatch = -21774 KvImageColorSyncIsAbsent = -21779 KvImageCoreVideoIsAbsent = -21784 KvImageInternalError = -21776 KvImageInvalidCVImageFormat = -21782 KvImageInvalidEdgeStyle = -21768 KvImageInvalidImageFormat = -21778 KvImageInvalidImageObject = -21781 KvImageInvalidKernelSize = -21767 KvImageInvalidOffset_X = -21769 KvImageInvalidOffset_Y = -21770 KvImageInvalidParameter = -21773 KvImageInvalidRowBytes = -21777 KvImageMemoryAllocationError = -21771 KvImageNoError = 0 KvImageNullPointerArgument = -21772 KvImageOutOfPlaceOperationRequired = -21780 KvImageRoiLargerThanInputBuffer = -21766 KvImageUnknownFlagsBit = -21775 KvImageUnsupportedConversion = -21783 )
const ( KvImageBackgroundColorFill = 4 KvImageCopyInPlace = 2 KvImageDoNotClamp = 2048 KvImageDoNotTile = 16 KvImageEdgeExtend = 8 KvImageGetTempBufferSize = 128 KvImageHDRContent = 1024 KvImageHighQualityResampling = 32 KvImageLeaveAlphaUnchanged = 1 KvImageNoAllocate = 512 KvImageNoFlags = 0 KvImagePrintDiagnosticsToConsole = 256 KvImageTruncateKernel = 64 KvImageUseFP16Accumulator = 4096 )
const ( KvImage_PNG_FILTER_VALUE_AVG = 3 KvImage_PNG_FILTER_VALUE_NONE = 0 KvImage_PNG_FILTER_VALUE_PAETH = 4 KvImage_PNG_FILTER_VALUE_SUB = 1 KvImage_PNG_FILTER_VALUE_UP = 2 )
Variables ¶
This section is empty.
Functions ¶
func KvImageDecodeArray_16Q12Format ¶
func KvImageDecodeArray_16Q12Format() *float64
@const kvImageDecodeArray_16Q12Format @abstract Predefined decode array constant to use with 16Q12 formatted data @discussion 16Q12 data is a signed 16-bit fixed point integer. The format is implicitly divided by 2**12 to give a range of [-8,8) (SHRT_MIN/4096,SHRT_MAX/4096). The type is present to allow 8-bit content to be converted into other colorspaces and operated on without undue loss of precision or loss of color gamut due to clamping. This constant is "magic" in the sense that it is identified by address. Copying the values here will cause a CG format to be instead interpreted as a _unsigned_ 16 bit format. 16Q12 pixels do not follow CG image format conventions in two respects. The format is signed. The alpha channel is subject to the decode array transform too, meaning that 0 is transparent and 4096 opaque. Consequently, ALL buffers that use this format must be tagged with the kvImageDecodeArray_16Q12Format decode array.
func SymbolAvailable ¶
SymbolAvailable reports whether the named C symbol was bound when the library loaded. Calling a generated wrapper whose symbol is unavailable dereferences a nil function variable and panics.
func VImageAffineWarpARGB16F ¶
func VImageAffineWarpARGB16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImageAffineTransform, backColor *uint16, flags uint32) int
C function: vImageAffineWarp_ARGB16F
func VImageAffineWarpARGB16S ¶
func VImageAffineWarpARGB16S(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImageAffineTransform, backColor *int16, flags uint32) int
C function: vImageAffineWarp_ARGB16S
func VImageAffineWarpARGB16U ¶
func VImageAffineWarpARGB16U(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImageAffineTransform, backColor *uint16, flags uint32) int
C function: vImageAffineWarp_ARGB16U
func VImageAffineWarpARGB8888 ¶
func VImageAffineWarpARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImageAffineTransform, backColor *uint8, flags uint32) int
C function: vImageAffineWarp_ARGB8888
func VImageAffineWarpARGBFFFF ¶
func VImageAffineWarpARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImageAffineTransform, backColor *float32, flags uint32) int
C function: vImageAffineWarp_ARGBFFFF
func VImageAffineWarpCGARGB16S ¶
func VImageAffineWarpCGARGB16S(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImageAffineTransformDouble, backColor *int16, flags uint32) int
C function: vImageAffineWarpCG_ARGB16S
func VImageAffineWarpCGARGB16U ¶
func VImageAffineWarpCGARGB16U(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImageAffineTransformDouble, backColor *uint16, flags uint32) int
C function: vImageAffineWarpCG_ARGB16U
func VImageAffineWarpCGARGB8888 ¶
func VImageAffineWarpCGARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImageAffineTransformDouble, backColor *uint8, flags uint32) int
C function: vImageAffineWarpCG_ARGB8888
func VImageAffineWarpCGARGBFFFF ¶
func VImageAffineWarpCGARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImageAffineTransformDouble, backColor *float32, flags uint32) int
C function: vImageAffineWarpCG_ARGBFFFF
func VImageAffineWarpCGPlanar8 ¶
func VImageAffineWarpCGPlanar8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImageAffineTransformDouble, backColor uint8, flags uint32) int
C function: vImageAffineWarpCG_Planar8
func VImageAffineWarpCGPlanarF ¶
func VImageAffineWarpCGPlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImageAffineTransformDouble, backColor float32, flags uint32) int
C function: vImageAffineWarpCG_PlanarF
func VImageAffineWarpCbCr16F ¶
func VImageAffineWarpCbCr16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImageAffineTransform, backColor *uint16, flags uint32) int
C function: vImageAffineWarp_CbCr16F
func VImageAffineWarpDARGB16F ¶
func VImageAffineWarpDARGB16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImageAffineTransformDouble, backColor *uint16, flags uint32) int
C function: vImageAffineWarpD_ARGB16F
func VImageAffineWarpDARGB16S ¶
func VImageAffineWarpDARGB16S(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImageAffineTransformDouble, backColor *int16, flags uint32) int
C function: vImageAffineWarpD_ARGB16S
func VImageAffineWarpDARGB16U ¶
func VImageAffineWarpDARGB16U(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImageAffineTransformDouble, backColor *uint16, flags uint32) int
C function: vImageAffineWarpD_ARGB16U
func VImageAffineWarpDARGB8888 ¶
func VImageAffineWarpDARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImageAffineTransformDouble, backColor *uint8, flags uint32) int
C function: vImageAffineWarpD_ARGB8888
func VImageAffineWarpDARGBFFFF ¶
func VImageAffineWarpDARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImageAffineTransformDouble, backColor *float32, flags uint32) int
C function: vImageAffineWarpD_ARGBFFFF
func VImageAffineWarpDCbCr16F ¶
func VImageAffineWarpDCbCr16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImageAffineTransformDouble, backColor *uint16, flags uint32) int
C function: vImageAffineWarpD_CbCr16F
func VImageAffineWarpDPlanar8 ¶
func VImageAffineWarpDPlanar8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImageAffineTransformDouble, backColor uint8, flags uint32) int
C function: vImageAffineWarpD_Planar8
func VImageAffineWarpDPlanar16F ¶
func VImageAffineWarpDPlanar16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImageAffineTransformDouble, backColor uint16, flags uint32) int
C function: vImageAffineWarpD_Planar16F
func VImageAffineWarpDPlanarF ¶
func VImageAffineWarpDPlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImageAffineTransformDouble, backColor float32, flags uint32) int
C function: vImageAffineWarpD_PlanarF
func VImageAffineWarpPlanar8 ¶
func VImageAffineWarpPlanar8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImageAffineTransform, backColor uint8, flags uint32) int
C function: vImageAffineWarp_Planar8
func VImageAffineWarpPlanar16F ¶
func VImageAffineWarpPlanar16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImageAffineTransform, backColor uint16, flags uint32) int
C function: vImageAffineWarp_Planar16F
func VImageAffineWarpPlanarF ¶
func VImageAffineWarpPlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImageAffineTransform, backColor float32, flags uint32) int
C function: vImageAffineWarp_PlanarF
func VImageAlphaBlendARGB8888 ¶
func VImageAlphaBlendARGB8888(srcTop *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageAlphaBlend_ARGB8888 @abstract Composite two non-premultiplied ARGB8888 images, to produce a non-premultiplied result. @discussion For each color channel: <pre>@textblock float destColor = ( srcTopColor * srcTopAlpha + (1.0 - srcTopAlpha) * srcBottomAlpha * srcBottomColor ) / alpha @/textblock </pre> alpha (the new alpha value for that pixel) is calculated as: <pre>@textblock float alpha = srcTopAlpha + (1.0 - srcTopAlpha) * srcBottomAlpha @/textblock </pre> This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags The ARGB versions work for all 4 channel 8-bit / channel image formats with alpha first in memory. @param srcTop The image that is composited on top of the bottom image. The alpha channel must appear first. @param srcBottom The image that is below the srcTop image, into which it is blended. The alpha channel must appear first. @oaram dest The non-premultiplied result will be written here. @param flags The following flags are allowed: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Disables internal multithreading. This may be useful if you are writing your own multithreaded tiling engine. @/textblock</pre> @result The following result codes may be returned: <pre>@textblock kvImageNoError Success! kvImageRoiLargerThanInputBuffer The destination buffer must be no larger than srcTop, srcBottom, srcTopAlpha, srcBottomAlpha and alpha. @/textblock</pre> C function: vImageAlphaBlend_ARGB8888
func VImageAlphaBlendARGBFFFF ¶
func VImageAlphaBlendARGBFFFF(srcTop *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageAlphaBlend_ARGBFFFF @abstract Composite two non-premultiplied ARGBFFFF images, to produce a non-premultiplied result. @discussion For each color channel: <pre>@textblock float destColor = ( srcTopColor * srcTopAlpha + (1.0 - srcTopAlpha) * srcBottomAlpha * srcBottomColor ) / alpha @/textblock </pre> alpha (the new alpha value for that pixel) is calculated as: <pre>@textblock float alpha = srcTopAlpha + (1.0 - srcTopAlpha) * srcBottomAlpha @/textblock </pre> This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags The ARGB versions work for all 4 channel float / channel image formats with alpha first in memory. @param srcTop The image that is composited on top of the bottom image. The alpha channel must appear first. @param srcBottom The image that is below the srcTop image, into which it is blended. The alpha channel must appear first. @oaram dest The non-premultiplied result will be written here. @param flags The following flags are allowed: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Disables internal multithreading. This may be useful if you are writing your own multithreaded tiling engine. @/textblock</pre> @result The following result codes may be returned: <pre>@textblock kvImageNoError Success! kvImageRoiLargerThanInputBuffer The destination buffer must be no larger than srcTop, srcBottom, srcTopAlpha, srcBottomAlpha and alpha. @/textblock</pre> C function: vImageAlphaBlend_ARGBFFFF
func VImageAlphaBlendNonpremultipliedToPremultipliedARGB8888 ¶
func VImageAlphaBlendNonpremultipliedToPremultipliedARGB8888(srcTop *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageAlphaBlend_NonpremultipliedToPremultiplied_ARGB8888 @abstract Blend a non-premultiplied top ARGB8888 image into a premultiplied ARGB8888 bottom image and return a premultiplied ARGB8888 result. @discussion Top buffer is non-premultiplied. Bottom buffer is premultiplied. Dest buffer is premultiplied. Works in place. <pre>@textblock result = (srcTop * srctopAlpha + (255 - srcTopAlpha) * bottomAlpha + 127 ) / 255; @/textblock </pre> This function will work in place as long as the src and dest buffer overlap exactly. The src buffers must be at least as large as the dest buffer in each dimension. (src.height >= dest.height && src.width >= dest.width) This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags This function will work with any channel order with alpha first, not just ARGB. @param srcTop Planar8 non-premultiplied color channel for top image @param srcBottom Planar8 premultiplied color channel for bottom image @param dest Planar8 premultiplied result. Must be preallocated before the call is made. @param flags The following flags are allowed: <pre> @textblock kvImageNoFlags Default operation. kvImageDoNotTile Disable internal multithreading. @/textblock </pre> @result The following error codes may occur: <pre> @textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer dest->height and dest->width must be less than or equal to corresponding dimensions in srcTop, srcTopAlpha and srcBottom. @/textblock </pre> C function: vImageAlphaBlend_NonpremultipliedToPremultiplied_ARGB8888
func VImageAlphaBlendNonpremultipliedToPremultipliedARGBFFFF ¶
func VImageAlphaBlendNonpremultipliedToPremultipliedARGBFFFF(srcTop *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageAlphaBlend_NonpremultipliedToPremultiplied_ARGBFFFF @abstract Blend a non-premultiplied top ARGBFFFF image into a premultiplied ARGBFFFF bottom image and return a premultiplied ARGBFFFF result. @discussion Top buffer is non-premultiplied. Bottom buffer is premultiplied. Dest buffer is premultiplied. Works in place. <pre>@textblock result = srcTop * srcTopAlpha + (1 - srcTopAlpha) * srcBottom @/textblock </pre> This function will work in place as long as the src and dest buffer overlap exactly. The src buffers must be at least as large as the dest buffer in each dimension. (src.height >= dest.height && src.width >= dest.width) This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags This function will work with any channel order with alpha first, not just ARGB. @param srcTop Planar8 non-premultiplied color channel for top image @param srcBottom Planar8 premultiplied color channel for bottom image @param dest Planar8 premultiplied result. Must be preallocated before the call is made. @param flags The following flags are allowed: <pre> @textblock kvImageNoFlags Default operation. kvImageDoNotTile Disable internal multithreading. @/textblock </pre> @result The following error codes may occur: <pre> @textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer dest->height and dest->width must be less than or equal to corresponding dimensions in srcTop, srcTopAlpha and srcBottom. @/textblock </pre> C function: vImageAlphaBlend_NonpremultipliedToPremultiplied_ARGBFFFF
func VImageAlphaBlendNonpremultipliedToPremultipliedPlanar8 ¶
func VImageAlphaBlendNonpremultipliedToPremultipliedPlanar8(srcTop *VImageBuffer, srcTopAlpha *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageAlphaBlend_NonpremultipliedToPremultiplied_Planar8 @abstract Blend a non-premultiplied top Planar8 image into a premultiplied Planar8 bottom image and return a premultiplied Planar8 result. @discussion Top buffer is non-premultiplied. Bottom buffer is premultiplied. Dest buffer is premultiplied. Works in place. <pre>@textblock result = (srcTop * srctopAlpha + (255 - srcTopAlpha) * bottomAlpha + 127 ) / 255; @/textblock </pre> This function will work in place as long as the src and dest buffer overlap exactly. The src buffers must be at least as large as the dest buffer in each dimension. (src.height >= dest.height && src.width >= dest.width) To calculate the alpha result for the Planar cases, use <pre>@textblock vImagePremultipliedAlphaBlend_Planar8( srcTopAlpha, srcTopAlpha, srcBottomAlpha, dest, flags ); @/textblock </pre> This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags @param srcTop Planar8 non-premultiplied color channel for top image @param srcTopAlpha Planar8 alpha channel for top image @param srcBottom Planar8 premultiplied color channel for bottom image @param dest Planar8 premultiplied result. Must be preallocated before the call is made. @param flags The following flags are allowed: <pre> @textblock kvImageNoFlags Default operation. kvImageDoNotTile Disable internal multithreading. @/textblock </pre> @result The following error codes may occur: <pre> @textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer dest->height and dest->width must be less than or equal to corresponding dimensions in srcTop, srcTopAlpha and srcBottom. @/textblock </pre> C function: vImageAlphaBlend_NonpremultipliedToPremultiplied_Planar8
func VImageAlphaBlendNonpremultipliedToPremultipliedPlanarF ¶
func VImageAlphaBlendNonpremultipliedToPremultipliedPlanarF(srcTop *VImageBuffer, srcTopAlpha *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageAlphaBlend_NonpremultipliedToPremultiplied_PlanarF @abstract Blend a non-premultiplied top PlanarF image into a premultiplied PlanarF bottom image and return a premultiplied PlanarF result. @discussion Top buffer is non-premultiplied. Bottom buffer is premultiplied. Dest buffer is premultiplied. Works in place. <pre>@textblock result = srcTop * srcTopAlpha + (1 - srcTopAlpha) * srcBottom @/textblock </pre> This function will work in place as long as the src and dest buffer overlap exactly. The src buffers must be at least as large as the dest buffer in each dimension. (src.height >= dest.height && src.width >= dest.width) To calculate the alpha result for the Planar cases, use <pre>@textblock vImagePremultipliedAlphaBlend_PlanarF( srcTopAlpha, srcTopAlpha, srcBottomAlpha, dest, flags ); @/textblock </pre> This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags @param srcTop Planar8 non-premultiplied color channel for top image @param srcTopAlpha Planar8 alpha channel for top image @param srcBottom Planar8 premultiplied color channel for bottom image @param dest Planar8 premultiplied result. Must be preallocated before the call is made. @param flags The following flags are allowed: <pre> @textblock kvImageNoFlags Default operation. kvImageDoNotTile Disable internal multithreading. @/textblock </pre> @result The following error codes may occur: <pre> @textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer dest->height and dest->width must be less than or equal to corresponding dimensions in srcTop, srcTopAlpha and srcBottom. @/textblock </pre> C function: vImageAlphaBlend_NonpremultipliedToPremultiplied_PlanarF
func VImageAlphaBlendPlanar8 ¶
func VImageAlphaBlendPlanar8(srcTop *VImageBuffer, srcTopAlpha *VImageBuffer, srcBottom *VImageBuffer, srcBottomAlpha *VImageBuffer, alpha *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageAlphaBlend_Planar8 @abstract Composite two non-premultiplied planar 8-bit images, to produce a non-premultiplied result. @discussion For each color channel: <pre>@textblock float destColor = ( srcTopColor * srcTopAlpha + (1.0 - srcTopAlpha) * srcBottomAlpha * srcBottomColor ) / alpha @/textblock </pre> alpha (the new alpha value for that pixel) is calculated as: <pre>@textblock float alpha = srcTopAlpha + (1.0 - srcTopAlpha) * srcBottomAlpha @/textblock </pre> For planar data, you need to calculate alpha yourself ahead of time and provide that as an argument to this function. This can be done using: <pre>@textblock vImagePremultipliedAlphaBlend_Planar8( srcTopAlpha, srcTopAlpha, srcBottomAlpha, alpha, kvImageNoFlags ); @/textblock </pre> This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags The ARGB versions work for all 4 channel 8-bit / channel image formats with alpha first in memory. @param srcTop The color image that is composited on top of the bottom image @param srcTopAlpha The alpha channel corresponding to the srcTop image @param srcBottom The color image that is below the srcTop image, into which it is blended @param srcBottomAlpha The alpha channel corresponding to the srcBottom image @param alpha The alpha channel for the destination image. You need to calculate this ahead of time as: <pre>@textblock vImagePremultipliedAlphaBlend_Planar8( srcTopAlpha, srcTopAlpha, srcBottomAlpha, alpha, kvImageNoFlags ); @/textblock </pre> @oaram dest The non-premultiplied result will be written here. @param flags The following flags are allowed: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Disables internal multithreading. This may be useful if you are writing your own multithreaded tiling engine. @/textblock</pre> @result The following result codes may be returned: <pre>@textblock kvImageNoError Success! kvImageRoiLargerThanInputBuffer The destination buffer must be no larger than srcTop, srcBottom, srcTopAlpha, srcBottomAlpha and alpha. @/textblock</pre> C function: vImageAlphaBlend_Planar8
func VImageAlphaBlendPlanarF ¶
func VImageAlphaBlendPlanarF(srcTop *VImageBuffer, srcTopAlpha *VImageBuffer, srcBottom *VImageBuffer, srcBottomAlpha *VImageBuffer, alpha *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageAlphaBlend_PlanarF
func VImageBoxConvolveARGB8888 ¶
func VImageBoxConvolveARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernelHeight uint32, kernelWidth uint32, backgroundColor *uint8, flags uint32) int
@function vImageBoxConvolve_ARGB8888 @abstract Special purpose box convolution on a 4-channel interleaved, 8-bit per channel image. @discussion This filter applies a box filter to a 4-channel interleaved, 8-bit per channel imagee. A box filter uses a much faster algorithm than a standard convolution, and may be a good solution for real time application of large blur radii against images. For each pixel: <pre>@textblock vImagePixelCount kernel_area = kernel_height * kernel_width; for each pixel[y][x] in image{ int sumA = 0; int sumR = 0; int sumG = 0; int sumB = 0; // Calculate unweighted average over kernel area for each kernel_element[i][j] in kernel{ sumA += pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2][0]; sumR += pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2][1]; sumG += pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2][2]; sumB += pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2][3]; } // Correct for the scaling introduced by multiplying by the weights table sumA = (sumA + kernel_area/2) / kernel_area; sumR = (sumR + kernel_area/2) / kernel_area; sumG = (sumG + kernel_area/2) / kernel_area; sumB = (sumB + kernel_area/2) / kernel_area; // write out result result[y][x][0] = CLAMP(sumA, 0, 255); result[y][x][1] = CLAMP(sumR, 0, 255); result[y][x][2] = CLAMP(sumG, 0, 255); result[y][x][3] = CLAMP(sumB, 0, 255); } @/textblock </pre> This filter does not work in place. This filter will work without modification for other byte orders such as RGBA, BGRA, AGBR, CMYK, etc. The image should be non-premultiplied to avoid odd results in non-opaque regions. @param src The input image @param dest A pointer to a preallocated vImage_Buffer to receive the result image. This may not alias the src image. @param tempBuffer An optional pointer to a region of memory to use as a working area during computation. The size of the tempBuffer is given by calling the function with the same parameters and the kvImageGetTempBufferSize flag, in which case the size is returned instead of an error code from the left hand side. You may pass NULL here, in which case a region of memory of similar size will be allocated by the function and freed before it returns. Temp Buffers are a way of avoiding lost time due to VM faults to initialize newly allocated buffers. If you will be calling this function repeatedly with similar parameters you should use a temp buffer. If the function is called from different threads concurrently, a different temp buffer should be used for each. @param srcOffsetToROI_X An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the left edge of the image. @param srcOffsetToROI_Y An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the top edge of the image. @param kernel_height The height of the 2D table of weights passed in as kernel. It must be an odd number. @param kernel_width The width of the 2D table of weights passed in as kernel. It must be an odd number. @param backgroundColor When the kvImageBackgroundColorFill edging mode is active, the backgroundColor parameter provides the background color to be used for missing pixels when the kernel extends off the edge of the image. @param flags The following flags are allowed: <pre>@textblock kvImageCopyInPlace If any pixels covered by the kernel do no not exist, simply copy the corresponding source pixel to the destination. This will result in a ring off unconvolved content at the edges and convolved content in the middle. kvImageBackgroundColorFill Substitute in the provided background color for missing pixels. For a blur filter this will look like the edges of the image have been blurred into a particular color. This is usually appropriate when the color of the surface onto which the image will be drawn is known. You can also use {Alpha = 0, color = 0} as a background color, and let the downstream image compositor blend in the background color. In this case, the result image should be treated as a premultiplied image. kvImageEdgeExtend Substitute in the nearest defined pixel for missing pixels. This is better when the image is drawn into a frame or other context where the background is not expected to contribute to the final content. kvImageTruncateKernel This is similar to kvImageEdgeExtend, except that edge pixels are simply ignored, and the bias and divisor are adjusted accordingly. Because of the complication at the edges, this edging mode can be significantly slower than the others. It can be numerically unstable if the sum over any rectangular subsection of the kernel is zero, which can result in division by zero during the computation. The results for this edging mode are usually quite visually similar to kvImageEdgeExtend. kvImageGetTempBufferSize Instead of calculating the convolution of the image, return the size of the temp buffer needed for this set of parameters. Does not touch the src or dest image. kvImageLeaveAlphaUnchanged Apply the convolution to the last three channels in memory, only. kvImageDoNotTile Disable internal multithreading. @/textblock </pre> The first four flags listed are edging modes. One and only one edging mode must be provided. If no edging mode is provided (e.g. kvImageNoFlags), then an error will be returned. @return One of the following error codes may be returned: <pre>@textblock kvImageNoError Success. >= 0 If kvImageGetTempBufferSize is passed, this is the size of the temp buffer to use with this function and this set of parameters. kvImageInvalidEdgeStyle One and only one of the following flags must be provided: { kvImageCopyInPlace, kvImageBackgroundColorFill, kvImageEdgeExtend, kvImageTruncateKernel } kvImageRoiLargerThanInputBuffer The dest->width and height must be less than or equal to corresponding dimensions of the source buffer. kvImageInvalidOffset_X The destination width + srcOffsetToROI_X > src->width kvImageInvalidOffset_Y The destination height + srcOffsetToROI_Y > src->height kvImageMemoryAllocationError Could not allocate memory to serve as a temp buffer. kvImageInvalidKernelSize The kernel height and width must be odd numbers. @/textblock </pre> C function: vImageBoxConvolve_ARGB8888
func VImageBoxConvolvePlanar8 ¶
func VImageBoxConvolvePlanar8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernelHeight uint32, kernelWidth uint32, backgroundColor uint8, flags uint32) int
@function vImageBoxConvolve_Planar8 @abstract Special purpose box convolution on a Planar8 image. @discussion This filter applies a box filter to a Planar8 image. A box filter uses a much faster algorithm than a standard convolution, and may be a good solution for real time application of large blur radii against images. For each pixel: <pre>@textblock vImagePixelCount kernel_area = kernel_height * kernel_width; for each pixel[y][x] in image{ int sum = 0; // Calculate unweighted average over kernel area for each kernel_element[i][j] in kernel{ sum += pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2]; } // Correct for the scaling introduced by multiplying by the weights table sum = (sum + kernel_area/2) / kernel_area; // write out result result[y][x] = CLAMP(sum, 0, 255); } @/textblock </pre> This filter does not work in place. @param src The input image @param dest A pointer to a preallocated vImage_Buffer to receive the result image. This may not alias the src image. @param tempBuffer An optional pointer to a region of memory to use as a working area during computation. The size of the tempBuffer is given by calling the function with the same parameters and the kvImageGetTempBufferSize flag, in which case the size is returned instead of an error code from the left hand side. You may pass NULL here, in which case a region of memory of similar size will be allocated by the function and freed before it returns. Temp Buffers are a way of avoiding lost time due to VM faults to initialize newly allocated buffers. If you will be calling this function repeatedly with similar parameters you should use a temp buffer. If the function is called from different threads concurrently, a different temp buffer should be used for each. @param srcOffsetToROI_X An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the left edge of the image. @param srcOffsetToROI_Y An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the top edge of the image. @param kernel_height The height of the 2D table of weights passed in as kernel. It must be an odd number. @param kernel_width The width of the 2D table of weights passed in as kernel. It must be an odd number. @param backgroundColor When the kvImageBackgroundColorFill edging mode is active, the backgroundColor parameter provides the background color to be used for missing pixels when the kernel extends off the edge of the image. @param flags The following flags are allowed: <pre>@textblock kvImageCopyInPlace If any pixels covered by the kernel do no not exist, simply copy the corresponding source pixel to the destination. This will result in a ring off unconvolved content at the edges and convolved content in the middle. kvImageBackgroundColorFill Substitute in the provided background color for missing pixels. For a blur filter this will look like the edges of the image have been blurred into a particular color. This is usually appropriate when the color of the surface onto which the image will be drawn is known. You can also use {Alpha = 0, color = 0} as a background color, and let the downstream image compositor blend in the background color. In this case, the result image should be treated as a premultiplied image. kvImageEdgeExtend Substitute in the nearest defined pixel for missing pixels. This is better when the image is drawn into a frame or other context where the background is not expected to contribute to the final content. kvImageTruncateKernel This is similar to kvImageEdgeExtend, except that edge pixels are simply ignored, and the bias and divisor are adjusted accordingly. Because of the complication at the edges, this edging mode can be significantly slower than the others. It can be numerically unstable if the sum over any rectangular subsection of the kernel is zero, which can result in division by zero during the computation. The results for this edging mode are usually quite visually similar to kvImageEdgeExtend. kvImageGetTempBufferSize Instead of calculating the convolution of the image, return the size of the temp buffer needed for this set of parameters. Does not touch the src or dest image. kvImageDoNotTile Disable internal multithreading. @/textblock </pre> The first four flags listed are edging modes. One and only one edging mode must be provided. If no edging mode is provided (e.g. kvImageNoFlags), then an error will be returned. @return One of the following error codes may be returned: <pre>@textblock kvImageNoError Success. >= 0 If kvImageGetTempBufferSize is passed, this is the size of the temp buffer to use with this function and this set of parameters. kvImageInvalidEdgeStyle One and only one of the following flags must be provided: { kvImageCopyInPlace, kvImageBackgroundColorFill, kvImageEdgeExtend, kvImageTruncateKernel } kvImageRoiLargerThanInputBuffer The dest->width and height must be less than or equal to corresponding dimensions of the source buffer. kvImageInvalidOffset_X The destination width + srcOffsetToROI_X > src->width kvImageInvalidOffset_Y The destination height + srcOffsetToROI_Y > src->height kvImageMemoryAllocationError Could not allocate memory to serve as a temp buffer. kvImageInvalidKernelSize The kernel height and width must be odd numbers. @/textblock </pre> C function: vImageBoxConvolve_Planar8
func VImageBufferCopyToCVPixelBuffer ¶
func VImageBufferCopyToCVPixelBuffer(buffer *VImageBuffer, bufferFormat *VImageCGImageFormat, cvPixelBuffer unsafe.Pointer, cvImageFormat unsafe.Pointer, backgroundColor *float64, flags uint32) int
@function vImageBuffer_CopyToCVPixelBuffer @abstract Copies the contents of the vImage_Buffer to a CVPixelBufferRef. @discussion If the format of the vImage_Buffer doesn't match the CVPixelBuffer format, the image will be converted to the CVPixelBuffer format as part of the copy. The entire CVPixelBuffer is overwritten. If you want to copy less, you can do so using vImageConvert_AnyToAny and a converter prepared with vImageConverter_CreateForCFToCVImageFormat. vImage here conforms to CoreVideo practice of substituting gamma 1/1.961 for kCVImageBufferTransferFunction_ITU_R_709_2 and kCVImageBufferTransferFunction_SMPTE_240M_1995 instead of using the ITU-R BT.709-5 specified transfer function. You may manually set the transfer function using vImageCreateRGBColorSpaceWithPrimariesAndTransferFunction() and vImageCVImageFormat_SetColorSpace(). ImageCreateRGBColorSpaceWithPrimariesAndTransferFunction() does not make this substitution. @param buffer A pointer to a vImage_Buffer containing the pixels to be copied (converted) to the CVPixelBuffer. May not be NULL. @param bufferFormat The format of buffer. May not be NULL. @param cvPixelBuffer The CVPixelBufferRef where the image will be written. It should be a valid, preallocated CVPixelBufferRef set to the desired image type (which need not match bufferFormat). It is not necessary to lock the CVPixelBuffer before calling this function. May not be NULL. @param cvImageFormat An optional vImageCVImageFormatRef to specify the pixel format of the CVPixelBuffer. If NULL, vImage attempts to discover this information automatically. However, sometimes necessary color information in the CVPixelBuffer is missing, preventing conversion. An error will be returned. See kvImageCVImageFormat return codes for this function for more information. To supply vImage with complete color information, provide a complete vImageCVImageFormatRef here. If not NULL, the cvImageFormat is used instead of looking to the CVPixelBufferRef for color information. If the cvImageFormat is also incomplete, a kvImageCVImageFormat_ error code will be returned. CAUTION: In this case, it is your responsibility to make sure that the CVPixelBuffer has the right attachments for matrix, chroma siting and colorspace as necessary to be properly decoded. vImage does not set these things for you. @param backgroundColor If bufferFormat->bitmapInfo encodes kCGImageAlphaPremultipliedLast, kCGImageAlphaPremultipliedFirst, kCGImageAlphaLast or kCGImageAlphaFirst -- that is, has a real alpha channel -- and the CVPixelBuffer does not (most CV pixel formats don't) then the image will be flattened against a solid color to remove the alpha information. You can select which color that is here. The background color is a CGFloat[3] (red, green, blue) in the RGB colorspace of the CVPixelBuffer. (YpCbCr images reference a RGB colorspace through a matrix like ITU-709. That is the RGB colorspace we are talking about here.) This parameter may be NULL, indicating black. If you want to skip flattening, you can substitute in kCGImageAlphaNoneSkipFirst/Last for the encoding of the input buffer. This may lead to undesired results in the case of premultiplied alpha however, when alpha is not all either 1.0 or 0. In that case, unpremultiply it first as a separate pass. Unpremultiplication may be more costly than just flattening it, but does not introduce regions of background color into the image. @param flags The following flags are understood by this function: <pre> @textblock kvImageNoFlags Default operation. kvImageDoNotTile Turn internal multithreading off. This may be helpful in cases where you already have many such operations going concurrently, and in cases where it is desirable to keep CPU utilization to a single core. kvImageHighQualityResampling For some CVPixelBuffer formats, the chroma channels are subsampled. This flag directs vImage to spend extra time where it can to give better image quality. kvImagePrintDiagnosticsToConsole In case of an error, print human readable error messages to the Apple System Logger (Console). This is useful for debugging, but probably should not be on for a shipping application. @/textblock </pre> @return <pre> @textblock kvImageNoError Success kvImageInvalidImageFormat bufferFormat is NULL or encodes an invalid format kvImageBufferSizeMismatch buffer and cvPixelBuffer are not the same height and width kvImageNullPointerArgument buffer and cvPixelBuffer may not be NULL kvImageCVImageFormat_ConversionMatrix The conversion matrix is missing from the CVPixelBuffer / vImageCVImageFormatRef. See note below. kvImageCVImageFormat_ChromaSiting The chroma siting info is missing from the CVPixelBuffer / vImageCVImageFormatRef. See note below. kvImageCVImageFormat_ColorSpace The colorspace containing primaries and transfer function is missing from the CVPixelBuffer / vImageCVImageFormatRef. @/textblock </pre> Note: Some CVPixelBuffers have incompletely specified color information. This makes it impossible for vImage to do the conversion. When this happens, you will get one of the kvImageCVImageFormat_ errors above. To proceed, create a vImageCVImageFormatRef, add the missing information and pass as the cvImageFormat parameter. It is possible that more than one piece of information is missing. C function: vImageBuffer_CopyToCVPixelBuffer
func VImageBufferFillARGB16F ¶
func VImageBufferFillARGB16F(dest *VImageBuffer, color *uint16, flags uint32) int
@function vImageBufferFill_ARGB16F @abstract Fill the dest buffer with the pixel value. @param color A pixel value to fill the destination buffer. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageBufferFill_ARGB16F
func VImageBufferFillARGB16S ¶
func VImageBufferFillARGB16S(dest *VImageBuffer, color *int16, flags uint32) int
@function vImageBufferFill_ARGB16S @abstract Fill the dest buffer with the pixel value. @param color A pixel value to fill the destination buffer. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageBufferFill_ARGB16S
func VImageBufferFillARGB16U ¶
func VImageBufferFillARGB16U(dest *VImageBuffer, color *uint16, flags uint32) int
@function vImageBufferFill_ARGB16U @abstract Fill the dest buffer with the pixel value. @param color A pixel value to fill the destination buffer. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageBufferFill_ARGB16U
func VImageBufferFillARGB8888 ¶
func VImageBufferFillARGB8888(dest *VImageBuffer, color *uint8, flags uint32) int
@function vImageBufferFill_ARGB8888 @abstract Fill the dest buffer with the pixel value. @param color A pixel value to fill the destination buffer. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageBufferFill_ARGB8888
func VImageBufferFillARGBFFFF ¶
func VImageBufferFillARGBFFFF(dest *VImageBuffer, color *float32, flags uint32) int
@function vImageBufferFill_ARGBFFFF @abstract Fill the dest buffer with the pixel value. @param color A pixel value to fill the destination buffer. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageBufferFill_ARGBFFFF
func VImageBufferFillCbCr8 ¶
func VImageBufferFillCbCr8(dest *VImageBuffer, color *uint8, flags uint32) int
C function: vImageBufferFill_CbCr8
func VImageBufferFillCbCr16S ¶
func VImageBufferFillCbCr16S(dest *VImageBuffer, color *int16, flags uint32) int
C function: vImageBufferFill_CbCr16S
func VImageBufferFillCbCr16U ¶
func VImageBufferFillCbCr16U(dest *VImageBuffer, color *uint16, flags uint32) int
C function: vImageBufferFill_CbCr16U
func VImageBufferGetSize ¶
func VImageBufferGetSize(buf *VImageBuffer) corefoundation.CGSize
@function vImageBuffer_GetSize @abstract Returns size of a vImage_Buffer as a CGSize. @discussion The CGSize / NSSize is rounded down to the nearest representable CGFloat that is less than or equal to the actual size of the image. In practice the conversion will always be exact, except for really, really big images. In that case, some part of the bottom or right edge might be truncated. <pre>@textblock Rationale: If you attempt your own home-made conversion to CGSize / NSSize by ordinary C rules and the value rounds, it will round up half the time. This could lead to a crash later because the height or width will be reported to be larger than it really is and an ensuing image operation will attempt to touch scanlines that don't exist. @/textblock</pre> @param buf A pointer to a valid vImage_Buffer @return The largest CGSize that will fit in the buffer. In typical usage, this is equal to the size of the buffer. C function: vImageBuffer_GetSize
func VImageBufferInit ¶
func VImageBufferInit(buf *VImageBuffer, height uint, width uint, pixelBits uint32, flags uint32) int
C function: vImageBuffer_Init
func VImageBufferInitForCopyFromCVPixelBuffer ¶
func VImageBufferInitForCopyFromCVPixelBuffer(buffers *VImageBuffer, converter unsafe.Pointer, pixelBuffer unsafe.Pointer, flags uint32) int
@function vImageBuffer_InitForCopyFromCVPixelBuffer @abstract Initialize an array of vImage_Buffers in the right order to convert CV formatted image to another image format @discussion When converting from CVPixelBuffer types with vImageConvert_AnyToAny, the CV format sometimes contains multiple data planes which are in turn represented by multiple vImage_Buffers. (These are passed in as an array of vImage_Buffers to vImageConvert_AnyToAny().) To make it easier to order the buffers correctly, we provide vImageBuffer_InitForCopyFromCVPixelBuffer, which initializes an array vImage_Buffer structs in the order expected by vImageConvert_AnyToAny. With appropriate flags, the conversion can be made to occur directly from the CVPixelBufferRef backing store. @param buffers A pointer to an array of vImage_Buffer structs to be read. The buffers will be initialized in the correct order for use with vImageConvert_AnyToAny and the provided converter. On entry, buffers must point to a valid region of memory of size no smaller than number_of_buffers * sizeof(vImage_Buffer). The number_of_buffers is given by vImageConverter_GetNumberOfSourceBuffers. The buffers pointer may not be NULL. @param converter The converter that will be used to do the conversion. May not be NULL. @param pixelBuffer A locked (use CVPixelBufferLockBaseAddress) CVPixelBufferRef. @param flags kvImageNoAllocate must be used. The following flags are allowed: <pre> @textblock kvImageNoFlags Default operation. kvImagePrintDiagnosticsToConsole Print diagnostic messages to the console in the event an error occurs kvImageNoAllocate Instructs the function to initialized the buffers to directly read from a locked CVPixelBufferRef. You may unlock the CVPixelBufferRef after vImageConvert_AnyToAny has returned. Once the pixelBuffer is unlocked, the vImage_Buffers initialized by this function are no longer valid and must be reinitialized. @/textblock </pre> @return The following error codes may be returned: <pre> @textblock kvImageNoError Success kvImageNullPointerArgument buffers is NULL. kvImageNullPointerArgument converter is NULL. kvImageInvalidParameter pixelBuffer is not NULL but kvImageNoAllocate was not passed in flags. See pixelBuffer description above. kvImageUnknownFlagsBit An unknown / unhandled flags bit was set in flags. kvImageInternalError Something is very wrong inside vImage. This shouldn't happen. Please file a bug, along with a reproducible failure case. @/textblock </pre> @seealso vImageConverter_GetSourceBufferOrder vImageConverter_GetSourceBufferOrder for another method to initialize the vImage_Buffers in the right order for vImageConvert_AnyToAny. C function: vImageBuffer_InitForCopyFromCVPixelBuffer
func VImageBufferInitForCopyToCVPixelBuffer ¶
func VImageBufferInitForCopyToCVPixelBuffer(buffers *VImageBuffer, converter unsafe.Pointer, pixelBuffer unsafe.Pointer, flags uint32) int
@function vImageBuffer_InitForCopyToCVPixelBuffer @abstract Initialize an array of vImage_Buffers in the right order to convert a image to a CV formatted image @discussion When converting to CVPixelBuffer types with vImageConvert_AnyToAny, the CV format sometimes contains multiple data planes which are in turn represented by multiple vImage_Buffers. (These are passed in as an array of vImage_Buffers to vImageConvert_AnyToAny().) To make it easier to order the buffers correctly, we provide vImageBuffer_InitForCopyToCVPixelBuffer, which initializes an array vImage_Buffer structs in the order expected by vImageConvert_AnyToAny. With appropriate flags, the conversion can be made to occur directly into the CVPixelBufferRef backing store. You are responsible for updating any missing / incorrect color information in the pixelBuffer after writing to it. @param buffers A pointer to an array of vImage_Buffer structs to be overwritten. The buffers will be initialized in the correct order for use with vImageConvert_AnyToAny and the provided converter. On entry, buffers must point to a valid region of memory of size no smaller than number_of_buffers * sizeof(vImage_Buffer). The number_of_buffers is given by vImageConverter_GetNumberOfDestinationBuffers. The buffers pointer may not be NULL. @param converter The converter that will be used to do the conversion. May not be NULL. @param pixelBuffer A locked (use CVPixelBufferLockBaseAddress) CVPixelBufferRef. @param flags kvImageNoAllocate must be used. The following flags are allowed: <pre> @textblock kvImageNoFlags Default operation. kvImagePrintDiagnosticsToConsole Print diagnostic messages to the console in the event an error occurs kvImageNoAllocate Instructs the function to initialized the buffers to directly write to a locked CVPixelBufferRef. You may unlock the CVPixelBufferRef after vImageConvert_AnyToAny has returned. Once the pixelBuffer is unlocked, the vImage_Buffers initialized by this function are no longer valid and must be reinitialized. @/textblock </pre> @return The following error codes may be returned: <pre> @textblock kvImageNoError Success kvImageNullPointerArgument buffers is NULL. kvImageNullPointerArgument converter is NULL. kvImageInvalidParameter pixelBuffer is not NULL but kvImageNoAllocate was not passed in flags. See pixelBuffer description above. kvImageUnknownFlagsBit An unknown / unhandled flags bit was set in flags. kvImageInternalError Something is very wrong inside vImage. This shouldn't happen. Please file a bug, along with a reproducible failure case. @/textblock </pre> @seealso vImageConverter_GetDestinationBufferOrder for another method to initialize the vImage_Buffers in the right order for vImageConvert_AnyToAny. C function: vImageBuffer_InitForCopyToCVPixelBuffer
func VImageBufferInitWithCGImage ¶
func VImageBufferInitWithCGImage(buf *VImageBuffer, format *VImageCGImageFormat, backgroundColor *float64, image unsafe.Pointer, flags uint32) int
C function: vImageBuffer_InitWithCGImage
func VImageBufferInitWithCVPixelBuffer ¶
func VImageBufferInitWithCVPixelBuffer(buffer *VImageBuffer, desiredFormat *VImageCGImageFormat, cvPixelBuffer unsafe.Pointer, cvImageFormat unsafe.Pointer, backgroundColor *float64, flags uint32) int
@function vImageBuffer_InitWithCVPixelBuffer @abstract Initializes a vImage_Buffer to contain a representation of the CVPixelBufferRef provided. @discussion It does the following: <pre> @textblock o Set buffer->height and buffer->width to match the size of the provided image. o set buffer->rowBytes for good performance (see kvImageDoNotAllocate flag below) o allocate a region of memory and assign a pointer to it to buffer->data (see kvImageDoNotAllocate flag below) o convert the pixels contained in the image to the desired format and write to buffer->data. @/textblock </pre> The entire image is converted. If you want to convert less, you can do so using vImageConvert_AnyToAny and a converter prepared with vImageConverter_CreateForCVToCGImageFormat. @param buffer A pointer to a vImage_Buffer structure to be initialized. The height and width fields will be overwritten with the size of the CVPixelBuffer. Please see the kvImageDoNotAllocate flag description below for options about how the buffer->data and buffer->rowBytes field is handled. @param desiredFormat image format for the vImage_Buffer. @param cvPixelBuffer A CVPixelBufferRef for the image. It is not necessary to lock the CVPixelBuffer before calling this function. @param cvImageFormat An optional vImageCVImageFormatRef to specify the pixel format of the CVPixelBuffer. If NULL, vImage attempts to discover this information automatically from the CVPixelBuffer. However, sometimes necessary color information in the CVPixelBuffer is missing, preventing conversion. An error will be returned. See kvImageCVImageFormat return codes for this function for more information. To supply vImage with complete color information, provide a complete vImageCVImageFormatRef here. If not NULL, the cvImageFormat is used instead of looking to the CVPixelBufferRef for color information. If the cvImageFormat is also incomplete, a kvImageCVImageFormat_ error code will be returned. @param backgroundColor In cases where the vImage_Buffer format specifies opaque alpha and the cvPixelBuffer is has non-opaque alpha, the image will be composited against a background color to remove the alpha before writing to the vImage_Buffer. The background color is given in the colorspace of the desiredFormat. @param flags The following flags are understood by this function: <pre> @textblock kvImageDoNotAllocate Under normal operation, new memory is allocated to hold the image pixels and its address is written to buffer->data. You are responsible for freeing that data when you are done with it, using free(). When the kvImageDoNotAllocate flag is set, the buffer->data pointer and buffer->rowBytes is used unmodified. This is intended to allow you to allocate the buffer yourself, or write directly into part of another image. Use CVPixelBufferGetHeight() and CVPixelBufferGetWidth() to find the size of the result buffer. kvImageDoNotTile Disable internal multithreading. This may be desired if you are extracting many such images in parallel, or are otherwise attempting to keep CPU utilization to a single core. kvImageHighQualityResampling For some CVPixelBuffer formats, the chroma channels are subsampled. This flag directs vImage to spend extra time where it can to give better image quality. kvImagePrintDiagnosticsToConsole In case of an error, print human readable error messages to the Apple System Logger (Console). This is useful for debugging, but probably should not be on for a shipping application. @/textblock </pre> @return <pre> @textblock kvImageMemoryAllocationError buffer->data was not able to be allocated. kvImageBufferSizeMismatch buffer and cvPixelBuffer are not the same height and width kvImageCVImageFormat_ConversionMatrix The conversion matrix is missing from the CVPixelBuffer / vImageCVImageFormatRef. See note below. kvImageCVImageFormat_ChromaSiting The chroma siting info is missing from the CVPixelBuffer / vImageCVImageFormatRef. See note below. kvImageCVImageFormat_ColorSpace The colorspace containing primaries and transfer function is missing from the CVPixelBuffer / vImageCVImageFormatRef. kvImageInvalidParameter buffer is NULL kvImageInvalidImageObject cvPixelBuffer is NULL or can not be locked kvImageInvalidImageFormat desiredFormat is NULL or points to an illegal CG image format Note: Some CVPixelBuffers have incompletely specified color information. This makes it impossible for vImage to do the conversion. When this happens, you will get one of the kvImageCVImageFormat_ errors above. To proceed, create a vImageCVImageFormatRef, add the missing information and pass as the cvImageFormat parameter. It is possible that more than one piece of information is missing. If the vImageCVImageFormatRef is missing information, then you will also get these errors. @/textblock </pre> Returned image notes: vImage here conforms to CoreVideo practice of substituting gamma 1/1.961 for kCVImageBufferTransferFunction_ITU_R_709_2 and kCVImageBufferTransferFunction_SMPTE_240M_1995 instead of using the ITU-R BT.709-5 specified transfer function. You may manually set the transfer function using vImageCreateRGBColorSpaceWithPrimariesAndTransferFunction() and vImageCVImageFormat_SetColorSpace(). vImageCreateRGBColorSpaceWithPrimariesAndTransferFunction() does not make this substitution. C function: vImageBuffer_InitWithCVPixelBuffer
func VImageByteSwapPlanar16U ¶
func VImageByteSwapPlanar16U(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageByteSwap_Planar16U
func VImageCGImageFormatGetComponentCount ¶
func VImageCGImageFormatGetComponentCount(format *VImageCGImageFormat) uint32
@function vImageCGImageFormat_GetComponentCount @abstract Calculate the number of channels (color + alpha) for a given image format @discussion The number of channels may not be safely calculated as bitsPerPixel / bitsPerComponent. Use this routine instead. @param format A pointer to a valid vImage_CGImageFormat. If format->colorspace is NULL, the format is assumed to belong to the sRGB colorspace. @return Returns the number of color + alpha channels in the image. C function: vImageCGImageFormat_GetComponentCount
func VImageCGImageFormatIsEqual ¶
func VImageCGImageFormatIsEqual(f1 *VImageCGImageFormat, f2 *VImageCGImageFormat) uint8
@function vImageCGImageFormat_IsEqual @abstract Test to see if two vImage_CGImageFormats are equivalent @discussion Returns nonzero if two vImage_CGImageFormats are the same If either operand is NULL, the result is false. If vImage_CGImageFormat.colorSpace is NULL, sRGB is used. @param f1 A pointer to the first vImage_CGImageFormat @param f2 A pointer to the second vImage_CGImageFormat @return nonzero if two vImage_CGImageFormats are the same C function: vImageCGImageFormat_IsEqual
func VImageCVImageFormatCopy ¶
@function vImageCVImageFormat_Copy @abstract Makes a copy of a vImageCVImageFormatRef. @discussion The new vImageCVFormatRef is different from the old one in that: o Its reference count is 1 o The userData field and destructor callback are not copied, and are initialized to NULL. Usually, it is preferable to simply retain a vImageCVImageFormatRef rather than copy it. You may wish to copy a vImageCVImageFormatRef if you want to modify an existing vImageCVImageFormatRef but can't because it is being read by another thread, or to replace another software layer's userData pointer with your own. By convention, the new vImageCVImageFormatRef is considered to have been created by the software layer that called vImageCVImageFormat_Copy. @param format The vImageCVImageFormatRef to copy. @return On success, a non-NULL vImageCVImageFormatRef is returned. Its reference count is 1. You are responsible for releasing it when you are done with it. On failure, this function returns NULL. C function: vImageCVImageFormat_Copy
func VImageCVImageFormatCopyChannelDescription ¶
func VImageCVImageFormatCopyChannelDescription(format unsafe.Pointer, desc *VImageChannelDescription, type_ uint32) int
@function vImageCVImageFormat_CopyChannelDescription @abstract Set the channel description for a particular channel type @discussion The channel description gives information about the range of values and clamping for a image color channel. @param format The vImageCVImageFormatRef that the channel description is for. @param desc A pointer to a new vImageChannelDescription to use for the channel type. The data is copied into the vImageCVImageFormatRef. @param type The type of the channel that you wish to set information about. Example: kvImageBufferTypeCode_Luminance @return kvImageNoError Success kvImageInvalidParameter An invalid vImageBufferTypeCode, either out of range, or the channel type does not appear in the image format @seealso vImageChannelDescription C function: vImageCVImageFormat_CopyChannelDescription
func VImageCVImageFormatCopyConversionMatrix ¶
func VImageCVImageFormatCopyConversionMatrix(format unsafe.Pointer, matrix unsafe.Pointer, inType uint32) int
@function vImageCVImageFormat_CopyConversionMatrix @abstract Set the RGB -> Y'CbCr conversion matrix for the image. @discussion matrix is copied to the vImageCVImageFormatRef's internal matrix storage. Y'CbCr images are defined in terms of a RGB image and a conversion matrix from that RGB format to Y'CbCr. The conversion frequently has the form: <pre> @textblock Y' = R_Yp * R + G_Yp * G + B_Yp * B Y' = [0, 1.0] Cb = k0 * (B - Y') Cb = [-0.5, 0.5] Cr = k1 * (R - Y') Cr = [-0.5, 0.5] @/textblock </pre> That can be reformulated as a 3x3 matrix operation. The element names here correspond to the fields in the vImage_ARGBToYpCbCrMatrix type: <pre> @textblock | Y' | | R_Yp G_Yp B_Yp | | R | | Cb | = | R_Cb G_Cb B_Cb_R_Cr | * | G | | Cr | | B_Cb_R_Cr G_Cr B_Cr | | B | @/textblock </pre> Most Y'CbCr conversion matrices are of this form. However, some conversion matrices, such as that proposed to ITU-R BT.2020 for constant luminance, are more complicated. It is possible for the matrix to be absent. Y'CbCr image types may not be converted without a conversion matrix. @param format The vImageCVImageFormatRef for which the matrix is desired @param matrix The matrix data to be copied to the vImageCVImageFormatRef. If the matrix is a constant predefined by vImage, the address shall be preserved, and returned unmodified by vImageCVImageFormat_GetConversionMatrix. The matrix must have a matrix inverse. @param inType The type of the matrix. The only type defined for OS X.10 and iOS 8.0 is kvImageMatrixType_ARGBToYpCbCrMatrix, which is a vImage_ARGBToYpCbCrMatrix. @return <pre> @textblock kvImageNoError Success. kvImageInvalidParameter The matrix type did not match that required for the image format. kvImageInvalidParameter The matrix is not invertible. (See console for log in this case.) @/textblock </pre> @seealso vImage_ARGBToYpCbCrMatrix @seealso vImageMatrixType C function: vImageCVImageFormat_CopyConversionMatrix
func VImageCVImageFormatCreate ¶
func VImageCVImageFormatCreate(imageFormatType uint32, matrix *VImageARGBToYpCbCrMatrix, cvImageBufferChromaLocation unsafe.Pointer, baseColorspace unsafe.Pointer, alphaIsOneHint int) unsafe.Pointer
@function vImageCVImageFormat_Create @abstract Create a vImageCVImageFormatRef (low level). @discussion This function creates a vImageCVImageFormatRef from first principles. In most cases, vImageCVImageFormat_CreateWithCVPixelBuffer is easier, but if your video pipeline doesn't use CoreVideo, or you need absolute control then this is your alternative. Other fields not given by function parameters like number of channels, channel names, and channel description are automatically configured using the imageFormatType. User data is set separately with vImageCVImageFormat_SetUserData. @param imageFormatType A CVPixelFormatType such as '2vuy'. See CVPixelBuffer.h for the complete list. @param matrix A vImage_ARGBToYpCbCrMatrix showing how to convert from RGB to the YpCbCr format. This may be NULL. However, it is required for conversions involving YpCbCr images, so for YpCbCr images you will be eventually forced to set the matrix using vImageCVImageFormat_CopyConversionMatrix before you can make a vImageConverterRef with this object. There are some predefined conversion matrices in Conversion.h for Rec 601 and 709 formats. @param cvImageBufferChromaLocation See kCVImageBufferChromaLocationTopFieldKey in CVImageBuffer.h for a list of chroma locations. kCVImageBufferChromaLocation_Center is typical. This may be NULL. However, for YpCbCr formats with downsampled chroma, you will be ultimately forced to set a chroma location using vImageCVImageFormat_SetChromaSiting, before a vImageConverterRef can be made with this object. @param baseColorspace For RGB and monochrome images, this is the colorspace of the image. For YpCbCr images, this is the colorspace of the RGB image before it was converted to YpCbCr using the ARGB-to-YpCbCr conversion matrix (see matrix parameter above). The colorspace is defined based on the YpCbCr format RGB primaries and transfer function. This may be NULL. However, you will eventually be forced to set set a colorspace for all image types, before a vImageConvertRef can be made with this object. @param alphaIsOneHint Typically this is 0. If your image format has an alpha channel, but you know the image is fully opaque, or want it to be treated as opaque, you can set this to 1. This may allow for faster conversions to opaque formats. @return On success, a non-NULL vImageCVImageFormatRef will be returned, which encodes the information contained in the above parameters. The vImageCVImageFormatRef has a retain count of 1. You must release it when you are done with it. On failure, NULL is returned. C function: vImageCVImageFormat_Create
func VImageCVImageFormatCreateWithCVPixelBuffer ¶
@function vImageCVImageFormat_CreateWithCVPixelBuffer @abstract Used to create a vImageCVImageFormatRef to describe the pixel format of an existing CVPixelBufferRef. @discussion If the CVPixelBufferRef has incomplete pixel format information, the vImageCVImageFormatRef will also be incomplete. Not all missing fields ultimately will prove to be necessary, however. If a function that consumes a vImageCVImageFormatRef returns a vImageCVImageFormatError code, please add the missing information and try again. See "vImageCVImageFormatRef Accessors" below. @param buffer The CBPixelBufferRef on which to base the vImageCVImageFormatRef @return On success, a non-NULL vImageCVImageFormatRef is returned. The vImageCVImageFormatRef has a retain count of 1. You are responsible for releasing it when you are done with it. C function: vImageCVImageFormat_CreateWithCVPixelBuffer
func VImageCVImageFormatGetAlphaHint ¶
@function vImageCVImageFormat_GetAlphaHint @abstract Get the alpha-is-one hint from a vImageCVImageFormatRef @discussion Some image formats have an alpha channel. Sometimes, the alpha channel for the entire image is known to be 1.0 (fully opaque). In some circumstances, that knowledge can be used to eliminate work from a conversion to make it faster, especially when converting to a format without an alpha channel. If the alpha-is-one hint is non-zero, it indicates that the alpha channel is fully opaque. Images that do not have an alpha channel will also return non-zero. There are a few image formats that have room for an alpha channel (kCVPixelFormatType_16BE555, kCVPixelFormatType_16LE555, kCVPixelFormatType_30RGB) but which do not have an alpha channel. Setting the alpha-is-one hint to 0 does not add an alpha channel to these image types. The alpha-is-one hint is a hint. It can not be absent in a way that will prevent conversion. If it is not set or is zero, and the image format has alpha, then the alpha channel will be included in the calculation. If the result format has alpha, the alpha will propagate there. If the result format does not have alpha, the image will be flattened against the indicated background color for the conversion. @param format The vImageCVImageFormatRef for which the colorspace is to be set. @return 0 Alpha is not known to be opaque, or the hint has not been set. non-zero Alpha is known to be fully opaque, even if the values encoded for alpha in the image are not 1.0. C function: vImageCVImageFormat_GetAlphaHint
func VImageCVImageFormatGetChannelCount ¶
@function vImageCVImageFormat_GetChannelCount @abstract Return the the number of color channels in the image, including alpha. @discussion The channels may be interleaved or planar. For RGBA, the result is 4. For 'yuvs' this is 3. This does not return the same results as vImageConverter_GetNumberOfSourceBuffers / vImageConverter_GetNumberOfSourceBuffers, which instead describe the number of vImage_Buffers to pass to vImageConvert_AnyToAny. Some vImage_Buffers contain multiple channels. @param format The vImageCVImageFormatRef for which the number of channels is desired. @return A uint32_t containing the number of channels C function: vImageCVImageFormat_GetChannelCount
func VImageCVImageFormatGetChannelNames ¶
@function vImageCVImageFormat_GetChannelNames @abstract Get a const kvImageBufferTypeCode_EndOfList-terminated array indicating the names of the channels in the buffer. @discussion The array is owned by the vImageCvImageFormatRef and will cease to be valid when the object is destroyed. This function is not useful to discover the correct vImage_Buffer order for a call to vImageConvert_AnyToAny(). @param format The vImageCVImageFormatRef for which the channel names are desired. @return A const pointer to an array of vImageBufferTypeCodes indicating the names of the channels in the image. @seealso vImageConverter_GetSourceBufferOrder @seealso vImageConverter_GetDestinationBufferOrder C function: vImageCVImageFormat_GetChannelNames
func VImageCVImageFormatGetChromaSiting ¶
@function vImageCVImageFormat_GetChromaSiting @abstract Get the chroma-siting for the image. @discussion When Y'CbCr images have subsampled chroma, the position of the chroma samples relative to the luminance samples needs to be specified. Chroma siting information is only needed for Y'CbCr images that are not 444. @param format The vImageCVImageFormatRef for which the chroma siting information is desired. @return Returns a CFStringRef that describes the positioning of the chroma samples. Eligible string return values are listed in CoreVideo/CVImageBuffer.h. The result is NULL if the chroma siting information is missing. @seealso //apple_ref/c/data/kCVImageBufferChromaLocationTopFieldKey kCVImageBufferChromaLocationTopFieldKey C function: vImageCVImageFormat_GetChromaSiting
func VImageCVImageFormatGetColorSpace ¶
@function vImageCVImageFormat_GetColorSpace @abstract Get the colorspace associated with the image. @discussion If the image format is a Y'CbCr image format, this is the RGB colorspace of the image after the inverse RGB->YpCbCr conversion matrix is applied. Otherwise, it is the colorspace of the pixels in the image. @param format The vImageCVImageFormatRef for which the colorspace is desired. @return The colorspace (if any) that is returned is referenced by the vImageCVImageFormatRef and will be released when that object is destroyed. This function may return NULL, indicating an absence of colorspace information. C function: vImageCVImageFormat_GetColorSpace
func VImageCVImageFormatGetConversionMatrix ¶
@function vImageCVImageFormat_GetConversionMatrix @abstract Get the RGB -> Y'CbCr conversion matrix for the image. @discussion Y'CbCr images are defined in terms of a RGB image and a conversion matrix from that RGB format to Y'CbCr. The conversion frequently has the form: <pre> @textblock Y' = R_Yp * R + G_Yp * G + B_Yp * B Y' = [0, 1.0] Cb = k0 * (B - Y') Cb = [-0.5, 0.5] Cr = k1 * (R - Y') Cr = [-0.5, 0.5] @/textblock </pre> That can be reformulated as a 3x3 matrix operation. The element names here correspond to the fields in the vImage_ARGBToYpCbCrMatrix type: <pre> @textblock | Y' | | R_Yp G_Yp B_Yp | | R | | Cb | = | R_Cb G_Cb B_Cb_R_Cr | * | G | | Cr | | B_Cb_R_Cr G_Cr B_Cr | | B | @/textblock </pre> Most Y'CbCr conversion matrices are of this form. However, some conversion matrices, such as that proposed to ITU-R BT.2020 for constant luminance, are more complicated. It is possible for the matrix to be absent. Y'CbCr image types may not be converted without a conversion matrix. @param format The vImageCVImageFormatRef for which the matrix is desired @param outType A pointer to a variable of type vImageMatrixType. @return A pointer to a matrix will be returned from the left hand side of the function. The memory pointed to by outType will be overwritten with the type of the matrix returned. The returned matrix may be NULL, indicating an absent matrix. The matrix is owned by the vImageCvImageFormatRef and will cease to be valid when the vImageCvImageFormatRef is destroyed. @seealso vImage_ARGBToYpCbCrMatrix @seealso vImageMatrixType C function: vImageCVImageFormat_GetConversionMatrix
func VImageCVImageFormatGetFormatCode ¶
@function vImageCVImageFormat_GetFormatCode @abstract Return the kCVPixelFormatType_ (4 character code) that encodes the pixel format. @discussion The kCVPixelFormatType_ of a CoreVideo pixel buffer is given by a four character code (4CC), such as '2vuy'. It describes the number of channels, channel packing order, bits per component (except in one case), and usually range information like whether it is full range or video range. @param format The vImageCVImageFormatRef for which the 4 character code is desired. @return A 4CC in host-endian format. @seealso //apple_ref/doc/constant_group/Pixel_Format_Types CoreVideo/CVPixelBuffer.h C function: vImageCVImageFormat_GetFormatCode
func VImageCVImageFormatGetUserData ¶
@function vImageCVImageFormat_GetUserData @abstract Get the user info pointer attached to the image format @discussion There may be extra information that you wish to attach to a vImageCVImageFormatRef. It might be a pthread_rwlock_t to help prevent concurrent access to the vImageCVImageFormatRef while it is being modified, or perhaps additional metadata about the image format that you may need later. It may even just a pointer to an object you wrote which wraps the vImageCVImageFormatRef. The user data pointer is available for you to use to store a reference to this information. The token is opaque to vImage. vImage only returns it when asked via vImageCVImageFormat_GetUserData. It can be set with vImageCVImageFormat_SetUserData. @param format The vImageCVImageFormatRef to get the userData from. @return The address of the userData. It will be NULL if no userData has been set. @seealso vImageCVImageFormat_SetUserData C function: vImageCVImageFormat_GetUserData
func VImageCVImageFormatRelease ¶
@function vImageCVImageFormat_Release @abstract Releases a vImageCVImageFormatRef @discussion The vImageCVImageFormatRef follows standard retain/release semantics. vImageCVImageFormat_Retain causes the object's reference count to be incremented. vImageCVImageFormat_Release causes the object's reference count to be decremented. When the reference count reaches 0, the userDataReleaseCallback (if any) is called, and the object is then destroyed. The userDataReleaseCallback can access the vImageCVImageFormatRef, but can not prevent vImageCVImageFormatRef destruction. For this reason, the userDataReleaseCallback should be careful who it hands off control to in case that software layer attempts to retain the vImageCVImageFormatRef. This will result in undefined behavior. @param fmt The vImageCVImageFormatRef to release fmt may be NULL, in which case nothing occurs. C function: vImageCVImageFormat_Release
func VImageCVImageFormatRetain ¶
@function vImageCVImageFormat_Retain @abstract Retains a vImageCVImageFormatRef @discussion The vImageCVImageFormatRef follows standard retain/release semantics. vImageCVImageFormat_Retain causes the object's reference count to be incremented. vImageCVImageFormat_Release causes the object's reference count to be decremented. When the reference count reaches 0, the userDataReleaseCallback (if any) is called, and the object is then destroyed. The userDataReleaseCallback can access the vImageCVImageFormatRef, but can not prevent vImageCVImageFormatRef destruction. For this reason, the userDataReleaseCallback should be careful who it hands off control to in case that software layer attempts to retain the vImageCVImageFormatRef. This will result in undefined behavior. @param fmt The vImageCVImageFormatRef to retain fmt may be NULL, in which case nothing occurs. C function: vImageCVImageFormat_Retain
func VImageCVImageFormatSetAlphaHint ¶
@function vImageCVImageFormat_SetAlphaHint @abstract Set the alpha-is-one hint for a vImageCVImageFormatRef @discussion Some image formats have an alpha channel. Sometimes, the alpha channel for the entire image is known to be 1.0 (fully opaque). In some circumstances, that knowledge can be used to eliminate work from a conversion to make it faster, especially when converting to a format without an alpha channel. If the alpha-is-one hint is non-zero, it indicates that the alpha channel is fully opaque. The alpha-is-one hint is a hint. It can not be absent in a way that will prevent conversion. If it is not set or is zero, and the image format has alpha, then the alpha channel will be included in the calculation. If the result format has alpha, the alpha will propagate there. If the result format does not have alpha, the image will be flattened against the indicated background color for the conversion. There are a few image formats that have room for a small alpha channel (kCVPixelFormatType_16BE555, kCVPixelFormatType_16LE555, kCVPixelFormatType_30RGB) but which do not have an alpha channel. Setting the alpha-is-one hint to 0 does not add an alpha channel to these image types. If this behavior is desired, such image formats can generally be described using a vImage_CGImageFormat. If so, you can set the vImage_CGImageFormat.bitmap info to an appropriate CGImageAlphaInfo for the desired treatment for the alpha channel and convert using vImageConverter_CreateWithCGImageFormat() + vImageConvert_AnyToAny(). @param format The vImageCVImageFormatRef for which the colorspace is to be set. @parma alphaIsOne The new value for the alpha-is-one hint. @return kvImageNoError Success. kvImageInvalidParameter format is NULL C function: vImageCVImageFormat_SetAlphaHint
func VImageCVImageFormatSetChromaSiting ¶
@function vImageCVImageFormat_SetChromaSiting @abstract Set the chroma-siting for the image. @discussion When Y'CbCr images have subsampled chroma, the position of the chroma samples relative to the luminance samples needs to be specified. Chroma siting information is only needed for Y'CbCr images that are not 444. The new siting name will be retained. The old siting will be released. This function has no effect for image format types that do not require siting information. @param format The vImageCVImageFormatRef for which the chroma siting information is desired. @param siting The new siting information for the format. May be NULL. @return <pre> @textblock kvImageNoError Success kvImageInvalidImageFormat format is NULL kvImageInvalidParameter siting is not a recognized CFStringRef from the set of values appearing in CoreVideo/CVImageBuffer.h. @/textblock </pre> @seealso //apple_ref/c/data/kCVImageBufferChromaLocationTopFieldKey kCVImageBufferChromaLocationTopFieldKey C function: vImageCVImageFormat_SetChromaSiting
func VImageCVImageFormatSetColorSpace ¶
@function vImageCVImageFormat_SetColorSpace @abstract Set the colorspace associated with the image. @discussion If the image format is a Y'CbCr image format, this sets the RGB colorspace of the image before the RGB->YpCbCr conversion matrix was applied. Otherwise, it is the colorspace of the pixels in the image. A non-NULL colorspace must be present before a vImageCVImageFormatRef can be used to do a conversion. @param format The vImageCVImageFormatRef for which the colorspace is to be set. @param colorspace The new colorspace. May be NULL, indicating missing colorspace information. @return On Success, kvImageNoError. An error will be returned if the colorspace model doesn't match what is expected for the image format type. For example, a 'RGBA' image must be kCGColorSpaceModelRGB. Y'CbCr images expect a RGB colorspace. The new colorspace will be retained and he old one will be released. On failure, nothing occurs. C function: vImageCVImageFormat_SetColorSpace
func VImageCVImageFormatSetUserData ¶
func VImageCVImageFormatSetUserData(format unsafe.Pointer, userData unsafe.Pointer, userDataReleaseCallback unsafe.Pointer) int
@function vImageCVImageFormat_SetUserData @abstract Sets the userData pointer and a userDataReleaseCallback function @seealso vImageCVImageFormat_SetUserData @discussion The userDataReleaseCallback is called when the vImageCVImageFormatRef is destroyed. You may access the vImageCVImageFormatRef during the callback function. However vImageCVImageFormat_Retain() will not prevent the destruction of the object in that context. The userDataReleaseCallback will also be called on the previous user data in the event that vImageCVImageFormat_SetUserData is called to replace one set of user date with another. CAUTION: vImage does not attempt to do anything smart when the old and new userData are actually the same or differ only by callback. vImage does not attempt to free the user data when the vImageCVImageFormatRef is destroyed. If the userData needs to be freed/released/etc. at this time, then you should do so in your userDataReleaseCallback. vImageCVImageFormat_SetUserData function is not atomic. vImageCVImageFormat_SetUserData is not safe to call reentrantly. Since there can be only one userData attached to a vImageCVImageFormatRef, the userData field is reserved by convention for exclusive use by the app/framework/library that created the vImageCVImageFormatRef. If you need to attach your own userData to a vImageCVImageFormatRef that you did not create, make a copy of it with vImageCVImageFormat_Copy. The new copy will not have userData attached to it. @param format The vImageCVImageFormatRef to get the userData from. @param userData The new userData pointer. @param userDataReleaseCallback The callback that is called when the vImageCVImageFormatRef is destroyed, or when the userData is replaced with another one. @param callback_fmt The vImageCVImageFormatRef that the userData is attached to. @param callback_userData The userData field attached to callback_fmt. @return kvImageNoError - Success @return kvImageInvalidImageFormat - Format is NULL C function: vImageCVImageFormat_SetUserData
func VImageClipPlanarF ¶
func VImageClipPlanarF(src *VImageBuffer, dest *VImageBuffer, maxFloat float32, minFloat float32, flags uint32) int
@function vImageClip_PlanarF @abstract Clips the pixel values of an image in PlanarF format, using the provided minimum and maximum values. @discussion For each pixel, do the following: @code if( pixel > maxFloat ) pixel = maxFloat; if( pixel < minFloat ) pixel = minFloat; @endcode This function can work in place provided the following are true: If src overlaps with dest, src->data must be equal to dest->data and src->rowBytes >= dest->rowBytes If an overlapping src has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags @param src A pointer to a vImage buffer structure that contains the source image whose data you want to clip. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a allocated buffer to receive the result pixels. @param maxFloat A maximum pixel value. The function clips larger values to this value in the destination image. @param minFloat A minimum pixel value. The function clips smaller values to this value in the destination image. @param flags \p kvImageNoFlags Default operation. \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. @note This function may be used for multichannel image formats, such as ARGBFFFF. Scale the vImage_Buffer.width to compensate for the extra channels. C function: vImageClip_PlanarF
func VImageClipToAlphaARGB8888 ¶
func VImageClipToAlphaARGB8888(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageClipToAlpha_ARGB8888 @abstract Clamp a ARGB8888 color buffer to be less than or equal to alpha @discussion For each pixel, each color channel shall be set to the smaller of the color channel or alpha value for that pixel. <pre>@textblock alpha_result = alpha color_result = MIN( color, alpha ) @/textblock </pre> This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags This function will work for any channel order with alpha first, not just ARGB. @param src The color image to clip @param dest A preallocated buffer to receive the results. @param flags The following flags are allowed: <pre> @textblock kvImageNoFlags Default operation. kvImageDoNotTile Disable internal multithreading. @/textblock </pre> @result The following error codes may occur: <pre> @textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer dest->height and dest->width must be less than or equal to corresponding dimensions in srcTop, srcTopAlpha and srcBottom. @/textblock </pre> C function: vImageClipToAlpha_ARGB8888
func VImageClipToAlphaARGBFFFF ¶
func VImageClipToAlphaARGBFFFF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageClipToAlpha_ARGBFFFF @abstract Clamp a ARGBFFFF color buffer to be less than or equal to alpha @discussion For each pixel, each color channel shall be set to the smaller of the color channel or alpha value for that pixel. <pre>@textblock alpha_result = alpha color_result = MIN( color, alpha ) @/textblock </pre> This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags This function will work for any channel order with alpha first, not just ARGB. @param src The color image to clip @param dest A preallocated buffer to receive the results. @param flags The following flags are allowed: <pre> @textblock kvImageNoFlags Default operation. kvImageDoNotTile Disable internal multithreading. @/textblock </pre> @result The following error codes may occur: <pre> @textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer dest->height and dest->width must be less than or equal to corresponding dimensions in srcTop, srcTopAlpha and srcBottom. @/textblock </pre> C function: vImageClipToAlpha_ARGBFFFF
func VImageClipToAlphaPlanar8 ¶
func VImageClipToAlphaPlanar8(src *VImageBuffer, alpha *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageClipToAlpha_Planar8 @abstract Clamp a Planar8 color buffer to be less than or equal to alpha @discussion For each pixel, each color channel shall be set to the smaller of the color channel or alpha value for that pixel. <pre>@textblock color_result = MIN( color, alpha ) @/textblock </pre> This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags @param src The color image to clip @param alpha The alpha channel @param dest A preallocated buffer to receive the results. @param flags The following flags are allowed: <pre> @textblock kvImageNoFlags Default operation. kvImageDoNotTile Disable internal multithreading. @/textblock </pre> @result The following error codes may occur: <pre> @textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer dest->height and dest->width must be less than or equal to corresponding dimensions in srcTop, srcTopAlpha and srcBottom. @/textblock </pre> C function: vImageClipToAlpha_Planar8
func VImageClipToAlphaPlanarF ¶
func VImageClipToAlphaPlanarF(src *VImageBuffer, alpha *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageClipToAlpha_PlanarF @abstract Clamp a PlanarF color buffer to be less than or equal to alpha @discussion For each pixel, each color channel shall be set to the smaller of the color channel or alpha value for that pixel. <pre>@textblock color_result = MIN( color, alpha ) @/textblock </pre> This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags @param src The color image to clip @param alpha The alpha channel @param dest A preallocated buffer to receive the results. @param flags The following flags are allowed: <pre> @textblock kvImageNoFlags Default operation. kvImageDoNotTile Disable internal multithreading. @/textblock </pre> @result The following error codes may occur: <pre> @textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer dest->height and dest->width must be less than or equal to corresponding dimensions in srcTop, srcTopAlpha and srcBottom. @/textblock </pre> C function: vImageClipToAlpha_PlanarF
func VImageClipToAlphaRGBA8888 ¶
func VImageClipToAlphaRGBA8888(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageClipToAlpha_RGBA8888 @abstract Clamp a RGBA8888 color buffer to be less than or equal to alpha @discussion For each pixel, each color channel shall be set to the smaller of the color channel or alpha value for that pixel. <pre>@textblock alpha_result = alpha color_result = MIN( color, alpha ) @/textblock </pre> This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags This function will work for any channel order with alpha last, not just RGBA. Also available as vImageClipToAlpha_BGRA8888(). @param src The color image to clip @param dest A preallocated buffer to receive the results. @param flags The following flags are allowed: <pre> @textblock kvImageNoFlags Default operation. kvImageDoNotTile Disable internal multithreading. @/textblock </pre> @result The following error codes may occur: <pre> @textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer dest->height and dest->width must be less than or equal to corresponding dimensions in srcTop, srcTopAlpha and srcBottom. @/textblock </pre> C function: vImageClipToAlpha_RGBA8888
func VImageClipToAlphaRGBAFFFF ¶
func VImageClipToAlphaRGBAFFFF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageClipToAlpha_RGBAFFFF @abstract Clamp a RGBAFFFF color buffer to be less than or equal to alpha @discussion For each pixel, each color channel shall be set to the smaller of the color channel or alpha value for that pixel. <pre>@textblock alpha_result = alpha color_result = MIN( color, alpha ) @/textblock </pre> This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags This function will work for any channel order with alpha last, not just RGBA. Also available as vImageClipToAlpha_BGRAFFFF(). @param src The color image to clip @param dest A preallocated buffer to receive the results. @param flags The following flags are allowed: <pre> @textblock kvImageNoFlags Default operation. kvImageDoNotTile Disable internal multithreading. @/textblock </pre> @result The following error codes may occur: <pre> @textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer dest->height and dest->width must be less than or equal to corresponding dimensions in srcTop, srcTopAlpha and srcBottom. @/textblock </pre> C function: vImageClipToAlpha_RGBAFFFF
func VImageContrastStretchARGB8888 ¶
func VImageContrastStretchARGB8888(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageContrastStretch_ARGB8888
func VImageContrastStretchARGBFFFF ¶
func VImageContrastStretchARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, histogramEntries uint, minVal float32, maxVal float32, flags uint32) int
C function: vImageContrastStretch_ARGBFFFF
func VImageContrastStretchPlanar8 ¶
func VImageContrastStretchPlanar8(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageContrastStretch_Planar8
func VImageContrastStretchPlanarF ¶
func VImageContrastStretchPlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, histogramEntries uint, minVal float32, maxVal float32, flags uint32) int
C function: vImageContrastStretch_PlanarF
func VImageConvert8to16Q12 ¶
func VImageConvert8to16Q12(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageConvert_8to16Q12
func VImageConvert12UTo16U ¶
func VImageConvert12UTo16U(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageConvert_12UTo16U @abstract Converts 12U to 16U @discussion For each floating point pixel in src, do the following: @code uint8_t *srcRow = srcData; uint16_t *destRow = destData; //Load 2 12-bit values t0 = (srcRow[0] << 16) | (srcRow[1] << 8) | srcRow [2]; srcRow += 3; //Separate each of 12-bit t1 = t0 & 0xfff; t0 >>= 12; //Convert and store destRow[0] = (t0 * 65535U + (t0 << 4) + 2055U) >> 12; destRow[1] = (t1 * 65535U + (t1 << 4) + 2055U) >> 12; destRow += 2; @endcode @param src A pointer to a vImage_Buffer that references 12-bit source pixels @param dest A pointer to a vImage_Buffer that references 16-bit destination pixels. @param flags \p kvImageDoNotTile Turns off internal multithreading. @return \p kvImageNoError Success! @return \p kvImageRoiLargerThanInputBuffer The source buffer must have a height and width at least as large as the destination buffer. @return \p kvImageNullPointerArgument src, dest or table pointer is NULL. @note This routine will not work in place. C function: vImageConvert_12UTo16U
func VImageConvert16Fto16Q12 ¶
func VImageConvert16Fto16Q12(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageConvert_16Fto16Q12 @abstract Convert half-precision floating-point to 16Q12 (16-bit format with 12 fractional bits). @discussion Source pixel values of 0 are mapped to 0, and source pixel values of (Pixel_16F) 1.0f are mapped to (Pixel_16Q12) 4096. @note Works in place provided that src->data == dest->data && src->rowBytes == dest->rowBytes. @param src The input image. @param dest A pointer to a preallocated vImage_Buffer to receive the resulting image. @param flags \p kvImageDoNotTile Disables internal multithreading, if any. \p kvImageGetTempBufferSize Returns zero, as the routine does not use a temp buffer. @return kvImageNoError There was no error. @return kvImageBufferSizeMismatch The destination buffers do not have the same size as each other @return kvImageRoiLargerThanInputBuffer The destination buffers are larger than the source buffer. @return kvImageUnknownFlagsBit Unknown flag(s) provided. C function: vImageConvert_16Fto16Q12
func VImageConvert16Fto16U ¶
func VImageConvert16Fto16U(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageConvert_16Fto16U @abstract Convert from 16 bit float to 16 bit unsigned integer format. @discussion For each floating point pixel in src, do the following: @code destPixel[x] = ConvertToPlanar16U(srcPixel[x]); @endcode The 16 bit floating point format is half-precision floating point (a.k.a. IEEE-754 binary16, OpenCL half, GL_ARB_half_float_pixel, OpenEXR half). It has a layout as follows: 16 bits: seeeeemmmmmmmmmm 1-bit sign | 5 bits of exponent, with a bias of 15 | 10 bits of significand (with 11 bits of significance due to the implicit 1 bit) NaNs, Infinities and denormals are supported. Per IEEE-754, all signaling NaNs are quieted during the conversion. (OpenEXR-1.2.1 converts SNaNs to SNaNs.) To set/inspect the current IEEE-754 rounding mode, please see appropriate utilities in fenv.h @param src A pointer to a vImage_Buffer that references the source pixels. @param dest A pointer to a vImage_Buffer that references the destination pixels. @param flags \p kvImageDoNotTile Turns off internal multithreading. @return \p kvImageNoError Success! @return \p kvImageRoiLargerThanInputBuffer The source buffer must have a height and width at least as large as the destination buffer. @return \p kvImageNullPointerArgument src or dest pointer is NULL. @return \p kvImageUnknownFlagsBit Unknown flag was passed. @note This routine will work in place provided that src.data == dest.data and src.rowBytes >= dest.rowBytes. However, when src.rowBytes > dest.rowBytes in-place will only work if you pass kvImageDoNotTile. @note To use this with interleaved data, multiply vImage_Buffer.width by 4 C function: vImageConvert_16Fto16U
func VImageConvert16Q12to8 ¶
func VImageConvert16Q12to8(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageConvert_16Q12to8
func VImageConvert16Q12to16F ¶
func VImageConvert16Q12to16F(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageConvert_16Q12to16F @abstract Convert 16Q12 (16-bit format with 12 fractional bits) to half-precision floating-point. @discussion Source pixel values of 0 are mapped to 0, and source pixel values of (Pixel_16Q12) 4096 are mapped to (Pixel_16F) 1.0f. @note Works in place provided that src->data == dest->data && src->rowBytes == dest->rowBytes. @param src The input image. @param dest A pointer to a preallocated vImage_Buffer to receive the resulting image. @param flags \p kvImageDoNotTile Disables internal multithreading, if any. \p kvImageGetTempBufferSize Returns zero, as the routine does not use a temp buffer. @return kvImageNoError There was no error. @return kvImageBufferSizeMismatch The destination buffers do not have the same size as each other @return kvImageRoiLargerThanInputBuffer The destination buffers are larger than the source buffer. @return kvImageUnknownFlagsBit Unknown flag(s) provided. C function: vImageConvert_16Q12to16F
func VImageConvert16Q12to16U ¶
func VImageConvert16Q12to16U(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageConvert_16Q12to16U
func VImageConvert16Q12toF ¶
func VImageConvert16Q12toF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageConvert_16Q12toF
func VImageConvert16SToF ¶
func VImageConvert16SToF(src *VImageBuffer, dest *VImageBuffer, offset float32, scale float32, flags uint32) int
@function vImageConvert_16SToF @abstract Convert a planar vImage_Buffer of 16 bit signed integers to a buffer containing floating point values. @discussion For each 16 bit pixel in src, do the following: @code float result = (float) srcPixel * scale + offset; @endcode To convert 4 channel interleaved signed 16 bit data to ARGBFFFF, simply multiply the vImage_Buffer.width by 4. @param src A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing source pixels. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param scale A scale value in the conversion. @param offset A offset value in the conversion. @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. @note Does not work in place. C function: vImageConvert_16SToF
func VImageConvert16UTo12U ¶
func VImageConvert16UTo12U(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageConvert_16UTo12U @abstract Converts 16U to 12U @discussion For each floating point pixel in src, do the following: @code uint16_t *srcRow = srcData; uint8_t *destRow = destData; // 2 16-bit in 4-bytes t0 = srcRow[0]; t1 = srcRow[1]; srcRow += 2; t0 = (t0 * 4095 + 32767 + (t0 >> 4)) >> 16; t1 = (t1 * 4095 + 32767 + (t1 >> 4)) >> 16; t0 <<= 12; t0 |= t1; // 2 12-bit in 3-bytes destRow[0] = t0 >> 16; destRow[1] = t0 >> 8; destRow[2] = t0; destRow += 3; @endcode @param src A pointer to a vImage_Buffer that references 12-bit source pixels @param dest A pointer to a vImage_Buffer that references 16-bit destination pixels. @param flags \p kvImageDoNotTile Turns off internal multithreading. @return \p kvImageNoError Success! @return \p kvImageRoiLargerThanInputBuffer The source buffer must have a height and width at least as large as the destination buffer. @return \p kvImageNullPointerArgument src, dest or table pointer is NULL. @note This routine will not work in place. C function: vImageConvert_16UTo12U
func VImageConvert16UToF ¶
func VImageConvert16UToF(src *VImageBuffer, dest *VImageBuffer, offset float32, scale float32, flags uint32) int
@function vImageConvert_16UToF @abstract Convert a planar vImage_Buffer of 16 bit unsigned integers to a buffer containing floating point values. @discussion For each 16 bit pixel in src, do the following: @code float result = (float) srcPixel * scale + offset; @endcode To convert 4 channel interleaved signed 16 bit data to ARGBFFFF, simply multiply the vImage_Buffer.width by 4. @param src A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing source pixels. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param scale A scale value in the conversion. @param offset A offset value in the conversion. @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. @note Does not work in place. C function: vImageConvert_16UToF
func VImageConvert16UToPlanar8 ¶
func VImageConvert16UToPlanar8(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageConvert_16UToPlanar8
func VImageConvert16Uto16F ¶
func VImageConvert16Uto16F(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageConvert_16Uto16F @abstract Convert from 16 bit unsigned integer to 16 bit float format. @discussion For each floating point pixel in src, do the following: @code destPixel[x] = ConvertToPlanar16F(srcPixel[x]); @endcode The 16 bit floating point format is half-precision floating point (a.k.a. IEEE-754 binary16, OpenCL half, GL_ARB_half_float_pixel, OpenEXR half). It has a layout as follows: 16 bits: seeeeemmmmmmmmmm 1-bit sign | 5 bits of exponent, with a bias of 15 | 10 bits of significand (with 11 bits of significance due to the implicit 1 bit) NaNs, Infinities and denormals are supported. Per IEEE-754, all signaling NaNs are quieted during the conversion. (OpenEXR-1.2.1 converts SNaNs to SNaNs.) To set/inspect the current IEEE-754 rounding mode, please see appropriate utilities in fenv.h. @param src A pointer to a vImage_Buffer that references the source pixels. @param dest A pointer to a vImage_Buffer that references the destination pixels. @param flags \p kvImageDoNotTile Turns off internal multithreading. @return \p kvImageNoError Success! @return \p kvImageRoiLargerThanInputBuffer The source buffer must have a height and width at least as large as the destination buffer. @return \p kvImageNullPointerArgument src or dest pointer is NULL. @return \p kvImageUnknownFlagsBit Unknown flag was passed. @note This routine will work in place provided that src.data == dest.data and src.rowBytes >= dest.rowBytes. However, when src.rowBytes > dest.rowBytes in-place will only work if you pass kvImageDoNotTile. @note To use this with interleaved data, multiply vImage_Buffer.width by 4. C function: vImageConvert_16Uto16F
func VImageConvert16Uto16Q12 ¶
func VImageConvert16Uto16Q12(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageConvert_16Uto16Q12
func VImageConvert420Yp8Cb8Cr8ToARGB8888 ¶
func VImageConvert420Yp8Cb8Cr8ToARGB8888(srcYp *VImageBuffer, srcCb *VImageBuffer, srcCr *VImageBuffer, dest *VImageBuffer, info *VImageYpCbCrToARGB, permuteMap *uint8, alpha uint8, flags uint32) int
C function: vImageConvert_420Yp8_Cb8_Cr8ToARGB8888
func VImageConvert420Yp8CbCr8ToARGB8888 ¶
func VImageConvert420Yp8CbCr8ToARGB8888(srcYp *VImageBuffer, srcCbCr *VImageBuffer, dest *VImageBuffer, info *VImageYpCbCrToARGB, permuteMap *uint8, alpha uint8, flags uint32) int
C function: vImageConvert_420Yp8_CbCr8ToARGB8888
func VImageConvert422CbYpCrYp8AA8ToARGB8888 ¶
func VImageConvert422CbYpCrYp8AA8ToARGB8888(src *VImageBuffer, srcA *VImageBuffer, dest *VImageBuffer, info *VImageYpCbCrToARGB, permuteMap *uint8, flags uint32) int
C function: vImageConvert_422CbYpCrYp8_AA8ToARGB8888
func VImageConvert422CbYpCrYp8ToARGB8888 ¶
func VImageConvert422CbYpCrYp8ToARGB8888(src *VImageBuffer, dest *VImageBuffer, info *VImageYpCbCrToARGB, permuteMap *uint8, alpha uint8, flags uint32) int
@function vImageConvert_422CbYpCrYp8ToARGB8888 @abstract Convert YUV 422CbYpCrYp8 format to ARGB8888 @param src A pointer to vImage_Buffer that references YUV 422CbYpCrYp8 source pixels. @param dest A pointer to vImage_Buffer that references 8-bit ARGB interleaved destination pixels. @param info A pointer to vImage_YpCbCrToARGB which contains info coeffcient and preBias values. @param permuteMap Values that can be used to switch the channel order of dest. For exmaple, permuteMap[4] = {0, 1, 2, 3} or NULL are ARGB8888. permuteMap[4] = {3, 2, 1, 0} is BGRA8888. Any order of permuteMap is allowed when each permuteMap value is 0, 1, 2, or 3. @param alpha A value for alpha channel in dest. @param flags <pre> @textblock kvImageGetTempBufferSize Returns 0. Does no work. kvImageDoNotTile Disables internal multithreading, if any. @/textblock </pre> @discussion Convert YUV 422CbYpCrYp8 format to ARGB8888 Cb0 Yp0 Cr0 Yp1 => A0 R0 G0 B0 A1 R1 G1 B1 YUV 422CbYpCrYp8 can be used for '2vuy' and '2vuf' that are defined in CVPixelBuffer.h. For example, if we want to use this function to convert '2vuy' with ITU 601 video range to ARGB8888, then we need generate vImage_YpCbCrToARGB by vImageConvert_YpCbCrToARGB_GenerateConversion() and call this function. Yp_bias, CbCr_bias, CbCr_bias, Yp, Cr_R, Cb_G, Cr_G, and Cb_B are calculated and converted into the right format by vImageConvert_YpCbCrToARGB_GenerateConversion() inside of vImage_YpCbCrToARGB. The per-pixel operation is: <pre> @textblock uint8_t *srcPixel = src.data; Cb0 = srcPixel[0]; Yp0 = srcPixel[1]; Cr0 = srcPixel[2]; Yp1 = srcPixel[3]; srcPixel += 4; A0 = alpha R0 = CLAMP(0, ROUND_TO_NEAREST_INTEGER((Yp0 - Yp_bias) * Yp + (Cr0 - CbCr_bias) * Cr_R), 255 ) G0 = CLAMP(0, ROUND_TO_NEAREST_INTEGER((Yp0 - Yp_bias) * Yp + (Cb0 - CbCr_bias) * Cb_G + (Cr0 - CbCr_bias) * Cr_G), 255 ) B0 = CLAMP(0, ROUND_TO_NEAREST_INTEGER((Yp0 - Yp_bias) * Yp + (Cb0 - CbCr_bias) * Cb_B ), 255 ) A1 = alpha R1 = CLAMP(0, ROUND_TO_NEAREST_INTEGER((Yp1 - Yp_bias) * Yp + (Cr0 - CbCr_bias) * Cr_R), 255 ) G1 = CLAMP(0, ROUND_TO_NEAREST_INTEGER((Yp1 - Yp_bias) * Yp + (Cb0 - CbCr_bias) * Cb_G + (Cr0 - CbCr_bias) * Cr_G), 255 ) B1 = CLAMP(0, ROUND_TO_NEAREST_INTEGER((Yp1 - Yp_bias) * Yp + (Cb0 - CbCr_bias) * Cb_B ), 255 ) uint8_t ARGB[8]; ARGB[0] = A0; ARGB[1] = R0; ARGB[2] = G0; ARGB[3] = B0; ARGB[4] = A1; ARGB[5] = R1; ARGB[6] = G1; ARGB[7] = B1; uint8_t *destPixel = dest.data; destPixel[0] = ARGB[permuteMap[0]]; destPixel[1] = ARGB[permuteMap[1]]; destPixel[2] = ARGB[permuteMap[2]]; destPixel[3] = ARGB[permuteMap[3]]; destPixel[4] = ARGB[permuteMap[0]+4]; destPixel[5] = ARGB[permuteMap[1]+4]; destPixel[6] = ARGB[permuteMap[2]+4]; destPixel[7] = ARGB[permuteMap[3]+4]; destPixel += 8; @/textblock </pre> @return <pre> @textblock kvImageNoError Is returned when there was no error. kvImageUnknownFlagsBit Is returned when there is a unknown flag. kvImageRoiLargerThanInputBuffer Is returned when src.width < dest.width || src.height < dest.height @/textblock </pre> Note: Results are guaranteed to be faithfully rounded. C function: vImageConvert_422CbYpCrYp8ToARGB8888
func VImageConvert422CbYpCrYp16ToARGB16U ¶
func VImageConvert422CbYpCrYp16ToARGB16U(src *VImageBuffer, dest *VImageBuffer, info *VImageYpCbCrToARGB, permuteMap *uint8, alpha uint16, flags uint32) int
C function: vImageConvert_422CbYpCrYp16ToARGB16U
func VImageConvert422CbYpCrYp16ToARGB8888 ¶
func VImageConvert422CbYpCrYp16ToARGB8888(src *VImageBuffer, dest *VImageBuffer, info *VImageYpCbCrToARGB, permuteMap *uint8, alpha uint8, flags uint32) int
C function: vImageConvert_422CbYpCrYp16ToARGB8888
func VImageConvert422CrYpCbYpCbYpCbYpCrYpCrYp10ToARGB16Q12 ¶
func VImageConvert422CrYpCbYpCbYpCbYpCrYpCrYp10ToARGB16Q12(src *VImageBuffer, dest *VImageBuffer, info *VImageYpCbCrToARGB, permuteMap *uint8, alpha int16, flags uint32) int
C function: vImageConvert_422CrYpCbYpCbYpCbYpCrYpCrYp10ToARGB16Q12
func VImageConvert422CrYpCbYpCbYpCbYpCrYpCrYp10ToARGB8888 ¶
func VImageConvert422CrYpCbYpCbYpCbYpCrYpCrYp10ToARGB8888(src *VImageBuffer, dest *VImageBuffer, info *VImageYpCbCrToARGB, permuteMap *uint8, alpha uint8, flags uint32) int
C function: vImageConvert_422CrYpCbYpCbYpCbYpCrYpCrYp10ToARGB8888
func VImageConvert422YpCbYpCr8ToARGB8888 ¶
func VImageConvert422YpCbYpCr8ToARGB8888(src *VImageBuffer, dest *VImageBuffer, info *VImageYpCbCrToARGB, permuteMap *uint8, alpha uint8, flags uint32) int
C function: vImageConvert_422YpCbYpCr8ToARGB8888
func VImageConvert444AYpCbCr8ToARGB8888 ¶
func VImageConvert444AYpCbCr8ToARGB8888(src *VImageBuffer, dest *VImageBuffer, info *VImageYpCbCrToARGB, permuteMap *uint8, flags uint32) int
C function: vImageConvert_444AYpCbCr8ToARGB8888
func VImageConvert444AYpCbCr16ToARGB16U ¶
func VImageConvert444AYpCbCr16ToARGB16U(src *VImageBuffer, dest *VImageBuffer, info *VImageYpCbCrToARGB, permuteMap *uint8, flags uint32) int
C function: vImageConvert_444AYpCbCr16ToARGB16U
func VImageConvert444AYpCbCr16ToARGB8888 ¶
func VImageConvert444AYpCbCr16ToARGB8888(src *VImageBuffer, dest *VImageBuffer, info *VImageYpCbCrToARGB, permuteMap *uint8, flags uint32) int
C function: vImageConvert_444AYpCbCr16ToARGB8888
func VImageConvert444CbYpCrA8ToARGB8888 ¶
func VImageConvert444CbYpCrA8ToARGB8888(src *VImageBuffer, dest *VImageBuffer, info *VImageYpCbCrToARGB, permuteMap *uint8, flags uint32) int
C function: vImageConvert_444CbYpCrA8ToARGB8888
func VImageConvert444CrYpCb8ToARGB8888 ¶
func VImageConvert444CrYpCb8ToARGB8888(src *VImageBuffer, dest *VImageBuffer, info *VImageYpCbCrToARGB, permuteMap *uint8, alpha uint8, flags uint32) int
C function: vImageConvert_444CrYpCb8ToARGB8888
func VImageConvert444CrYpCb10ToARGB16Q12 ¶
func VImageConvert444CrYpCb10ToARGB16Q12(src *VImageBuffer, dest *VImageBuffer, info *VImageYpCbCrToARGB, permuteMap *uint8, alpha int16, flags uint32) int
C function: vImageConvert_444CrYpCb10ToARGB16Q12
func VImageConvert444CrYpCb10ToARGB8888 ¶
func VImageConvert444CrYpCb10ToARGB8888(src *VImageBuffer, dest *VImageBuffer, info *VImageYpCbCrToARGB, permuteMap *uint8, alpha uint8, flags uint32) int
C function: vImageConvert_444CrYpCb10ToARGB8888
func VImageConvertARGB16Q12To422CrYpCbYpCbYpCbYpCrYpCrYp10 ¶
func VImageConvertARGB16Q12To422CrYpCbYpCbYpCbYpCrYpCrYp10(src *VImageBuffer, dest *VImageBuffer, info *VImageARGBToYpCbCr, permuteMap *uint8, flags uint32) int
C function: vImageConvert_ARGB16Q12To422CrYpCbYpCbYpCbYpCrYpCrYp10
func VImageConvertARGB16Q12To444CrYpCb10 ¶
func VImageConvertARGB16Q12To444CrYpCb10(src *VImageBuffer, dest *VImageBuffer, info *VImageARGBToYpCbCr, permuteMap *uint8, flags uint32) int
C function: vImageConvert_ARGB16Q12To444CrYpCb10
func VImageConvertARGB16Q12ToARGB2101010 ¶
func VImageConvertARGB16Q12ToARGB2101010(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, rgb101010RangeMax int32, rgb101010Min int32, rgb101010Max int32, permuteMap *uint8, flags uint32) int
C function: vImageConvert_ARGB16Q12ToARGB2101010
func VImageConvertARGB16Q12ToRGBA1010102 ¶
func VImageConvertARGB16Q12ToRGBA1010102(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, rgb101010RangeMax int32, rgb101010Min int32, rgb101010Max int32, permuteMap *uint8, flags uint32) int
C function: vImageConvert_ARGB16Q12ToRGBA1010102
func VImageConvertARGB16Q12ToXRGB2101010 ¶
func VImageConvertARGB16Q12ToXRGB2101010(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, rgb101010RangeMax int32, rgb101010Min int32, rgb101010Max int32, permuteMap *uint8, flags uint32) int
@function vImageConvert_ARGB16Q12ToXRGB2101010 @abstract Convert ARGB16Q12 to XRGB2101010 format. @param src A pointer to vImage_Buffer that references 16Q12 ARGB interleaved source pixels. ARGB16Q12 pixels must be at least 2 byte aligned. @param dest A pointer to vImage_Buffer that references 10-bit RGB interleaved destination pixels. XRGB2101010 pixels must be at least 4 byte aligned. @param RGB101010RangeMax A maximum value for the range of 10-bit RGB pixel. @param RGB101010RangeMin A minimum value for the range of 10-bit RGB pixel. @param RGB101010Max A maximum value for 10-bit RGB pixel. @param RGB101010Min A minimum value for 10-bit RGB pixel. @param permuteMap Values that can be used to switch the channel order of dest. For example, permuteMap[4] = {0, 1, 2, 3} or NULL are ARGB16Q12. permuteMap[4] = {3, 2, 1, 0} is BGRA16Q12. Any order of permuteMap is allowed when each permuteMap value is 0, 1, 2, or 3, as long as each channel appears only once. @param flags \p kvImageDoNotTile Disables internal multithreading, if any. @discussion This format is 10-bit little endian 32-bit pixels. The 2 MSB are zero. RGB101010RangeMin & RGB101010RangeMax are available for non-full-range pixel values. For full-range pixel values, the user can set these as @code RGB101010RangeMin = 0; RGB101010RangeMax = 1023; @endcode This is needed because 16Q12 has a chance to be outside of [0.0, 1.0] range and we are converting those values into video-range. In that case, there will be some numbers outside of 10-bit video-range and we want those values to be representable as much as possible. The per-pixel operation is: @code int16_t *srcPixel = src.data; R16 = srcPixel[permuteMap[1]]; G16 = srcPixel[permuteMap[2]]; B16 = srcPixel[permuteMap[3]]; srcPixel += 4; int32_t R10, G10, B10; int32_t range10 = RGB101010RangeMax - RGB101010RangeMin; R10 = CLAMP(RGB101010Min, ((R16 * range10 + 2048) >> 12) + RGB101010RangeMin, RGB101010Max); G10 = CLAMP(RGB101010Min, ((G16 * range10 + 2048) >> 12) + RGB101010RangeMin, RGB101010Max); B10 = CLAMP(RGB101010Min, ((B16 * range10 + 2048) >> 12) + RGB101010RangeMin, RGB101010Max); A10 = CLAMP( 0, (A16 * 3 + 2048) >> 12), 3); uint32_t *destPixel = dest.data; destPixel[0] = (R10 << 20) | (G10 << 10) | (B10 << 0); destPixel += 1; @endcode @return \p kvImageNoError Is returned when there was no error. @return \p kvImageUnknownFlagsBit Is returned when there is a unknown flag. @return \p kvImageRoiLargerThanInputBuffer Is returned when src.width < dest.width || src.height < dest.height @return \p kvImageInvalidParameter Is returned when RGB101010RangeMin is bigger than RGB101010RangeMax or when RGB101010RangeMin < 0 || RGB101010RangeMax > 1023. @note Results are guaranteed to be faithfully rounded. @seealso vImageConvert_ARGB16Q12ToARGB2101010 C function: vImageConvert_ARGB16Q12ToXRGB2101010
func VImageConvertARGB16UTo422CbYpCrYp16 ¶
func VImageConvertARGB16UTo422CbYpCrYp16(src *VImageBuffer, dest *VImageBuffer, info *VImageARGBToYpCbCr, permuteMap *uint8, flags uint32) int
C function: vImageConvert_ARGB16UTo422CbYpCrYp16
func VImageConvertARGB16UTo444AYpCbCr16 ¶
func VImageConvertARGB16UTo444AYpCbCr16(src *VImageBuffer, dest *VImageBuffer, info *VImageARGBToYpCbCr, permuteMap *uint8, flags uint32) int
C function: vImageConvert_ARGB16UTo444AYpCbCr16
func VImageConvertARGB16UToARGB8888 ¶
func VImageConvertARGB16UToARGB8888(src *VImageBuffer, dest *VImageBuffer, permuteMap *uint8, copyMask uint8, backgroundColor *uint8, flags uint32) int
C function: vImageConvert_ARGB16UToARGB8888
func VImageConvertARGB16UToARGB2101010 ¶
func VImageConvertARGB16UToARGB2101010(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, rgb101010RangeMax int32, permuteMap *uint8, flags uint32) int
C function: vImageConvert_ARGB16UToARGB2101010
func VImageConvertARGB16UToRGBA1010102 ¶
func VImageConvertARGB16UToRGBA1010102(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, rgb101010RangeMax int32, permuteMap *uint8, flags uint32) int
C function: vImageConvert_ARGB16UToRGBA1010102
func VImageConvertARGB16UToXRGB2101010 ¶
func VImageConvertARGB16UToXRGB2101010(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, rgb101010RangeMax int32, permuteMap *uint8, flags uint32) int
@function vImageConvert_ARGB16UToXRGB2101010 @abstract Convert ARGB16U to XRGB2101010 format. @param src A pointer to vImage_Buffer that references 16-bit ARGB interleaved source pixels. @param dest A pointer to vImage_Buffer that references 10-bit RGB interleaved destination pixels. @param RGB101010RangeMax A maximum value for 10-bit RGB pixel. @param RGB101010RangeMin A minimum value for 10-bit RGB pixel. @param permuteMap Values that can be used to switch the channel order of dest. For example, permuteMap[4] = {0, 1, 2, 3} or NULL are ARGB16U. permuteMap[4] = {3, 2, 1, 0} is BGRA16U. Any order of permuteMap is allowed when each permuteMap value is 0, 1, 2, or 3, as long as each channel appears only once. @param flags \p kvImageDoNotTile Disables internal multithreading, if any. @discussion This format is 10-bit big endian 32-bit pixels. RGB101010RangeMin & RGB101010RangeMax are available for non-full-range pixel values. For full-range pixel values, the user can set these as @code RGB101010RangeMin = 0; RGB101010RangeMax = 1023; @endcode The per-pixel operation is: @code uint16_t *srcPixel = src.data; R16 = srcPixel[permuteMap[1]]; G16 = srcPixel[permuteMap[2]]; B16 = srcPixel[permuteMap[3]]; srcPixel += 4; int32_t R10, G10, B10; int32_t range10 = RGB101010RangeMax - RGB101010RangeMin; R10 = ((R16 * range10 + (USHRT_MAX >> 1)) / USHRT_MAX) + RGB101010RangeMin; G10 = ((G16 * range10 + (USHRT_MAX >> 1)) / USHRT_MAX) + RGB101010RangeMin; B10 = ((B16 * range10 + (USHRT_MAX >> 1)) / USHRT_MAX) + RGB101010RangeMin; uint32_t *destPixel = dest.data; destPixel[0] = (R10 << 20) | (G10 << 10) | (B10 << 0); destPixel += 1; @endcode @return \p kvImageNoError Is returned when there was no error. @return \p kvImageUnknownFlagsBit Is returned when there is a unknown flag. @return \p kvImageRoiLargerThanInputBuffer Is returned when src.width < dest.width || src.height < dest.height @return \p kvImageInvalidParameter Is returned when RGB101010RangeMin is bigger than RGB101010RangeMax or when RGB101010RangeMin < 0 || RGB101010RangeMax > 1023. @note Results are guaranteed to be faithfully rounded. @seealso vImageConvert_ARGB16UToARGB2101010 C function: vImageConvert_ARGB16UToXRGB2101010
func VImageConvertARGB16UtoARGB8888Dithered ¶
func VImageConvertARGB16UtoARGB8888Dithered(src *VImageBuffer, dest *VImageBuffer, dither int, permuteMap *uint8, flags uint32) int
C function: vImageConvert_ARGB16UtoARGB8888_dithered
func VImageConvertARGB16UtoPlanar16U ¶
func VImageConvertARGB16UtoPlanar16U(argbSrc *VImageBuffer, aDest *VImageBuffer, rDest *VImageBuffer, gDest *VImageBuffer, bDest *VImageBuffer, flags uint32) int
C function: vImageConvert_ARGB16UtoPlanar16U
func VImageConvertARGB16UtoRGB16U ¶
func VImageConvertARGB16UtoRGB16U(argbSrc *VImageBuffer, rgbDest *VImageBuffer, flags uint32) int
C function: vImageConvert_ARGB16UtoRGB16U
func VImageConvertARGB1555toARGB8888 ¶
func VImageConvertARGB1555toARGB8888(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageConvert_ARGB1555toARGB8888 @abstract Convert from 16 bit/pixel ARGB1555 to 32 bit/pixel ARGB8888 format. @discussion For each pixel x in src: @code Pixel8 alpha = 1bitAlphaChannel * 255; Pixel8 red = (5bitRedChannel * 255 + 15) / 31; Pixel8 green = (5bitGreenChannel * 255 + 15) / 31; Pixel8 blue = (5bitBlueChannel * 255 + 15) / 31; dest->data[x] = {alpha, red, green, blue}; @endcode @note This function will not work in place. @param src A pointer to a vImage_Buffer that references the ARGB source channels. @param dest A pointer to a vImage_Buffer that references the destination ARGB channels. @param flags \p kvImageDoNotTile Turns off internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageConvert_ARGB1555toARGB8888
func VImageConvertARGB1555toPlanar8 ¶
func VImageConvertARGB1555toPlanar8(src *VImageBuffer, destA *VImageBuffer, destR *VImageBuffer, destG *VImageBuffer, destB *VImageBuffer, flags uint32) int
@function vImageConvert_ARGB1555toPlanar8 @abstract Convert from 16 bit/pixel ARGB1555 to 8-bit/channel Planar8 format. @discussion For each pixel x in src->data: @code destA->data[x] = 1bitAlphaChannel * 255; destR->data[x] = (5bitRedChannel * 255 + 15) / 31; destG->data[x] = (5bitGreenChannel * 255 + 15) / 31; destB->data[x] = (5bitBlueChannel * 255 + 15) / 31; @endcode @note This function will not work in place. @param src A pointer to a vImage_Buffer that references the ARGB source channels. @param destA A pointer to a vImage_Buffer that references the destination planar 8-bit alpha channel. @param destR A pointer to a vImage_Buffer that references the destination planar 8-bit R channel. @param destG A pointer to a vImage_Buffer that references the destination planar 8-bit G channel. @param destB A pointer to a vImage_Buffer that references the destination planar 8-bit B channel. @param flags \p kvImageDoNotTile Turns off internal multithreading. @return kvImageNoError Success @return kvImageBufferSizeMismatch When the dimension of alpha / red / green / blue are not same. @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageConvert_ARGB1555toPlanar8
func VImageConvertARGB1555toRGB565 ¶
func VImageConvertARGB1555toRGB565(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageConvert_ARGB1555toRGB565 @abstract Convert from ARGB1555 to RGB565 image format @discussion Convert (with loss of alpha) from ARGB1555 to RGB565 format. If you need something fancier done with alpha first, such as unpremultiplication or flattening, convert to 8 bit per channel first. Both RGB565 and ARGB1555 are defined by vImage to be host-endian formats. On Intel and ARM and other little endian systems, these are little endian uint16_t's in memory. On a big endian system, these are big endian uint16_t's. @param src A pointer to a vImage_Buffer struct which describes a memory region full of ARGB1555 pixels @param dest A pointer to a vImage_Buffer struct which describes a preallocated memory region to be overwritten by RGB565 pixels @param flags The following flags are understood by this function: <pre> @textblock kvImageNoFlags Default operation. kvImageDoNotTile Turn internal multithreading off. This may be helpful in cases where you already have many such operations going concurrently, and in cases where it is desirable to keep CPU utilization to a single core. kvImageGetTempBufferSize Returns 0. Reads and writes no pixels. @/textblock </pre> @return <pre> @textblock kvImageNoError Success kvImageRoiLargerThanInputBuffer dest->height > src->height OR dest->width > src->width. There are not enough pixels to fill the destination buffer. @/textblock </pre> C function: vImageConvert_ARGB1555toRGB565
func VImageConvertARGB8888To420Yp8Cb8Cr8 ¶
func VImageConvertARGB8888To420Yp8Cb8Cr8(src *VImageBuffer, destYp *VImageBuffer, destCb *VImageBuffer, destCr *VImageBuffer, info *VImageARGBToYpCbCr, permuteMap *uint8, flags uint32) int
C function: vImageConvert_ARGB8888To420Yp8_Cb8_Cr8
func VImageConvertARGB8888To420Yp8CbCr8 ¶
func VImageConvertARGB8888To420Yp8CbCr8(src *VImageBuffer, destYp *VImageBuffer, destCbCr *VImageBuffer, info *VImageARGBToYpCbCr, permuteMap *uint8, flags uint32) int
C function: vImageConvert_ARGB8888To420Yp8_CbCr8
func VImageConvertARGB8888To422CbYpCrYp8 ¶
func VImageConvertARGB8888To422CbYpCrYp8(src *VImageBuffer, dest *VImageBuffer, info *VImageARGBToYpCbCr, permuteMap *uint8, flags uint32) int
C function: vImageConvert_ARGB8888To422CbYpCrYp8
func VImageConvertARGB8888To422CbYpCrYp8AA8 ¶
func VImageConvertARGB8888To422CbYpCrYp8AA8(src *VImageBuffer, dest *VImageBuffer, destA *VImageBuffer, info *VImageARGBToYpCbCr, permuteMap *uint8, flags uint32) int
C function: vImageConvert_ARGB8888To422CbYpCrYp8_AA8
func VImageConvertARGB8888To422CbYpCrYp16 ¶
func VImageConvertARGB8888To422CbYpCrYp16(src *VImageBuffer, dest *VImageBuffer, info *VImageARGBToYpCbCr, permuteMap *uint8, flags uint32) int
C function: vImageConvert_ARGB8888To422CbYpCrYp16
func VImageConvertARGB8888To422CrYpCbYpCbYpCbYpCrYpCrYp10 ¶
func VImageConvertARGB8888To422CrYpCbYpCbYpCbYpCrYpCrYp10(src *VImageBuffer, dest *VImageBuffer, info *VImageARGBToYpCbCr, permuteMap *uint8, flags uint32) int
C function: vImageConvert_ARGB8888To422CrYpCbYpCbYpCbYpCrYpCrYp10
func VImageConvertARGB8888To422YpCbYpCr8 ¶
func VImageConvertARGB8888To422YpCbYpCr8(src *VImageBuffer, dest *VImageBuffer, info *VImageARGBToYpCbCr, permuteMap *uint8, flags uint32) int
C function: vImageConvert_ARGB8888To422YpCbYpCr8
func VImageConvertARGB8888To444AYpCbCr8 ¶
func VImageConvertARGB8888To444AYpCbCr8(src *VImageBuffer, dest *VImageBuffer, info *VImageARGBToYpCbCr, permuteMap *uint8, flags uint32) int
C function: vImageConvert_ARGB8888To444AYpCbCr8
func VImageConvertARGB8888To444AYpCbCr16 ¶
func VImageConvertARGB8888To444AYpCbCr16(src *VImageBuffer, dest *VImageBuffer, info *VImageARGBToYpCbCr, permuteMap *uint8, flags uint32) int
C function: vImageConvert_ARGB8888To444AYpCbCr16
func VImageConvertARGB8888To444CbYpCrA8 ¶
func VImageConvertARGB8888To444CbYpCrA8(src *VImageBuffer, dest *VImageBuffer, info *VImageARGBToYpCbCr, permuteMap *uint8, flags uint32) int
C function: vImageConvert_ARGB8888To444CbYpCrA8
func VImageConvertARGB8888To444CrYpCb8 ¶
func VImageConvertARGB8888To444CrYpCb8(src *VImageBuffer, dest *VImageBuffer, info *VImageARGBToYpCbCr, permuteMap *uint8, flags uint32) int
C function: vImageConvert_ARGB8888To444CrYpCb8
func VImageConvertARGB8888To444CrYpCb10 ¶
func VImageConvertARGB8888To444CrYpCb10(src *VImageBuffer, dest *VImageBuffer, info *VImageARGBToYpCbCr, permuteMap *uint8, flags uint32) int
C function: vImageConvert_ARGB8888To444CrYpCb10
func VImageConvertARGB8888ToARGB16U ¶
func VImageConvertARGB8888ToARGB16U(src *VImageBuffer, dest *VImageBuffer, permuteMap *uint8, copyMask uint8, backgroundColor *uint16, flags uint32) int
C function: vImageConvert_ARGB8888ToARGB16U
func VImageConvertARGB8888ToARGB2101010 ¶
func VImageConvertARGB8888ToARGB2101010(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, rgb101010RangeMax int32, permuteMap *uint8, flags uint32) int
C function: vImageConvert_ARGB8888ToARGB2101010
func VImageConvertARGB8888ToRGB16U ¶
func VImageConvertARGB8888ToRGB16U(src *VImageBuffer, dest *VImageBuffer, permuteMap *uint8, copyMask uint8, backgroundColor *uint16, flags uint32) int
C function: vImageConvert_ARGB8888ToRGB16U
func VImageConvertARGB8888ToRGBA1010102 ¶
func VImageConvertARGB8888ToRGBA1010102(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, rgb101010RangeMax int32, permuteMap *uint8, flags uint32) int
@function vImageConvert_ARGB8888ToRGBA1010102 @abstract Convert ARGB8888 to RGBA1010102 format. @param src A pointer to vImage_Buffer that references 8-bit ARGB interleaved source pixels. Source pixels may have any alignment. @param dest A pointer to vImage_Buffer that references 10-bit RGB interleaved destination pixels. Destination pixels must be at least 4 byte aligned. @param RGB101010RangeMax A maximum value for 10-bit RGB pixel. @param RGB101010RangeMin A minimum value for 10-bit RGB pixel. @param permuteMap Values that can be used to switch the channel order of src. For exmaple, permuteMap[4] = {0, 1, 2, 3} or NULL are ARGB8888. permuteMap[4] = {3, 2, 1, 0} is BGRA8888. Any order of permuteMap is allowed when each permuteMap value is 0, 1, 2, or 3. @param flags \p kvImageDoNotTile Disables internal multithreading, if any. @discussion RGBA1010102 is almost the same format that is defined in CVPixelBuffer.h as 'kCVPixelFormatType_30RGB' except that this format uses the least significant 2 bits for alpha channel. This format is 10-bit big endian 32-bit pixels. RGB101010RangeMax & RGB101010RangeMin are available for non-full-range pixel values. For full-range pixel values, the user can set these as @code RGB101010RangeMax = 1023; RGB101010RangeMin = 0; @endcode The per-pixel operation is: @code uint8_t *srcPixel = src.data; A8 = srcPixel[permuteMap[0]]; R8 = srcPixel[permuteMap[1]]; G8 = srcPixel[permuteMap[2]]; B8 = srcPixel[permuteMap[3]]; srcPixel += 4; int32_t R10, G10, B10; int32_t range10 = RGB101010RangeMax - RGB101010RangeMin; int32_t rounding = UCHAR_MAX >> 1; R10 = ((R8 * range10 + rounding) / UCHAR_MAX) + RGB101010RangeMin; G10 = ((G8 * range10 + rounding) / UCHAR_MAX) + RGB101010RangeMin; B10 = ((B8 * range10 + rounding) / UCHAR_MAX) + RGB101010RangeMin; A10 = ((A10 * 3 + rounding) / UCHAR_MAX); uint32_t *destPixel = dest.data; destPixel[0] = htonl((R10 << 22) | (G10 << 12) | (B10 << 2) | A10); destPixel += 1; @endcode @return kvImageNoError Is returned when there was no error. @return kvImageUnknownFlagsBit Is returned when there is a unknown flag. @return kvImageRoiLargerThanInputBuffer Is returned when src.width < dest.width || src.height < dest.height @return kvImageInvalidParameter Is returned when RGB101010RangeMin is bigger than RGB101010RangeMax. @note Results are guaranteed to be faithfully rounded. C function: vImageConvert_ARGB8888ToRGBA1010102
func VImageConvertARGB8888ToXRGB2101010 ¶
func VImageConvertARGB8888ToXRGB2101010(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, rgb101010RangeMax int32, permuteMap *uint8, flags uint32) int
@function vImageConvert_ARGB8888ToXRGB2101010 @abstract Convert ARGB8888 to XRGB2101010 format. @param src A pointer to vImage_Buffer that references 8-bit ARGB interleaved source pixels. ARGB8888 pixels may have any alignment. @param dest A pointer to vImage_Buffer that references 10-bit RGB interleaved destination pixels. XRGB2101010 pixels must be at least 4 byte aligned. @param RGB101010RangeMax A maximum value for 10-bit RGB pixel. @param RGB101010RangeMin A minimum value for 10-bit RGB pixel. @param permuteMap Values that can be used to switch the channel order of src. For example, permuteMap[4] = {0, 1, 2, 3} or NULL are ARGB8888. permuteMap[4] = {3, 2, 1, 0} is BGRA8888. Any order of permuteMap is allowed when each permuteMap value is 0, 1, 2, or 3, as long as each channel appears only once. @param flags \p kvImageDoNotTile Disables internal multithreading, if any. @discussion This format is 10-bit little endian 32-bit pixels. The 2 MSB are zero. RGB101010RangeMin & RGB101010RangeMax are available for non-full-range pixel values. For full-range pixel values, the user can set these as @code RGB101010RangeMin = 0; RGB101010RangeMax = 1023; @endcode The per-pixel operation is: @code uint8_t *srcPixel = src.data; R8 = srcPixel[permuteMap[1]]; G8 = srcPixel[permuteMap[2]]; B8 = srcPixel[permuteMap[3]]; srcPixel += 4; int32_t R10, G10, B10; int32_t range10 = RGB101010RangeMax - RGB101010RangeMin; int32_t rounding = UCHAR_MAX >> 1; R10 = ((R8 * range10 + rounding) / UCHAR_MAX) + RGB101010RangeMin; G10 = ((G8 * range10 + rounding) / UCHAR_MAX) + RGB101010RangeMin; B10 = ((B8 * range10 + rounding) / UCHAR_MAX) + RGB101010RangeMin; uint32_t *destPixel = dest.data; destPixel[0] = (R10 << 20) | (G10 << 10) | (B10 << 0); destPixel += 1; @endcode @return \p kvImageNoError Is returned when there was no error. @return \p kvImageUnknownFlagsBit Is returned when there is a unknown flag. @return \p kvImageRoiLargerThanInputBuffer Is returned when src.width < dest.width || src.height < dest.height @return \p kvImageInvalidParameter Is returned when RGB101010RangeMin is bigger than RGB101010RangeMax or when RGB101010RangeMin < 0 || RGB101010RangeMax > 1023. @note Results are guaranteed to be faithfully rounded. @seealso vImageConvert_ARGB8888ToARGB2101010 C function: vImageConvert_ARGB8888ToXRGB2101010
func VImageConvertARGB8888toARGB1555 ¶
func VImageConvertARGB8888toARGB1555(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageConvert_ARGB8888toARGB1555 @abstract Convert between 32 bit/pixel ARGB8888 to 16 bit/pixel ARGB1555 format. @discussion For each pixel x in src: @code uint32_t alpha = (8bitAlphaChannel + 127) / 255; uint32_t red = (8bitRedChannel * 31 + 127) / 255; uint32_t green = (8bitGreenChannel * 31 + 127) / 255; uint32_t blue = (8bitBlueChannel * 31 + 127) / 255; dest->data[x] = (alpha << 15) | (red << 10) | (green << 5) | blue; @endcode @note This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data and buf->rowBytes >= dest->rowBytes. If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags. @param src A pointer to a vImage_Buffer that references the source channels. @param dest A pointer to a vImage_Buffer that references the destination channels. @param flags \p kvImageDoNotTile Turns off internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageConvert_ARGB8888toARGB1555
func VImageConvertARGB8888toARGB1555Dithered ¶
func VImageConvertARGB8888toARGB1555Dithered(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, dither int, flags uint32) int
@function vImageConvert_ARGB8888toARGB1555_dithered @abstract Convert between 32 bit/pixel ARGB8888 to 16 bit/pixel ARGB1555 format with dithering. @discussion Similar to vImageConvert_ARGB8888toARGB1555, except the result is dithered instead of round to nearest. This method should provide more accurate (overall) color reproduction and less banding in low-frequency regions of the image. @note This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data and buf->rowBytes >= dest->rowBytes. If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags. @param src A pointer to a vImage_Buffer that references the source channels. @param dest A pointer to a vImage_Buffer that references the destination channels. @param dither A dithering method which should be kvImageConvert_DitherOrdered or kvImageConvert_DitherOrderedReproducible. @param flags \p kvImageDoNotTile Turns off internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. @seealso vImageConvert_ARGB8888toARGB1555 C function: vImageConvert_ARGB8888toARGB1555_dithered
func VImageConvertARGB8888toPlanar8 ¶
func VImageConvertARGB8888toPlanar8(srcARGB *VImageBuffer, destA *VImageBuffer, destR *VImageBuffer, destG *VImageBuffer, destB *VImageBuffer, flags uint32) int
@function vImageConvert_ARGB8888toPlanar8 @abstract Deinterleave an ARGB8888 interleaved vImage_Buffer to form 4 planar 8-bit integer buffers. @discussion For each pixel in srcARGB, do the following: @code Pixel_8 destAResult = srcARGBPixel[0]; Pixel_8 destRResult = srcARGBPixel[1]; Pixel_8 destGResult = srcARGBPixel[2]; Pixel_8 destBResult = srcARGBPixel[3]; @endcode This function may be used to deinterleave other channel orderings such as RGBA8888 by passing in the planar8 images in the alternate order. @param srcARGB A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing ARGB source pixels. @param destA A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing A destination pixels. @param destR A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing R destination pixels. @param destG A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing G destination pixels. @param destB A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing B destination pixels. @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. @note Does not work in place. C function: vImageConvert_ARGB8888toPlanar8
func VImageConvertARGB8888toPlanar16Q12 ¶
func VImageConvertARGB8888toPlanar16Q12(src *VImageBuffer, alpha *VImageBuffer, red *VImageBuffer, green *VImageBuffer, blue *VImageBuffer, flags uint32) int
C function: vImageConvert_ARGB8888toPlanar16Q12
func VImageConvertARGB8888toPlanarF ¶
func VImageConvertARGB8888toPlanarF(src *VImageBuffer, alpha *VImageBuffer, red *VImageBuffer, green *VImageBuffer, blue *VImageBuffer, maxFloat *float32, minFloat *float32, flags uint32) int
@function vImageConvert_ARGB8888toPlanarF @abstract Convert a packed (interleaved) 4-channel 8-bit unsigned buffer to planar float buffers. @discussion For each pixel in src, do the following: @code float alpha = (maxFloat[0] - minFloat[0]) * (float) src[0] / 255.0 + minFloat[0]; float red = (maxFloat[1] - minFloat[1]) * (float) src[1] / 255.0 + minFloat[1]; float green = (maxFloat[2] - minFloat[2]) * (float) src[2] / 255.0 + minFloat[2]; float blue = (maxFloat[3] - minFloat[3]) * (float) src[3] / 255.0 + minFloat[3]; @endcode @note This routine will not work in place. @param src A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing source pixels. @param alpha A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing A destination pixels. @param red A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing R destination pixels. @param green A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing G destination pixels. @param blue A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing B destination pixels. @param maxFloat A maxFloat value in the above formula. @param minFloat A minFloat value in the above formula. @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageBufferSizeMismatch When the dimension of alpha / red / green / blue are not same. @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageConvert_ARGB8888toPlanarF
func VImageConvertARGB8888toRGB565 ¶
func VImageConvertARGB8888toRGB565(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageConvert_ARGB8888toRGB565
func VImageConvertARGB8888toRGB565Dithered ¶
func VImageConvertARGB8888toRGB565Dithered(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, dither int, flags uint32) int
C function: vImageConvert_ARGB8888toRGB565_dithered
func VImageConvertARGB8888toRGB888 ¶
func VImageConvertARGB8888toRGB888(arg *VImageBuffer, arg2 *VImageBuffer, arg3 uint32) int
C function: vImageConvert_ARGB8888toRGB888
func VImageConvertARGB2101010ToARGB16F ¶
func VImageConvertARGB2101010ToARGB16F(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, rgb101010RangeMax int32, permuteMap *uint8, flags uint32) int
C function: vImageConvert_ARGB2101010ToARGB16F
func VImageConvertARGB2101010ToARGB16Q12 ¶
func VImageConvertARGB2101010ToARGB16Q12(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, rgb101010RangeMax int32, permuteMap *uint8, flags uint32) int
C function: vImageConvert_ARGB2101010ToARGB16Q12
func VImageConvertARGB2101010ToARGB16U ¶
func VImageConvertARGB2101010ToARGB16U(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, rgb101010RangeMax int32, permuteMap *uint8, flags uint32) int
C function: vImageConvert_ARGB2101010ToARGB16U
func VImageConvertARGB2101010ToARGB8888 ¶
func VImageConvertARGB2101010ToARGB8888(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, rgb101010RangeMax int32, permuteMap *uint8, flags uint32) int
C function: vImageConvert_ARGB2101010ToARGB8888
func VImageConvertARGB2101010ToARGBFFFF ¶
func VImageConvertARGB2101010ToARGBFFFF(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, rgb101010RangeMax int32, permuteMap *uint8, flags uint32) int
C function: vImageConvert_ARGB2101010ToARGBFFFF
func VImageConvertARGBFFFFToARGB2101010 ¶
func VImageConvertARGBFFFFToARGB2101010(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, rgb101010RangeMax int32, permuteMap *uint8, flags uint32) int
C function: vImageConvert_ARGBFFFFToARGB2101010
func VImageConvertARGBFFFFToXRGB2101010 ¶
func VImageConvertARGBFFFFToXRGB2101010(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, rgb101010RangeMax int32, permuteMap *uint8, flags uint32) int
@function vImageConvert_ARGBFFFFToXRGB2101010 @abstract Convert ARGBFFFF to XRGB2101010 format. @param src A pointer to vImage_Buffer that references 32-bit float ARGB interleaved source pixels. @param dest A pointer to vImage_Buffer that references 10-bit RGB interleaved destination pixels. @param RGB101010RangeMax A maximum value for 10-bit RGB pixel. @param RGB101010RangeMin A minimum value for 10-bit RGB pixel. @param permuteMap Values that can be used to switch the channel order of source. For exmaple, permuteMap[4] = {0, 1, 2, 3} or NULL are ARGBFFFF. permuteMap[4] = {3, 2, 1, 0} is BGRAFFFF. Any order of permuteMap is allowed when each permuteMap value is 0, 1, 2, or 3, as long as each channel appears only once. @param flags \p kvImageDoNotTile Disables internal multithreading, if any. \p kvImageDoNotClamp Disables clamping floating point values to [0, 1]. @discussion This format is 10-bit little endian 32-bit pixels. The 2 MSB are zero. RGB101010RangeMin & RGB101010RangeMax are available for non-full-range pixel values. For full-range pixel values, the user can set these as @code RGB101010RangeMin = 0; RGB101010RangeMax = 1023; @endcode The per-pixel operation is: @code float *srcPixel = src.data; float AF, RF, GF, BF; AF = srcPixel[permuteMap[0]]; RF = srcPixel[permuteMap[1]]; GF = srcPixel[permuteMap[2]]; BF = srcPixel[permuteMap[3]]; srcPixel += 4; if (!(flags & kvImageDoNotClamp)) { RF = CLAMP(RF, 0.0f, 1.0f); GF = CLAMP(GF, 0.0f, 1.0f); BF = CLAMP(BF, 0.0f, 1.0f); } int32_t A2, R10, G10, B10; int32_t range10 = RGB101010RangeMax - RGB101010RangeMin; A2 = (int)(AF * 3.0f + 0.5f); R10 = (int)(RF * range10 + 0.5f) + RGB101010RangeMin; G10 = (int)(GF * range10 + 0.5f) + RGB101010RangeMin; B10 = (int)(BF * range10 + 0.5f) + RGB101010RangeMin; uint32_t *destPixel = dest.data; destPixel[0] = (A2 << 30) | (R10 << 20) | (G10 << 10) | (B10 << 0); destPixel += 1; @endcode @return \p kvImageNoError Is returned when there was no error. @return \p kvImageUnknownFlagsBit Is returned when there is a unknown flag. @return \p kvImageRoiLargerThanInputBuffer Is returned when src.width < dest.width || src.height < dest.height @return \p kvImageInvalidParameter Is returned when RGB101010RangeMin is bigger than RGB101010RangeMax or when RGB101010RangeMin < 0 || RGB101010RangeMax > 1023. @note Results are guaranteed to be faithfully rounded. @seealso vImageConvert_ARGBFFFFToARGB2101010 C function: vImageConvert_ARGBFFFFToXRGB2101010
func VImageConvertARGBFFFFtoARGB8888Dithered ¶
func VImageConvertARGBFFFFtoARGB8888Dithered(src *VImageBuffer, dest *VImageBuffer, maxFloat *float32, minFloat *float32, dither int, permuteMap *uint8, flags uint32) int
@function vImageConvert_ARGBFFFFtoARGB8888_dithered @abstract Convert an array of floating point data to 8 bit integer data with dithering. @discussion For each pixel, do the following: @code // convert to uint8_t Pixel_8888 temp; temp[0] = SATURATED_CLIP_0_to_255( 255.0f * ( srcPixel[0] - minFloat[0] ) / (maxFloat[0] - minFloat[0]) + random_float[0,1) ); temp[1] = SATURATED_CLIP_0_to_255( 255.0f * ( srcPixel[1] - minFloat[1] ) / (maxFloat[1] - minFloat[1]) + random_float[0,1) ); temp[2] = SATURATED_CLIP_0_to_255( 255.0f * ( srcPixel[2] - minFloat[2] ) / (maxFloat[2] - minFloat[2]) + random_float[0,1) ); temp[3] = SATURATED_CLIP_0_to_255( 255.0f * ( srcPixel[3] - minFloat[3] ) / (maxFloat[3] - minFloat[3]) + random_float[0,1) ); // place in requested output order Pixel_8888 result; result[0] = temp[permuteMap[0]]; result[1] = temp[permuteMap[1]]; result[2] = temp[permuteMap[2]]; result[3] = temp[permuteMap[3]]; @endcode The \p dither parameter must be one of the following flags: \p kvImageConvert_DitherNone Same as vImageConvert_PlanarFtoPlanar8(). Rounds to nearest. \p kvImageConvert_DitherOrdered Pre-computed blue noise is added to the image before rounding to the values in the destination format. The offset into this blue noise is randomized per-call to avoid visible artifacts if you do your own tiling or call the function on sequential frames of video. \p kvImageConvert_DitherOrderedReproducible Pre-computed blue noise is added to the image before rounding to the values in the destination format. The offset into the blue noise is the same for every call to allow users to get reproducible results. Fine for still images. For video kvImageConvert_DitherOrdered is a better choice. The ordered dither methods may be further influenced by shaping the distribution of the noise using the gaussian and uniform options below. These options are OR-ed with kvImageConvert_DitherOrdered / kvImageConvert_DitherOrderedReproducible: \p kvImageConvert_OrderedGaussianBlue When using an ordered dither pattern, distribute the noise according to a gaussian distribution. This generally gives more pleasing images -- less noisy and perhaps a little more saturated -- but color fidelity can suffer. Its effect is between kvImageConvert_DitherNone and kvImageConvert_DitherOrdered | kvImageConvert_DitherUniform. This is the default for kvImageConvert_DitherOrdered and kvImageConvert_DitherOrderedReproducible. \p kvImageConvert_OrderedUniformBlue When using an ordered dither pattern, distribute the noise uniformly. This generally gives best color fidelity, but the resulting image is noisier and more obviously dithered. This is usually the best choice when low bitdepth content is drawn next to high bitdepth content and in other circumstances where subtle changes to color arising from the conversion could be easily noticed. It may be a poor choice when the image is likely to be enlarged -- this would cause the noise to become more evident-- and for very flat / synthetic content with little inherent noise. The enlargement problem may be avoided by enlarging first at high bitdepth, then convert to lower bitdepth. @note "Blue" noise does not look blue, nor does it operate solely on the blue color channel. Blue noise is monochrome noise that is added to all color channels equally. The name arises from blue light, which has a higher frequency than other colors of visible light. Thus, blue noise is noise which is weighted heavily towards high frequencies. Low frequency noise tends to have visible shapes in it that would become apparent in an image if it was added in, so it is excluded from the dither pattern. @note This function will work for other channel orders, such as RGBA and BGRA. @note This function can work in place provided the following are true: If src overlaps with dest, src->data must be equal to dest->data and src->rowBytes >= dest->rowBytes If an overlapping src has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags @param src A pointer to a valid and initialized vImage_Buffer struct that points to a buffer containing the source pixels. @param dest A pointer to a valid and initialized vImage_Buffer struct that points to a allocated buffer to receive the result pixels. @param maxFloat The encoding for 1.0 in the src buffer, full intensity. Typically, this is 1.0 for floating-point data in the range[0,1] but if your data is [0,65535] then you would pass 65535.0f here. A separate value is provided for each of the three channels. @param minFloat The encoding for 0.0 in the src buffer, no light. Typically this is 0.0 for floating-point data in the range [0,1], but if your data is [-.5,0.5] then you would pass -0.5f here. A separate value is provided for each of the three channels. @param dither The type of random noise to use for the dither. See discussion for more details. @param permuteMap A 4 element array giving the order of the result channels. This allows you to convert a ARGB float buffer to a BGRA result buffer by providing the order {3,2,1,0}. @param flags The following flags are honored: \p kvImageNoFlags Default operation. \p kvImageDoNotTile Disable internal multithreading, if any. \p kvImageGetTempBufferSize Returns 0. Does no work. Does not touch data. @return \p kvImageNoError Success @return \p kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. @return \p kvImageUnknownFlagsBit Not all vImage flags are understood by this function. See description of flags parameter for supported flags. @return \p kvImageInvalidParameter An unknown / unsupported dithering mode was requested. @seealso vImageConvert_RGBFFFtoRGB888 @seealso vImagePermuteChannels_RGB888 C function: vImageConvert_ARGBFFFFtoARGB8888_dithered
func VImageConvertARGBFFFFtoPlanar8 ¶
func VImageConvertARGBFFFFtoPlanar8(src *VImageBuffer, alpha *VImageBuffer, red *VImageBuffer, green *VImageBuffer, blue *VImageBuffer, maxFloat *float32, minFloat *float32, flags uint32) int
@function vImageConvert_ARGBFFFFtoPlanar8 @abstract Convert a packed (interleaved) 4-channel floating point buffer to planar 8-bit unsigned integer buffers. @discussion For each pixel in src, do the following: @code uint8_t alpha = ROUND_TO_INTEGER( CLAMP(0, 255.0f * ( src[0] - minFloat[0], 255 ) / (maxFloat[0] - minFloat[0]) )); uint8_t red = ROUND_TO_INTEGER( CLAMP(0, 255.0f * ( src[1] - minFloat[1], 255 ) / (maxFloat[1] - minFloat[1]) )); uint8_t green = ROUND_TO_INTEGER( CLAMP(0, 255.0f * ( src[2] - minFloat[2], 255 ) / (maxFloat[2] - minFloat[2]) )); uint8_t blue = ROUND_TO_INTEGER( CLAMP(0, 255.0f * ( src[3] - minFloat[3], 255 ) / (maxFloat[3] - minFloat[3]) )); @endcode @note This routine will not work in place. @param src A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing source pixels. @param alpha A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing A destination pixels. @param red A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing R destination pixels. @param green A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing G destination pixels. @param blue A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing B destination pixels. @param maxFloat A maxFloat value in the above formula. @param minFloat A minFloat value in the above formula. @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageBufferSizeMismatch When the dimension of alpha / red / green / blue are not same. @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageConvert_ARGBFFFFtoPlanar8
func VImageConvertARGBFFFFtoPlanarF ¶
func VImageConvertARGBFFFFtoPlanarF(srcARGB *VImageBuffer, destA *VImageBuffer, destR *VImageBuffer, destG *VImageBuffer, destB *VImageBuffer, flags uint32) int
@function vImageConvert_ARGBFFFFtoPlanarF @abstract Deinterleave an ARGBFFFF interleaved vImage_Buffer to form 4 planar floating point buffers. @discussion For each pixel in srcARGB, do the following: @code Pixel_F destAResult = srcARGBPixel[0]; Pixel_F destRResult = srcARGBPixel[1]; Pixel_F destGResult = srcARGBPixel[2]; Pixel_F destBResult = srcARGBPixel[3]; @endcode This function may be used to deinterleave other channel orderings such as RGBAFFFF by passing in the planar8 images in the alternate order. @param srcARGB A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing ARGB source pixels. @param destA A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing A destination pixels. @param destR A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing R destination pixels. @param destG A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing G destination pixels. @param destB A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing B destination pixels. @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. @note Does not work in place. C function: vImageConvert_ARGBFFFFtoPlanarF
func VImageConvertARGBFFFFtoRGBFFF ¶
func VImageConvertARGBFFFFtoRGBFFF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageConvert_ARGBFFFFtoRGBFFF @abstract Convert 4-channel ARGB buffer to a 3-channel RGB one, by removing the alpha (1st) channel. @note This routine will work in place. @param src A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing source pixels. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageConvert_ARGBFFFFtoRGBFFF
func VImageConvertARGBToYpCbCrGenerateConversion ¶
func VImageConvertARGBToYpCbCrGenerateConversion(matrix *VImageARGBToYpCbCrMatrix, pixelRange *VImageYpCbCrPixelRange, outInfo *VImageARGBToYpCbCr, inARGBType accelerate.VImageARGBType, outYpCbCrType accelerate.VImageYpCbCrType, flags uint32) int
C function: vImageConvert_ARGBToYpCbCr_GenerateConversion
func VImageConvertAnyToAny ¶
func VImageConvertAnyToAny(converter unsafe.Pointer, srcs *VImageBuffer, dests *VImageBuffer, tempBuffer unsafe.Pointer, flags uint32) int
@function vImageConvert_AnyToAny @abstract Use a vImageConverterRef to convert the pixels in a vImage_Buffer to another format @discussion With an appropriately configured vImageConverter, convert the image channels found in srcs to the image channels found in dests. Whenever possible, conversion passes are vectorized and multithreaded to reduce the time and energy cost of the function. Please use vImageConverter_MustOperateOutOfPlace() to determine whether a particular conversion can operate in place. For an in-place conversion to work, it is required that srcs[i].data = dests[i].data and srcs[i].rowBytes = dests[i].rowBytes. All scanlines must start at an at least byte aligned address. (Some formats have 1, 2, 4 or 12 bits per channel/pixel and conceivably might not start at a byte aligned address.) A single byte may not span multiple rows of data. Some formats, particarly YUV 422 and 420 and those that have pixel size not evenly divisble by 8 bits, operate in chunks containing multiple pixels. For example, a Y'CbCr 422 chunk may have {Y0, Cb, Y1, Cr} in the chunk. The chunk contains two pixels, each with an independent Y (luminance) component, but shared chrominance. Even though the chunk width is two, it is still possible for an image to have a width that is not divisible by two. This means that some part of the chunk on the rightmost edge of the scanline must refer to a non-existant pixel. When reading incomplete chunks, vImage will only touch the unused parts of the chunk when it knows it to be safe to do so. When writing incomplete chunks, vImage will copy the rightmost valid pixel color into the unused part of the chunk. Thus, on reading the entire chunk doesn't have to be there, but on writing, it does. Conventions on this are varied among chunk using imaging pipelines and this conservative approach should interoperate with most. However, some care must be exercised when writing to chunk based formats (not to be confused with chunky formats which merely have several channels interleaved) to make sure that the buffer is large enough to tolerate the write policy. If you are tiling chunk based data, care must be taken not to run tile boundaries through the middle of a chunk. Chunks are assumed to be indivisible. @param converter A valid vImageConverterRef indicating what conversion to do. The same vImageConverterRef may be used concurrently from multiple threads. vImageConverterRefs may be created with vImageConverter_CreateWithCGImageFormat, vImageConverter_CreateWithColorSyncCodeFragment, vImageConverter_CreateForCGToCVImageFormat or vImageConverter_CreateForCVToCGImageFormat. May not be NULL. @param srcs a pointer to an array of vImage_Buffer structs that describe the color planes that make up the input image. Please see the description of the function that created the vImageConverter for the ordering and number of input buffers. The ordering can also be determined manually using vImageConverter_GetSourceBufferOrder. @param dests a pointer to an array of vImage_Buffer structs that describe the color planes that make up the result image. Please see the description of the function that created the vImageConverter for the ordering and number of output buffers. The ordering can also be determined manually using vImageConverter_GetSourceBufferOrder. The destination buffer may only alias the srcs buffers only if vImageConverter_MustOperateOutOfPlace() returns 0, and only if the respective scanlines of the aliasing buffers start at the same address. @param tempBuffer May be NULL. If not NULL, the memory pointed to by tempBuffer will be used as scratch space by the function. The size of the tempBuffer can be determined by passing kvImageGetTempBufferSize to the in the flags parameter. See below. If NULL is passed here and a tempBuffer is needed ' (temp buffer size > 0) then the function will allocate one on the heap and free it before returning. This may run more slowly, both because of the allocation cost and the cost of VM faults to zero fill pages as they are used. NULL is the right option when the function is used infrequently or convenience is valued. @param flags The following flags are allowed. Other flags will trigger an error. <pre>@textblock kvImagePrintDiagnosticsToConsole In the event of a problem, print out some helpful debug messages. kvImageGetTempBufferSize No image conversion work is done. The value returned out the left hand side of the function is the an error code if it is less than zero. Otherwise, it is the size of the tempBuffer to be passed into the function. The size may be 0. kvImageDoNotTile Disables internal multithreading. You may wish to pass this flag if you are doing your own threading and think it will conflict with vImage's attempts to do the same. kvImageNoFlags Default behavior. @/textblock </pre> @return The following error codes may be returned: <pre>@textblock kvImageNoError Success! 0 kvImageGetTempBufferSize was passed in flags, and no temp buffer is needed. >0 kvImageGetTempBufferSize was passed in flags. The value indicates the size of the temp buffer needed. kvImageMemoryAllocationError NULL was passed in tempBuffer and vImage failed to allocate its own temp buffer kvImageBufferSizeMismatch The source buffer(s) must be at least as large as the destination buffer(s) (src.height >= dest.height && src.width >= dest.width) kvImageUnknownFlagsBit A flag was passed to the vImageConverter creation function which is unrecognized or not appropriate to this function kvImageNullPointerArgument converter is NULL kvImageInvalidParameter One of the buffers pointed to by srcs or dests has a NULL vImage_Buffer.data pointer kvImageUnknownFlagsBit An unknown or unsupported flags bit was set. kvImageInvalidImageFormat if a byte ordering is specified (e.g. kCGBitmapByteOrder16Little), the buffer.rowBytes must be multiple of 2 (kCGBitmapByteOrder16Little, kCGBitmapByteOrder16Big) or 4 (kCGBitmapByteOrder32Little, kCGBitmapByteOrder32Big) @/textblock </pre> C function: vImageConvert_AnyToAny
func VImageConvertBGRA16UtoRGB16U ¶
func VImageConvertBGRA16UtoRGB16U(bgraSrc *VImageBuffer, rgbDest *VImageBuffer, flags uint32) int
C function: vImageConvert_BGRA16UtoRGB16U
func VImageConvertBGRA8888toRGB565 ¶
func VImageConvertBGRA8888toRGB565(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageConvert_BGRA8888toRGB565
func VImageConvertBGRA8888toRGB565Dithered ¶
func VImageConvertBGRA8888toRGB565Dithered(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, dither int, flags uint32) int
C function: vImageConvert_BGRA8888toRGB565_dithered
func VImageConvertBGRA8888toRGB888 ¶
func VImageConvertBGRA8888toRGB888(arg *VImageBuffer, arg2 *VImageBuffer, arg3 uint32) int
C function: vImageConvert_BGRA8888toRGB888
func VImageConvertBGRAFFFFtoRGBFFF ¶
func VImageConvertBGRAFFFFtoRGBFFF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageConvert_BGRAFFFFtoRGBFFF @abstract Convert 4-channel BGRA buffer to a 3-channel RGB one, by removing the alpha (last) channel and reordering the remaining.. @note This routine will work in place. @param src A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing source pixels. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageConvert_BGRAFFFFtoRGBFFF
func VImageConvertBGRX8888ToPlanar8 ¶
func VImageConvertBGRX8888ToPlanar8(src *VImageBuffer, blue *VImageBuffer, green *VImageBuffer, red *VImageBuffer, flags uint32) int
C function: vImageConvert_BGRX8888ToPlanar8
func VImageConvertBGRXFFFFToPlanarF ¶
func VImageConvertBGRXFFFFToPlanarF(src *VImageBuffer, blue *VImageBuffer, green *VImageBuffer, red *VImageBuffer, flags uint32) int
C function: vImageConvert_BGRXFFFFToPlanarF
func VImageConvertChunkyToPlanar8 ¶
func VImageConvertChunkyToPlanar8(srcChannels unsafe.Pointer, destPlanarBuffers *VImageBuffer, channelCount uint, srcStrideBytes uint, srcWidth uint, srcHeight uint, srcRowBytes uint, flags uint32) int
C function: vImageConvert_ChunkyToPlanar8
func VImageConvertChunkyToPlanarF ¶
func VImageConvertChunkyToPlanarF(srcChannels unsafe.Pointer, destPlanarBuffers *VImageBuffer, channelCount uint, srcStrideBytes uint, srcWidth uint, srcHeight uint, srcRowBytes uint, flags uint32) int
C function: vImageConvert_ChunkyToPlanarF
func VImageConvertFTo16S ¶
func VImageConvertFTo16S(src *VImageBuffer, dest *VImageBuffer, offset float32, scale float32, flags uint32) int
@function vImageConvert_FTo16S @abstract Convert a planar vImage_Buffer of floating point values to a buffer of 16 bit signed integers. @discussion For each floating point pixel in src, do the following: @code int16_t result = SATURATED_CLIP_SHRT_MIN_to_SHRT_MAX( (srcPixel - offset) / scale + 0.5f); @endcode Programmer's note: The scale and offset here are designed to be the same offset and scale used for the vImageConvert_16SToF conversion. For a lossless round trip (within the limits of floating point precision), use the same scale and offset values in both directions: vImageConvert_16SToF( int16_buffer, float_buffer, myOffset, myScale, kvImageNoFlags ); //Convert to float vImageConvert_FTo16S( float_buffer, int16_buffer, myOffset, myScale, kvImageNoFlags ); //Convert back to int16_t @note Works in place, as long as src->data == dest->data and src->rowBytes == dest->rowBytes. @note To convert multichannel interleaved floating point formats (e.g. ARGBFFFF) to a multichannel 16-bit image format with the same channel ordering, simply multiply the vImage_Buffer.width by the number of channels. @param src A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing source pixels. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param scale A scale value in the conversion. @param offset A offset value in the conversion. @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageConvert_FTo16S
func VImageConvertFTo16U ¶
func VImageConvertFTo16U(src *VImageBuffer, dest *VImageBuffer, offset float32, scale float32, flags uint32) int
@function vImageConvert_FTo16U @abstract Convert a planar vImage_Buffer of floating point values to a buffer of 16 bit unsigned integers. @discussion For each floating point pixel in src, do the following: @code uint16_t result = SATURATED_CLIP_0_to_USHRT_MAX( (srcPixel - offset) / scale + 0.5f); @endcode Programmer's note: The scale and offset here are designed to be the same offset and scale used for the vImageConvert_16UToF conversion. For a lossless round trip (within the limits of floating point precision), use the same scale and offset values in both directions: vImageConvert_16UToF( int16_buffer, float_buffer, myOffset, myScale, kvImageNoFlags ); //Convert to float vImageConvert_FTo16U( float_buffer, int16_buffer, myOffset, myScale, kvImageNoFlags ); //Convert back to uint16_t @param src A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing source pixels. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param scale A scale value in the conversion. @param offset A offset value in the conversion. @param flags \p kvImageNoFlags Default operation. \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success. @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. @note Works in place, as long as src->data == dest->data and src->rowBytes == dest->rowBytes. @note To convert multichannel interleaved floating point formats (e.g. ARGBFFFF) to a multichannel 16-bit image format with the same channel ordering, simply multiply the vImage_Buffer.width by the number of channels. C function: vImageConvert_FTo16U
func VImageConvertFto16Q12 ¶
func VImageConvertFto16Q12(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageConvert_Fto16Q12
func VImageConvertIndexed1toPlanar8 ¶
func VImageConvertIndexed1toPlanar8(src *VImageBuffer, dest *VImageBuffer, colors *uint8, flags uint32) int
C function: vImageConvert_Indexed1toPlanar8
func VImageConvertIndexed2toPlanar8 ¶
func VImageConvertIndexed2toPlanar8(src *VImageBuffer, dest *VImageBuffer, colors *uint8, flags uint32) int
C function: vImageConvert_Indexed2toPlanar8
func VImageConvertIndexed4toPlanar8 ¶
func VImageConvertIndexed4toPlanar8(src *VImageBuffer, dest *VImageBuffer, colors *uint8, flags uint32) int
C function: vImageConvert_Indexed4toPlanar8
func VImageConvertPlanar1toPlanar8 ¶
func VImageConvertPlanar1toPlanar8(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageConvert_Planar1toPlanar8
func VImageConvertPlanar2toPlanar8 ¶
func VImageConvertPlanar2toPlanar8(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageConvert_Planar2toPlanar8
func VImageConvertPlanar4toPlanar8 ¶
func VImageConvertPlanar4toPlanar8(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageConvert_Planar4toPlanar8
func VImageConvertPlanar8To16U ¶
func VImageConvertPlanar8To16U(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageConvert_Planar8To16U
func VImageConvertPlanar8ToARGBFFFF ¶
func VImageConvertPlanar8ToARGBFFFF(alpha *VImageBuffer, red *VImageBuffer, green *VImageBuffer, blue *VImageBuffer, dest *VImageBuffer, maxFloat *float32, minFloat *float32, flags uint32) int
C function: vImageConvert_Planar8ToARGBFFFF
func VImageConvertPlanar8ToBGRX8888 ¶
func VImageConvertPlanar8ToBGRX8888(blue *VImageBuffer, green *VImageBuffer, red *VImageBuffer, alpha uint8, dest *VImageBuffer, flags uint32) int
C function: vImageConvert_Planar8ToBGRX8888
func VImageConvertPlanar8ToBGRXFFFF ¶
func VImageConvertPlanar8ToBGRXFFFF(blue *VImageBuffer, green *VImageBuffer, red *VImageBuffer, alpha float32, dest *VImageBuffer, maxFloat *float32, minFloat *float32, flags uint32) int
C function: vImageConvert_Planar8ToBGRXFFFF
func VImageConvertPlanar8ToXRGB8888 ¶
func VImageConvertPlanar8ToXRGB8888(alpha uint8, red *VImageBuffer, green *VImageBuffer, blue *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageConvert_Planar8ToXRGB8888
func VImageConvertPlanar8ToXRGBFFFF ¶
func VImageConvertPlanar8ToXRGBFFFF(alpha float32, red *VImageBuffer, green *VImageBuffer, blue *VImageBuffer, dest *VImageBuffer, maxFloat *float32, minFloat *float32, flags uint32) int
C function: vImageConvert_Planar8ToXRGBFFFF
func VImageConvertPlanar8toARGB1555 ¶
func VImageConvertPlanar8toARGB1555(srcA *VImageBuffer, srcR *VImageBuffer, srcG *VImageBuffer, srcB *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageConvert_Planar8toARGB1555 @abstract Convert from 8-bit/channel Planar8 to 16 bit/pixel ARGB1555 format. @discussion For each pixel x: @code uint32_t alpha = (srcA->data[x] + 127) / 255; uint32_t red = (srcR->data[x] * 31 + 127) / 255; uint32_t green = (srcG->data[x] * 31 + 127) / 255; uint32_t blue = (srcB->data[x] * 31 + 127) / 255; dest->data[x] = (alpha << 15) | (red << 10) | (green << 5) | blue; @endcode @note This function will not work in place. @param srcA A pointer to a vImage_Buffer that references the 8-bit alpha source channel. @param srcR A pointer to a vImage_Buffer that references the 8-bit R source channel. @param srcG A pointer to a vImage_Buffer that references the 8-bit G source channel. @param srcB A pointer to a vImage_Buffer that references the 8-bit B source channel. @param dest A pointer to a vImage_Buffer that references the ARGB destination channels. @param flags \p kvImageDoNotTile Turns off internal multithreading. @return kvImageNoError Success @return kvImageBufferSizeMismatch When the dimension of alpha / red / green / blue are not same. @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageConvert_Planar8toARGB1555
func VImageConvertPlanar8toARGB8888 ¶
func VImageConvertPlanar8toARGB8888(srcA *VImageBuffer, srcR *VImageBuffer, srcG *VImageBuffer, srcB *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageConvert_Planar8toARGB8888 @abstract Interleave 4 planar 8 bit integer buffers to make an interleaved 4 channel ARGB8888 buffer. @discussion For each pixel in { srcA, srcR, srcG, srcB }, do the following: @code Pixel_88888 result = { pixelFromSrcA, pixelFromSrcR, pixelFromSrcG, pixelFromSrcB }; @endcode This function may be used to create other channel orderings such as RGBA8888 by passing in the planar8 images in the alternate order. @param srcA A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing A source pixels. @param srcR A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing R source pixels. @param srcG A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing G source pixels. @param srcB A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing B source pixels. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a allocated buffer to receive the result pixels. @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. @note Does not work in place. C function: vImageConvert_Planar8toARGB8888
func VImageConvertPlanar8toIndexed1 ¶
func VImageConvertPlanar8toIndexed1(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, colors *uint8, dither int, flags uint32) int
C function: vImageConvert_Planar8toIndexed1
func VImageConvertPlanar8toIndexed2 ¶
func VImageConvertPlanar8toIndexed2(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, colors *uint8, dither int, flags uint32) int
C function: vImageConvert_Planar8toIndexed2
func VImageConvertPlanar8toIndexed4 ¶
func VImageConvertPlanar8toIndexed4(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, colors *uint8, dither int, flags uint32) int
C function: vImageConvert_Planar8toIndexed4
func VImageConvertPlanar8toPlanar1 ¶
func VImageConvertPlanar8toPlanar1(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, dither int, flags uint32) int
C function: vImageConvert_Planar8toPlanar1
func VImageConvertPlanar8toPlanar2 ¶
func VImageConvertPlanar8toPlanar2(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, dither int, flags uint32) int
C function: vImageConvert_Planar8toPlanar2
func VImageConvertPlanar8toPlanar4 ¶
func VImageConvertPlanar8toPlanar4(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, dither int, flags uint32) int
C function: vImageConvert_Planar8toPlanar4
func VImageConvertPlanar8toPlanar16F ¶
func VImageConvertPlanar8toPlanar16F(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageConvert_Planar8toPlanar16F
func VImageConvertPlanar8toPlanarF ¶
func VImageConvertPlanar8toPlanarF(src *VImageBuffer, dest *VImageBuffer, maxFloat float32, minFloat float32, flags uint32) int
@function vImageConvert_Planar8toPlanarF @abstract Convert an array of 8 bit integer data to floating point data. @discussion For each pixel, do the following: @code float result = (maxFloat - minFloat) * (float) srcPixel / 255.0 + minFloat @endcode You can use this for ARGB8888 -> ARGBFFFF conversions by simply multiplying the width of the vImage_Buffer by 4 (for 4 channels) @param src A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing the source pixels. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a allocated buffer to receive the result pixels. @param maxFloat A maximum float value. @param minFloat A minimum float value. @param flags \p kvImageNoFlags Default operation. \p kvImageDoNotTile Disable internal multithreading. \p kvImagePrintDiagnosticsToConsole Directs the function to print diagnostic information to the console in the event of failure. @return kvImageNoError Success @return kvImageUnknownFlagsBit Not all vImage flags are understood by this function. See description of flags parameter for supported flags. @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. @note Does not work in place. C function: vImageConvert_Planar8toPlanarF
func VImageConvertPlanar8toRGB565 ¶
func VImageConvertPlanar8toRGB565(srcR *VImageBuffer, srcG *VImageBuffer, srcB *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageConvert_Planar8toRGB565
func VImageConvertPlanar8toRGB888 ¶
func VImageConvertPlanar8toRGB888(planarRed *VImageBuffer, planarGreen *VImageBuffer, planarBlue *VImageBuffer, rgbDest *VImageBuffer, flags uint32) int
C function: vImageConvert_Planar8toRGB888
func VImageConvertPlanar16FtoPlanar8 ¶
func VImageConvertPlanar16FtoPlanar8(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageConvert_Planar16FtoPlanar8
func VImageConvertPlanar16FtoPlanarF ¶
func VImageConvertPlanar16FtoPlanarF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageConvert_Planar16FtoPlanarF
func VImageConvertPlanar16Q12toARGB16F ¶
func VImageConvertPlanar16Q12toARGB16F(alpha *VImageBuffer, red *VImageBuffer, green *VImageBuffer, blue *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageConvert_Planar16Q12toARGB16F @abstract Convert and interleave 16Q12 (16-bit format with 12 fractional bits) to half-precision floating-point. @discussion Interleaves data from four source buffers while performing the format conversion. Source pixel values of 0 are mapped to 0, and source pixel values of (Pixel_16Q12) 4096 are mapped to (Pixel_16F) 1.0f. @note Does not work in place. @param alpha The alpha channel of the input image. @param red The red channel of the input image. @param green The green channel of the input image. @param blue The blue channel of the input image. @param dest A pointer to a preallocated vImage_Buffer to receive the resulting chunky image. @param flags \p kvImageDoNotTile Disables internal multithreading, if any. \p kvImageGetTempBufferSize Returns zero, as the routine does not use a temp buffer. @return kvImageNoError There was no error. @return kvImageBufferSizeMismatch The destination buffers do not have the same size as each other @return kvImageRoiLargerThanInputBuffer The destination buffers are larger than the source buffer. @return kvImageUnknownFlagsBit Unknown flag(s) provided. C function: vImageConvert_Planar16Q12toARGB16F
func VImageConvertPlanar16Q12toARGB8888 ¶
func VImageConvertPlanar16Q12toARGB8888(alpha *VImageBuffer, red *VImageBuffer, green *VImageBuffer, blue *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageConvert_Planar16Q12toARGB8888
func VImageConvertPlanar16Q12toRGB16F ¶
func VImageConvertPlanar16Q12toRGB16F(red *VImageBuffer, green *VImageBuffer, blue *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageConvert_16Q12toRGB16F @abstract Convert 16Q12 and interleave (16-bit format with 12 fractional bits) to half-precision floating-point. @discussion Interleaves data from three source buffers while performing the format conversion. Source pixel values of 0 are mapped to 0, and source pixel values of (Pixel_16Q12) 4096 are mapped to (Pixel_16F) 1.0f. @note Does not work in place. @param red The red channel of the input image. @param green The green channel of the input image. @param blue The blue channel of the input image. @param dest A pointer to a preallocated vImage_Buffer to receive the resulting chunky image. @param flags \p kvImageDoNotTile Disables internal multithreading, if any. \p kvImageGetTempBufferSize Returns zero, as the routine does not use a temp buffer. @return kvImageNoError There was no error. @return kvImageBufferSizeMismatch The destination buffers do not have the same size as each other @return kvImageRoiLargerThanInputBuffer The destination buffers are larger than the source buffer. @return kvImageUnknownFlagsBit Unknown flag(s) provided. C function: vImageConvert_Planar16Q12toRGB16F
func VImageConvertPlanar16Q12toRGB888 ¶
func VImageConvertPlanar16Q12toRGB888(red *VImageBuffer, green *VImageBuffer, blue *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageConvert_Planar16Q12toRGB888
func VImageConvertPlanar16UtoARGB16U ¶
func VImageConvertPlanar16UtoARGB16U(aSrc *VImageBuffer, rSrc *VImageBuffer, gSrc *VImageBuffer, bSrc *VImageBuffer, argbDest *VImageBuffer, flags uint32) int
C function: vImageConvert_Planar16UtoARGB16U
func VImageConvertPlanar16UtoPlanar8Dithered ¶
func VImageConvertPlanar16UtoPlanar8Dithered(src *VImageBuffer, dest *VImageBuffer, dither int, flags uint32) int
C function: vImageConvert_Planar16UtoPlanar8_dithered
func VImageConvertPlanar16UtoRGB16U ¶
func VImageConvertPlanar16UtoRGB16U(rSrc *VImageBuffer, gSrc *VImageBuffer, bSrc *VImageBuffer, rgbDest *VImageBuffer, flags uint32) int
C function: vImageConvert_Planar16UtoRGB16U
func VImageConvertPlanarFToARGB8888 ¶
func VImageConvertPlanarFToARGB8888(alpha *VImageBuffer, red *VImageBuffer, green *VImageBuffer, blue *VImageBuffer, dest *VImageBuffer, maxFloat *float32, minFloat *float32, flags uint32) int
C function: vImageConvert_PlanarFToARGB8888
func VImageConvertPlanarFToBGRX8888 ¶
func VImageConvertPlanarFToBGRX8888(blue *VImageBuffer, green *VImageBuffer, red *VImageBuffer, alpha uint8, dest *VImageBuffer, maxFloat *float32, minFloat *float32, flags uint32) int
C function: vImageConvert_PlanarFToBGRX8888
func VImageConvertPlanarFToBGRXFFFF ¶
func VImageConvertPlanarFToBGRXFFFF(blue *VImageBuffer, green *VImageBuffer, red *VImageBuffer, alpha float32, dest *VImageBuffer, flags uint32) int
C function: vImageConvert_PlanarFToBGRXFFFF
func VImageConvertPlanarFToXRGB8888 ¶
func VImageConvertPlanarFToXRGB8888(alpha uint8, red *VImageBuffer, green *VImageBuffer, blue *VImageBuffer, dest *VImageBuffer, maxFloat *float32, minFloat *float32, flags uint32) int
C function: vImageConvert_PlanarFToXRGB8888
func VImageConvertPlanarFToXRGBFFFF ¶
func VImageConvertPlanarFToXRGBFFFF(alpha float32, red *VImageBuffer, green *VImageBuffer, blue *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageConvert_PlanarFToXRGBFFFF
func VImageConvertPlanarFtoARGBFFFF ¶
func VImageConvertPlanarFtoARGBFFFF(srcA *VImageBuffer, srcR *VImageBuffer, srcG *VImageBuffer, srcB *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageConvert_PlanarFtoARGBFFFF @abstract Interleave 4 planar floating point buffers to make an interleaved 4 channel ARGBFFFF buffer. @discussion For each pixel in { srcA, srcR, srcG, srcB }, do the following: @code Pixel_FFFF result = { pixelFromSrcA, pixelFromSrcR, pixelFromSrcG, pixelFromSrcB }; @endcode This function may be used to create other channel orderings such as RGBAFFFF by passing in the planar8 images in the alternate order. @param srcA A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing A source pixels. @param srcR A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing R source pixels. @param srcG A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing G source pixels. @param srcB A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing B source pixels. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a allocated buffer to receive the result pixels. @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. @note Does not work in place. C function: vImageConvert_PlanarFtoARGBFFFF
func VImageConvertPlanarFtoPlanar8 ¶
func VImageConvertPlanarFtoPlanar8(src *VImageBuffer, dest *VImageBuffer, maxFloat float32, minFloat float32, flags uint32) int
@function vImageConvert_PlanarFtoPlanar8 @abstract Convert an array of floating point data to 8 bit integer data. @discussion For each pixel, do the following: @code uint8_t result = SATURATED_CLIP_0_to_255( 255.0f * ( srcPixel - minFloat ) / (maxFloat - minFloat) + 0.5f ); @endcode You can use this for ARGBFFFF -> ARGB8888 conversions by simply multiplying the width of the vImage_Buffer by 4 (for 4 channels) @param src A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing the source pixels. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a allocated buffer to receive the result pixels. @param maxFloat A maximum float value. @param minFloat A minimum float value. @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. You should use this if you are doing your own threading / tiling. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageConvert_PlanarFtoPlanar8
func VImageConvertPlanarFtoPlanar8Dithered ¶
func VImageConvertPlanarFtoPlanar8Dithered(src *VImageBuffer, dest *VImageBuffer, maxFloat float32, minFloat float32, dither int, flags uint32) int
@function vImageConvert_PlanarFtoPlanar8_dithered @abstract Convert an array of floating point data to 8 bit integer data with dithering. @discussion For each pixel, do the following: @code uint8_t result = SATURATED_CLIP_0_to_255( 255.0f * ( srcPixel - minFloat ) / (maxFloat - minFloat) + random_float[0,1) ); @endcode The \p dither parameter must be one of the following flags: \p kvImageConvert_DitherNone Same as vImageConvert_PlanarFtoPlanar8(). Rounds to nearest. \p kvImageConvert_DitherOrdered Pre-computed blue noise is added to the image before rounding to the values in the destination format. The offset into this blue noise is randomized per-call to avoid visible artifacts if you do your own tiling or call the function on sequential frames of video. \p kvImageConvert_DitherOrderedReproducible Pre-computed blue noise is added to the image before rounding to the values in the destination format. The offset into the blue noise is the same for every call to allow users to get reproducible results. Fine for still images. For video kvImageConvert_DitherOrdered is a better choice. The ordered dither methods may be further influenced by shaping the distribution of the noise using the gaussian and uniform options below. These options are OR-ed with kvImageConvert_DitherOrdered / kvImageConvert_DitherOrderedReproducible: \p kvImageConvert_OrderedGaussianBlue When using an ordered dither pattern, distribute the noise according to a gaussian distribution. This generally gives more pleasing images -- less noisy and perhaps a little more saturated -- but color fidelity can suffer. Its effect is between kvImageConvert_DitherNone and kvImageConvert_DitherOrdered | kvImageConvert_DitherUniform. This is the default for kvImageConvert_DitherOrdered and kvImageConvert_DitherOrderedReproducible. \p kvImageConvert_OrderedUniformBlue When using an ordered dither pattern, distribute the noise uniformly. This generally gives best color fidelity, but the resulting image is noisier and more obviously dithered. This is usually the best choice when low bitdepth content is drawn next to high bitdepth content and in other circumstances where subtle changes to color arising from the conversion could be easily noticed. It may be a poor choice when the image is likely to be enlarged -- this would cause the noise to become more evident-- and for very flat / synthetic content with little inherent noise. The enlargement problem may be avoided by enlarging first at high bitdepth, then convert to lower bitdepth. @note "Blue" noise does not look blue, nor does it operate solely on the blue color channel. Blue noise is monochrome noise that is added to all color channels equally. The name arises from blue light, which has a higher frequency than other colors of visible light. Thus, blue noise is noise which is weighted heavily towards high frequencies. Low frequency noise tends to have visible shapes in it that would become apparent in an image if it was added in, so it is excluded from the dither pattern. @warning Unlike vImageConvert_PlanarFtoPlanar8, vImageConvert_PlanarFtoPlanar8_dithered usually should not be used for multichannel data. Otherwise the dithering will occur in the chrominance dimensions and the noise will cause grain with varying hue. @note This function can work in place provided the following are true: If src overlaps with dest, src->data must be equal to dest->data and src->rowBytes >= dest->rowBytes. If an overlapping src has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags. @param src A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing the source pixels. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a allocated buffer to receive the result pixels. @param maxFloat The encoding for 1.0 in the src buffer, full intensity. Typically, this is 1.0 for floating-point data in the range[0,1] but if your data is [0,65535] then you would pass 65535.0f here. @param minFloat The encoding for 0.0 in the src buffer, no light. Typically this is 0.0 for floating-point data in the range [0,1], but if your data is [-.5,0.5] then you would pass -0.5f here. @param dither The type of random noise to use for the dither. See discussion for more details. @param flags The following flags are honored: \p kvImageNoFlags Default operation. \p kvImageDoNotTile Disable internal multithreading, if any. \p kvImageGetTempBufferSize Returns 0. Does no work. Does not touch data. @return \p kvImageNoError Success @return \p kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. @return \p kvImageUnknownFlagsBit Not all vImage flags are understood by this function. See description of flags parameter for supported flags. @return \p kvImageInvalidParameter An unknown / unsupported dithering mode was requested. @seealso vImageConvert_PlanarFtoPlanar8 C function: vImageConvert_PlanarFtoPlanar8_dithered
func VImageConvertPlanarFtoPlanar16F ¶
func VImageConvertPlanarFtoPlanar16F(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageConvert_PlanarFtoPlanar16F
func VImageConvertPlanarFtoRGBFFF ¶
func VImageConvertPlanarFtoRGBFFF(planarRed *VImageBuffer, planarGreen *VImageBuffer, planarBlue *VImageBuffer, rgbDest *VImageBuffer, flags uint32) int
C function: vImageConvert_PlanarFtoRGBFFF
func VImageConvertPlanarToChunky8 ¶
func VImageConvertPlanarToChunky8(srcPlanarBuffers *VImageBuffer, destChannels unsafe.Pointer, channelCount uint, destStrideBytes uint, destWidth uint, destHeight uint, destRowBytes uint, flags uint32) int
C function: vImageConvert_PlanarToChunky8
func VImageConvertPlanarToChunkyF ¶
func VImageConvertPlanarToChunkyF(srcPlanarBuffers *VImageBuffer, destChannels unsafe.Pointer, channelCount uint, destStrideBytes uint, destWidth uint, destHeight uint, destRowBytes uint, flags uint32) int
C function: vImageConvert_PlanarToChunkyF
func VImageConvertRGB16UToARGB8888 ¶
func VImageConvertRGB16UToARGB8888(src *VImageBuffer, dest *VImageBuffer, permuteMap *uint8, copyMask uint8, backgroundColor *uint8, flags uint32) int
C function: vImageConvert_RGB16UToARGB8888
func VImageConvertRGB16UtoARGB16U ¶
func VImageConvertRGB16UtoARGB16U(rgbSrc *VImageBuffer, aSrc *VImageBuffer, alpha uint16, argbDest *VImageBuffer, premultiply bool, flags uint32) int
C function: vImageConvert_RGB16UtoARGB16U
func VImageConvertRGB16UtoBGRA16U ¶
func VImageConvertRGB16UtoBGRA16U(rgbSrc *VImageBuffer, aSrc *VImageBuffer, alpha uint16, bgraDest *VImageBuffer, premultiply bool, flags uint32) int
C function: vImageConvert_RGB16UtoBGRA16U
func VImageConvertRGB16UtoPlanar16U ¶
func VImageConvertRGB16UtoPlanar16U(rgbSrc *VImageBuffer, rDest *VImageBuffer, gDest *VImageBuffer, bDest *VImageBuffer, flags uint32) int
C function: vImageConvert_RGB16UtoPlanar16U
func VImageConvertRGB16UtoRGB888Dithered ¶
func VImageConvertRGB16UtoRGB888Dithered(src *VImageBuffer, dest *VImageBuffer, dither int, flags uint32) int
C function: vImageConvert_RGB16UtoRGB888_dithered
func VImageConvertRGB16UtoRGBA16U ¶
func VImageConvertRGB16UtoRGBA16U(rgbSrc *VImageBuffer, aSrc *VImageBuffer, alpha uint16, rgbaDest *VImageBuffer, premultiply bool, flags uint32) int
C function: vImageConvert_RGB16UtoRGBA16U
func VImageConvertRGB565toARGB1555 ¶
func VImageConvertRGB565toARGB1555(src *VImageBuffer, dest *VImageBuffer, dither int, flags uint32) int
@function vImageConvert_RGB565toARGB1555 @abstract Convert from RGB565 to ARGB1555 image format @discussion Convert from RGB565 to ARGB1555 format. The new alpha is set to 1. Both RGB565 and ARGB1555 are defined by vImage to be host-endian formats. On Intel and ARM and other little endian systems, these are little endian uint16_t's in memory. On a big endian system, these are big endian uint16_t's. @param src A pointer to a vImage_Buffer struct which describes a memory region full of RGB565 pixels @param dest A pointer to a vImage_Buffer struct which describes a preallocated memory region to be overwritten by ARGB1555 pixels @param dither A dithering method for the green channel. Options: kvImageConvert_DitherNone - apply no dithering; input values are rounded to the nearest value representable in the destination format. kvImageConvert_DitherOrdered - pre-computed blue noise is added to the image before rounding to the values in the destination format. The offset into this blue noise is randomized per-call to avoid visible artifacts if you do your own tiling or call the function on sequential frames of video. kvImageConvert_DitherOrderedReproducible - pre-computed blue noise is added to the image before rounding to the values in the destination format. The offset into the blue noise is the same for every call to allow users to get reproducible results. The ordered dither methods may be further influenced by shaping the distribution of the noise using the gaussian and uniform options below. These options are OR-ed with kvImageConvert_DitherOrdered / kvImageCon- vert_DitherOrderedReproducible: kvImageConvert_OrderedGaussianBlue - when using an ordered dither pattern, distribute the noise according to a gaussian distribution. This generally gives more pleasing images -- less noisy and perhaps a little more saturated -- but color fidelity can suffer. Its effect is between kvImageConvert_DitherNone and kvImageConvert_DitherOrdered | kvImageConvert_DitherUniform. This is the default for kvImageConvert_DitherOrdered and kvImageConvert_DitherOrderedReproducible. kvImageConvert_OrderedUniformBlue - when using an ordered dither pattern, distribute the noise uniformly. This generally gives best color fidelity, but the resulting image is noisier and more obviously dithered. This is usually the best choice when low bitdepth content is drawn next to high bitdepth content and in other circumstances where subtle changes to color arising from the conversion could be easily noticed. It may be a poor choice when the image is likely to be enlarged -- this would cause the noise to become more evident-- and for very flat / synthetic content with little inherent noise. The enlargement problem may be avoided by enlarging first at high bitdepth, then convert to lower bitdepth. To clarify: "Blue" noise is not blue, nor does it operate solely on the blue color channel. Blue noise is monochrome noise that is added to all color channels equally. The name arises from blue light, which has a higher frequency than other colors of visible light. Thus, blue noise is noise which is weighted heavily towards high frequencies. Low frequency noise tends to have visible shapes in it that would become apparent in an image if it was added in, so it is excluded from the dither pattern. @param flags The following flags are understood by this function: <pre> @textblock kvImageNoFlags Default operation. kvImageDoNotTile Turn internal multithreading off. This may be helpful in cases where you already have many such operations going concurrently, and in cases where it is desirable to keep CPU utilization to a single core. kvImageGetTempBufferSize Returns 0. Reads and writes no pixels. @/textblock </pre> @return <pre> @textblock kvImageNoError Success kvImageRoiLargerThanInputBuffer dest->height > src->height OR dest->width > src->width. There are not enough pixels to fill the destination buffer. kvImageInvalidParameter Invalid / unknown dither value @/textblock </pre> C function: vImageConvert_RGB565toARGB1555
func VImageConvertRGB565toARGB8888 ¶
func VImageConvertRGB565toARGB8888(alpha uint8, src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageConvert_RGB565toARGB8888
func VImageConvertRGB565toBGRA8888 ¶
func VImageConvertRGB565toBGRA8888(alpha uint8, src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageConvert_RGB565toBGRA8888
func VImageConvertRGB565toPlanar8 ¶
func VImageConvertRGB565toPlanar8(src *VImageBuffer, destR *VImageBuffer, destG *VImageBuffer, destB *VImageBuffer, flags uint32) int
C function: vImageConvert_RGB565toPlanar8
func VImageConvertRGB565toRGB888 ¶
func VImageConvertRGB565toRGB888(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageConvert_RGB565toRGB888
func VImageConvertRGB565toRGBA5551 ¶
func VImageConvertRGB565toRGBA5551(src *VImageBuffer, dest *VImageBuffer, dither int, flags uint32) int
@function vImageConvert_RGB565toRGBA5551 @abstract Convert from RGB565 to RGBA5551 image format @discussion Convert from RGB565 to RGBA5551 format. The new alpha is set to 1. Both RGB565 and RGBA5551 are defined by vImage to be host-endian formats. On Intel and ARM and other little endian systems, these are little endian uint16_t's in memory. On a big endian system, these are big endian uint16_t's. @param src A pointer to a vImage_Buffer struct which describes a memory region full of RGB565 pixels @param dest A pointer to a vImage_Buffer struct which describes a preallocated memory region to be overwritten by RGBA5551 pixels @param dither A dithering method for the green channel. Options: kvImageConvert_DitherNone - apply no dithering; input values are rounded to the nearest value representable in the destination format. kvImageConvert_DitherOrdered - pre-computed blue noise is added to the image before rounding to the values in the destination format. The offset into this blue noise is randomized per-call to avoid visible artifacts if you do your own tiling or call the function on sequential frames of video. kvImageConvert_DitherOrderedReproducible - pre-computed blue noise is added to the image before rounding to the values in the destination format. The offset into the blue noise is the same for every call to allow users to get reproducible results. The ordered dither methods may be further influenced by shaping the distribution of the noise using the gaussian and uniform options below. These options are OR-ed with kvImageConvert_DitherOrdered / kvImageCon- vert_DitherOrderedReproducible: kvImageConvert_OrderedGaussianBlue - when using an ordered dither pattern, distribute the noise according to a gaussian distribution. This generally gives more pleasing images -- less noisy and perhaps a little more saturated -- but color fidelity can suffer. Its effect is between kvImageConvert_DitherNone and kvImageConvert_DitherOrdered | kvImageConvert_DitherUniform. This is the default for kvImageConvert_DitherOrdered and kvImageConvert_DitherOrderedReproducible. kvImageConvert_OrderedUniformBlue - when using an ordered dither pattern, distribute the noise uniformly. This generally gives best color fidelity, but the resulting image is noisier and more obviously dithered. This is usually the best choice when low bitdepth content is drawn next to high bitdepth content and in other circumstances where subtle changes to color arising from the conversion could be easily noticed. It may be a poor choice when the image is likely to be enlarged -- this would cause the noise to become more evident-- and for very flat / synthetic content with little inherent noise. The enlargement problem may be avoided by enlarging first at high bitdepth, then convert to lower bitdepth. To clarify: "Blue" noise is not blue, nor does it operate solely on the blue color channel. Blue noise is monochrome noise that is added to all color channels equally. The name arises from blue light, which has a higher frequency than other colors of visible light. Thus, blue noise is noise which is weighted heavily towards high frequencies. Low frequency noise tends to have visible shapes in it that would become apparent in an image if it was added in, so it is excluded from the dither pattern. @param flags The following flags are understood by this function: <pre> @textblock kvImageNoFlags Default operation. kvImageDoNotTile Turn internal multithreading off. This may be helpful in cases where you already have many such operations going concurrently, and in cases where it is desirable to keep CPU utilization to a single core. kvImageGetTempBufferSize Returns 0. Reads and writes no pixels. @/textblock </pre> @return <pre> @textblock kvImageNoError Success kvImageRoiLargerThanInputBuffer dest->height > src->height OR dest->width > src->width. There are not enough pixels to fill the destination buffer. kvImageInvalidParameter Invalid / unknown dither value @/textblock </pre> C function: vImageConvert_RGB565toRGBA5551
func VImageConvertRGB565toRGBA8888 ¶
func VImageConvertRGB565toRGBA8888(alpha uint8, src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageConvert_RGB565toRGBA8888
func VImageConvertRGB888toARGB8888 ¶
func VImageConvertRGB888toARGB8888(arg *VImageBuffer, arg2 *VImageBuffer, arg3 uint8, arg4 *VImageBuffer, arg5 bool, arg6 uint32) int
C function: vImageConvert_RGB888toARGB8888
func VImageConvertRGB888toBGRA8888 ¶
func VImageConvertRGB888toBGRA8888(arg *VImageBuffer, arg2 *VImageBuffer, arg3 uint8, arg4 *VImageBuffer, arg5 bool, arg6 uint32) int
C function: vImageConvert_RGB888toBGRA8888
func VImageConvertRGB888toPlanar8 ¶
func VImageConvertRGB888toPlanar8(rgbSrc *VImageBuffer, redDest *VImageBuffer, greenDest *VImageBuffer, blueDest *VImageBuffer, flags uint32) int
C function: vImageConvert_RGB888toPlanar8
func VImageConvertRGB888toPlanar16Q12 ¶
func VImageConvertRGB888toPlanar16Q12(src *VImageBuffer, red *VImageBuffer, green *VImageBuffer, blue *VImageBuffer, flags uint32) int
C function: vImageConvert_RGB888toPlanar16Q12
func VImageConvertRGB888toRGB565Dithered ¶
func VImageConvertRGB888toRGB565Dithered(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, dither int, flags uint32) int
C function: vImageConvert_RGB888toRGB565_dithered
func VImageConvertRGB888toRGBA8888 ¶
func VImageConvertRGB888toRGBA8888(arg *VImageBuffer, arg2 *VImageBuffer, arg3 uint8, arg4 *VImageBuffer, arg5 bool, arg6 uint32) int
C function: vImageConvert_RGB888toRGBA8888
func VImageConvertRGBA16UtoRGB16U ¶
func VImageConvertRGBA16UtoRGB16U(rgbaSrc *VImageBuffer, rgbDest *VImageBuffer, flags uint32) int
C function: vImageConvert_RGBA16UtoRGB16U
func VImageConvertRGBA5551toRGB565 ¶
func VImageConvertRGBA5551toRGB565(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageConvert_RGBA5551toRGB565 @abstract Convert from RGBA5551 to RGB565 image format @discussion Convert (with loss of alpha) from RGBA5551 to RGB565 format. If you need something fancier done with alpha first, such as unpremultiplication or flattening, convert to 8 bit per channel first. Both RGB565 and RGBA5551 are defined by vImage to be host-endian formats. On Intel and ARM and other little endian systems, these are little endian uint16_t's in memory. On a big endian system, these are big endian uint16_t's. @param src A pointer to a vImage_Buffer struct which describes a memory region full of RGBA5551 pixels @param dest A pointer to a vImage_Buffer struct which describes a preallocated memory region to be overwritten by RGB565 pixels @param flags The following flags are understood by this function: <pre> @textblock kvImageNoFlags Default operation. kvImageDoNotTile Turn internal multithreading off. This may be helpful in cases where you already have many such operations going concurrently, and in cases where it is desirable to keep CPU utilization to a single core. kvImageGetTempBufferSize Returns 0. Reads and writes no pixels. @/textblock </pre> @return <pre> @textblock kvImageNoError Success kvImageRoiLargerThanInputBuffer dest->height > src->height OR dest->width > src->width. There are not enough pixels to fill the destination buffer. @/textblock </pre> C function: vImageConvert_RGBA5551toRGB565
func VImageConvertRGBA5551toRGBA8888 ¶
func VImageConvertRGBA5551toRGBA8888(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageConvert_RGBA5551toRGBA8888 @abstract Convert from 16 bit/pixel RGBA5551 to 32 bit/pixel RGBA8888 format. @discussion For each pixel x in src: @code Pixel8 red = (5bitRedChannel * 255 + 15) / 31; Pixel8 green = (5bitGreenChannel * 255 + 15) / 31; Pixel8 blue = (5bitBlueChannel * 255 + 15) / 31; Pixel8 alpha = 1bitAlphaChannel * 255; dest->data[x] = {red, green, blue, alpha}; @endcode @note This function will not work in place. @param src A pointer to a vImage_Buffer that references the RGBA source channels. @param dest A pointer to a vImage_Buffer that references the destination RGBA channels. @param flags \p kvImageDoNotTile Turns off internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageConvert_RGBA5551toRGBA8888
func VImageConvertRGBA8888toRGB565 ¶
func VImageConvertRGBA8888toRGB565(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageConvert_RGBA8888toRGB565
func VImageConvertRGBA8888toRGB565Dithered ¶
func VImageConvertRGBA8888toRGB565Dithered(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, dither int, flags uint32) int
C function: vImageConvert_RGBA8888toRGB565_dithered
func VImageConvertRGBA8888toRGB888 ¶
func VImageConvertRGBA8888toRGB888(arg *VImageBuffer, arg2 *VImageBuffer, arg3 uint32) int
C function: vImageConvert_RGBA8888toRGB888
func VImageConvertRGBA8888toRGBA5551 ¶
func VImageConvertRGBA8888toRGBA5551(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageConvert_RGBA8888toRGBA5551 @abstract Convert between 32 bit/pixel RGBA8888 to 16 bit/pixel RGBA5551 format. @discussion For each pixel x in src: @code uint32_t red = (8bitRedChannel * 31 + 127) / 255; uint32_t green = (8bitGreenChannel * 31 + 127) / 255; uint32_t blue = (8bitBlueChannel * 31 + 127) / 255; uint32_t alpha = (8bitAlphaChannel + 127) / 255; dest->data[x] = (red << 11) | (green << 6) | (blue << 1) | alpha; @endcode @note This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data and buf->rowBytes >= dest->rowBytes. If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags. @param src A pointer to a vImage_Buffer that references the source channels. @param dest A pointer to a vImage_Buffer that references the destination channels. @param flags \p kvImageDoNotTile Turns off internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageConvert_RGBA8888toRGBA5551
func VImageConvertRGBA8888toRGBA5551Dithered ¶
func VImageConvertRGBA8888toRGBA5551Dithered(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, dither int, flags uint32) int
@function vImageConvert_RGBA8888toRGBA5551_dithered @abstract Convert between 32 bit/pixel RGBA8888 to 16 bit/pixel RGBA5551 format with dithering. @discussion Similar to vImageConvert_RGBA8888toRGBA5551, except the result is dithered instead of round to nearest. This method should provide more accurate (overall) color reproduction and less banding in low-frequency regions of the image. @note This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data and buf->rowBytes >= dest->rowBytes. If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags. @param src A pointer to a vImage_Buffer that references the source channels. @param dest A pointer to a vImage_Buffer that references the destination channels. @param dither A dithering method which should be kvImageConvert_DitherOrdered or kvImageConvert_DitherOrderedReproducible. @param flags \p kvImageDoNotTile Turns off internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageConvert_RGBA8888toRGBA5551_dithered
func VImageConvertRGBA1010102ToARGB16Q12 ¶
func VImageConvertRGBA1010102ToARGB16Q12(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, rgb101010RangeMax int32, permuteMap *uint8, flags uint32) int
C function: vImageConvert_RGBA1010102ToARGB16Q12
func VImageConvertRGBA1010102ToARGB16U ¶
func VImageConvertRGBA1010102ToARGB16U(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, rgb101010RangeMax int32, permuteMap *uint8, flags uint32) int
C function: vImageConvert_RGBA1010102ToARGB16U
func VImageConvertRGBA1010102ToARGB8888 ¶
func VImageConvertRGBA1010102ToARGB8888(src *VImageBuffer, dest *VImageBuffer, rgb101010RangeMin int32, rgb101010RangeMax int32, permuteMap *uint8, flags uint32) int
@function vImageConvert_RGBA1010102ToARGB8888 @abstract Convert RGBA1010102 to ARGB8888 format. @param src A pointer to vImage_Buffer that references 10-bit RGB interleaved source pixels. Source pixels must be at least 4 byte aligned. @param dest A pointer to vImage_Buffer that references 8-bit ARGB interleaved destination pixels. Destination pixels may have any alignment. @param RGB101010RangeMax A maximum value for 10-bit RGB pixel. @param RGB101010RangeMin A minimum value for 10-bit RGB pixel. @param permuteMap Values that can be used to switch the channel order of dest. For exmaple, permuteMap[4] = {0, 1, 2, 3} or NULL are ARGB8888. permuteMap[4] = {3, 2, 1, 0} is BGRA8888. Any order of permuteMap is allowed when each permuteMap value is 0, 1, 2, or 3. @param flags \p kvImageDoNotTile Disables internal multithreading, if any. @discussion RGBA1010102 is almost the same format that is defined in CVPixelBuffer.h as 'kCVPixelFormatType_30RGB' except that this format uses the least significant 2 bits for alpha channel. This format is 10-bit big endian 32-bit pixels. RGB101010RangeMax & RGB101010RangeMin are available for non-full-range pixel values. For full-range pixel values, the user can set these as @code RGB101010RangeMax = 1023; RGB101010RangeMin = 0; @endcode The per-pixel operation is: @code uint32_t *srcPixel = src.data; uint32_t pixel = ntohl(srcPixel[0]); srcPixel += 1; int32_t A2 = pixel & 0x3; int32_t R10 = (pixel >> 22) & 0x3ff; int32_t G10 = (pixel >> 12) & 0x3ff; int32_t B10 = (pixel >> 2) & 0x3ff; int32_t range10 = RGB101010RangeMax - RGB101010RangeMin; A2 = (A2 * UCHAR_MAX + 1) / 3; R10 = ((R10 - RGB101010RangeMin) * UCHAR_MAX + (range10 >> 1)) / range10; G10 = ((G10 - RGB101010RangeMin) * UCHAR_MAX + (range10 >> 1)) / range10; B10 = ((B10 - RGB101010RangeMin) * UCHAR_MAX + (range10 >> 1)) / range10; uint8_t R8, G8, B8; R8 = CLAMP(0, R10, UCHAR_MAX); G8 = CLAMP(0, G10, UCHAR_MAX); B8 = CLAMP(0, B10, UCHAR_MAX); uint8_t ARGB[4]; ARGB[0] = A2; ARGB[1] = R8; ARGB[2] = G8; ARGB[3] = B8; uint8_t *destPixel = dest.data; destPixel[0] = ARGB[permuteMap[0]]; destPixel[1] = ARGB[permuteMap[1]]; destPixel[2] = ARGB[permuteMap[2]]; destPixel[3] = ARGB[permuteMap[3]]; destPixel += 4; @endcode @return kvImageNoError Is returned when there was no error. @return kvImageUnknownFlagsBit Is returned when there is a unknown flag. @return kvImageRoiLargerThanInputBuffer Is returned when src.width < dest.width || src.height < dest.height @return kvImageInvalidParameter Is returned when RGB101010RangeMin is bigger than RGB101010RangeMax. @note Results are guaranteed to be faithfully rounded. C function: vImageConvert_RGBA1010102ToARGB8888
func VImageConvertRGBAFFFFtoRGBFFF ¶
func VImageConvertRGBAFFFFtoRGBFFF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageConvert_RGBAFFFFtoRGBFFF @abstract Convert 4-channel RGBA buffer to a 3-channel RGB one, by removing the alpha (last) channel. @note This routine will work in place. @param src A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing source pixels. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageConvert_RGBAFFFFtoRGBFFF
func VImageConvertRGBFFFtoARGBFFFF ¶
func VImageConvertRGBFFFtoARGBFFFF(arg *VImageBuffer, arg2 *VImageBuffer, arg3 float32, arg4 *VImageBuffer, arg5 bool, flags uint32) int
C function: vImageConvert_RGBFFFtoARGBFFFF
func VImageConvertRGBFFFtoBGRAFFFF ¶
func VImageConvertRGBFFFtoBGRAFFFF(arg *VImageBuffer, arg2 *VImageBuffer, arg3 float32, arg4 *VImageBuffer, arg5 bool, flags uint32) int
C function: vImageConvert_RGBFFFtoBGRAFFFF
func VImageConvertRGBFFFtoPlanarF ¶
func VImageConvertRGBFFFtoPlanarF(rgbSrc *VImageBuffer, redDest *VImageBuffer, greenDest *VImageBuffer, blueDest *VImageBuffer, flags uint32) int
C function: vImageConvert_RGBFFFtoPlanarF
func VImageConvertRGBFFFtoRGB888Dithered ¶
func VImageConvertRGBFFFtoRGB888Dithered(src *VImageBuffer, dest *VImageBuffer, maxFloat *float32, minFloat *float32, dither int, flags uint32) int
@function vImageConvert_RGBFFFtoRGB888_dithered @abstract Convert an array of floating point data to 8 bit integer data with dithering. @discussion For each pixel, do the following: @code // convert to uint8_t result[0] = SATURATED_CLIP_0_to_255( 255.0f * ( srcPixel[0] - minFloat[0] ) / (maxFloat[0] - minFloat[0]) + random_float[0,1) ); result[1] = SATURATED_CLIP_0_to_255( 255.0f * ( srcPixel[1] - minFloat[1] ) / (maxFloat[1] - minFloat[1]) + random_float[0,1) ); result[2] = SATURATED_CLIP_0_to_255( 255.0f * ( srcPixel[2] - minFloat[2] ) / (maxFloat[2] - minFloat[2]) + random_float[0,1) ); @endcode This function will work for other channel orders, such as BGR, and other colorspaces such as L*a*b*. If you need to change channel orders, please see vImagePermuteChannels_RGB888(). The \p dither parameter must be one of the following flags: \p kvImageConvert_DitherNone Same as vImageConvert_PlanarFtoPlanar8(). Rounds to nearest. \p kvImageConvert_DitherOrdered Pre-computed blue noise is added to the image before rounding to the values in the destination format. The offset into this blue noise is randomized per-call to avoid visible artifacts if you do your own tiling or call the function on sequential frames of video. \p kvImageConvert_DitherOrderedReproducible Pre-computed blue noise is added to the image before rounding to the values in the destination format. The offset into the blue noise is the same for every call to allow users to get reproducible results. Fine for still images. For video kvImageConvert_DitherOrdered is a better choice. The ordered dither methods may be further influenced by shaping the distribution of the noise using the gaussian and uniform options below. These options are OR-ed with kvImageConvert_DitherOrdered / kvImageConvert_DitherOrderedReproducible: \p kvImageConvert_OrderedGaussianBlue When using an ordered dither pattern, distribute the noise according to a gaussian distribution. This generally gives more pleasing images -- less noisy and perhaps a little more saturated -- but color fidelity can suffer. Its effect is between kvImageConvert_DitherNone and kvImageConvert_DitherOrdered | kvImageConvert_DitherUniform. This is the default for kvImageConvert_DitherOrdered and kvImageConvert_DitherOrderedReproducible. \p kvImageConvert_OrderedUniformBlue When using an ordered dither pattern, distribute the noise uniformly. This generally gives best color fidelity, but the resulting image is noisier and more obviously dithered. This is usually the best choice when low bitdepth content is drawn next to high bitdepth content and in other circumstances where subtle changes to color arising from the conversion could be easily noticed. It may be a poor choice when the image is likely to be enlarged -- this would cause the noise to become more evident-- and for very flat / synthetic content with little inherent noise. The enlargement problem may be avoided by enlarging first at high bitdepth, then convert to lower bitdepth. @note "Blue" noise does not look blue, nor does it operate solely on the blue color channel. Blue noise is monochrome noise that is added to all color channels equally. The name arises from blue light, which has a higher frequency than other colors of visible light. Thus, blue noise is noise which is weighted heavily towards high frequencies. Low frequency noise tends to have visible shapes in it that would become apparent in an image if it was added in, so it is excluded from the dither pattern. @note This function can work in place provided the following are true: If src overlaps with dest, src->data must be equal to dest->data and src->rowBytes >= dest->rowBytes. If an overlapping src has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags @param src A pointer to a valid and initialized vImage_Buffer struct that points to a buffer containing the source pixels. @param dest A pointer to a valid and initialized vImage_Buffer struct that points to a allocated buffer to receive the result pixels. @param maxFloat The encoding for 1.0 in the src buffer, full intensity. Typically, this is 1.0 for floating-point data in the range[0,1] but if your data is [0,65535] then you would pass 65535.0f here. A separate value is provided for each of the three channels. @param minFloat The encoding for 0.0 in the src buffer, no light. Typically this is 0.0 for floating-point data in the range [0,1], but if your data is [-.5,0.5] then you would pass -0.5f here. A separate value is provided for each of the three channels. @param dither The type of random noise to use for the dither. See discussion for more details. @param flags The following flags are honored: \p kvImageNoFlags Default operation. \p kvImageDoNotTile Disable internal multithreading, if any. \p kvImageGetTempBufferSize Returns 0. Does no work. Does not touch data. @return \p kvImageNoError Success @return \p kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. @return \p kvImageUnknownFlagsBit Not all vImage flags are understood by this function. See description of flags parameter for supported flags. @return \p kvImageInvalidParameter An unknown / unsupported dithering mode was requested. @seealso vImageConvert_RGBFFFtoRGB888 @seealso vImagePermuteChannels_RGB888 C function: vImageConvert_RGBFFFtoRGB888_dithered
func VImageConvertRGBFFFtoRGBAFFFF ¶
func VImageConvertRGBFFFtoRGBAFFFF(arg *VImageBuffer, arg2 *VImageBuffer, arg3 float32, arg4 *VImageBuffer, arg5 bool, flags uint32) int
C function: vImageConvert_RGBFFFtoRGBAFFFF
func VImageConvertXRGB8888ToPlanar8 ¶
func VImageConvertXRGB8888ToPlanar8(src *VImageBuffer, red *VImageBuffer, green *VImageBuffer, blue *VImageBuffer, flags uint32) int
C function: vImageConvert_XRGB8888ToPlanar8
func VImageConvertXRGB2101010ToARGB16F ¶
func VImageConvertXRGB2101010ToARGB16F(src *VImageBuffer, alpha float32, dest *VImageBuffer, rgb101010RangeMin int32, rgb101010RangeMax int32, permuteMap *uint8, flags uint32) int
@function vImageConvert_XRGB2101010ToARGB16F @abstract Convert XRGB2101010 to ARGB16F format. @param src A pointer to vImage_Buffer that references 10-bit RGB interleaved source pixels. @param dest A pointer to vImage_Buffer that references 16-bit float ARGB interleaved destination pixels. @param RGB101010RangeMax A maximum value for 10-bit RGB pixel. @param RGB101010RangeMin A minimum value for 10-bit RGB pixel. @param permuteMap Values that can be used to switch the channel order of dest. For example, permuteMap[4] = {0, 1, 2, 3} or NULL are ARGB16F. permuteMap[4] = {3, 2, 1, 0} is BGRA16F. Any order of permuteMap is allowed when each permuteMap value is 0, 1, 2, or 3, as long as each channel appears only once. @param flags \p kvImageDoNotTile Disables internal multithreading, if any. \p kvImageDoNotClamp Disables clamping floating point values to [0, 1]. @discussion XRGB2101010 is the same format that is defined in CVPixelBuffer.h as 'kCVPixelFormatType_30RGBLEPackedWideGamut' or 'w30r'. This format is 10-bit little endian 32-bit pixels. The 2 MSB are zero. RGB101010RangeMin & RGB101010RangeMax are available for non-full-range pixel values. For full-range pixel values, the user can set these as @code RGB101010RangeMin = 0; RGB101010RangeMax = 1023; @endcode The per-pixel operation is: @code uint32_t *srcPixel = src.data; uint32_t pixel = ntohl(srcPixel[0]); srcPixel += 1; int32_t R10 = (pixel >> 20) & 0x3ff; int32_t G10 = (pixel >> 10) & 0x3ff; int32_t B10 = (pixel >> 0) & 0x3ff; int32_t range10 = RGB101010RangeMax - RGB101010RangeMin; float RF, GF, BF; RF = (R10 - RGB101010RangeMin) / (float)range10; GF = (G10 - RGB101010RangeMin) / (float)range10; BF = (B10 - RGB101010RangeMin) / (float)range10; if (!(flags & kvImageDoNotClamp)) { RF = CLAMP(RF, 0.0f, 1.0f); GF = CLAMP(GF, 0.0f, 1.0f); BF = CLAMP(BF, 0.0f, 1.0f); } float ARGB[4]; ARGB[0] = alpha; ARGB[1] = RF; ARGB[2] = GF; ARGB[3] = BF; uint16_t *destPixel = dest.data; destPixel[0] = ConvertFloatToHalf(ARGB[permA]); destPixel[1] = ConvertFloatToHalf(ARGB[permR]); destPixel[2] = ConvertFloatToHalf(ARGB[permG]); destPixel[3] = ConvertFloatToHalf(ARGB[permB]); destPixel += 4; @endcode @return \p kvImageNoError Is returned when there was no error. @return \p kvImageUnknownFlagsBit Is returned when there is an unknown flag. @return \p kvImageRoiLargerThanInputBuffer Is returned when src.width < dest.width || src.height < dest.height. @return \p kvImageInvalidParameter Is returned when RGB101010RangeMin is bigger than RGB101010RangeMax or when RGB101010RangeMin < 0 || RGB101010RangeMax > 1023. @note Results are guaranteed to be faithfully rounded. @seealso vImageConvert_ARGB2101010ToARGB16F C function: vImageConvert_XRGB2101010ToARGB16F
func VImageConvertXRGB2101010ToARGB16Q12 ¶
func VImageConvertXRGB2101010ToARGB16Q12(src *VImageBuffer, alpha int16, dest *VImageBuffer, rgb101010RangeMin int32, rgb101010RangeMax int32, permuteMap *uint8, flags uint32) int
@function vImageConvert_XRGB2101010ToARGB16Q12 @abstract Convert XRGB2101010 to ARGB16Q12 format. @param src A pointer to vImage_Buffer that references 10-bit RGB interleaved source pixels. XRGB2101010 pixels must be at least 4 byte aligned. @param dest A pointer to vImage_Buffer that references 16Q12 ARGB interleaved destination pixels. ARGB16Q12 ixels must be at least 2 byte aligned. @param RGB101010RangeMax A maximum value for 10-bit RGB pixel. @param RGB101010RangeMin A minimum value for 10-bit RGB pixel. @param permuteMap Values that can be used to switch the channel order of dest. For example, permuteMap[4] = {0, 1, 2, 3} or NULL are ARGB16Q12. permuteMap[4] = {3, 2, 1, 0} is BGRA16Q12. Any order of permuteMap is allowed when each permuteMap value is 0, 1, 2, or 3, as long as each channel appears only once. @param flags \p kvImageDoNotTile Disables internal multithreading, if any. @discussion This format is 10-bit little endian 32-bit pixels. The 2 MSB are zero. RGB101010RangeMin & RGB101010RangeMax are available for non-full-range pixel values. For full-range pixel values, the user can set these as @code RGB101010RangeMin = 0; RGB101010RangeMax = 1023; @endcode The per-pixel operation is: @code uint32_t *srcPixel = src.data; srcPixel += 1; int32_t R10 = (pixel >> 20) & 0x3ff; int32_t G10 = (pixel >> 10) & 0x3ff; int32_t B10 = (pixel >> 0) & 0x3ff; int32_t range10 = RGB101010RangeMax - RGB101010RangeMin; int16_t R16, G16, B16; R16 = ((R10 - RGB101010RangeMin) * 4096 + (range10 >> 1)) / range10; G16 = ((G10 - RGB101010RangeMin) * 4096 + (range10 >> 1)) / range10; B16 = ((B10 - RGB101010RangeMin) * 4096 + (range10 >> 1)) / range10; R16 = CLAMP(INT16_MIN, R16, INT16_MAX); G16 = CLAMP(INT16_MIN, G16, INT16_MAX); B16 = CLAMP(INT16_MIN, B16, INT16_MAX); int16_t ARGB[4]; ARGB[0] = alpha; ARGB[1] = R16; ARGB[2] = G16; ARGB[3] = B16; int16_t *destPixel = dest.data; destPixel[0] = ARGB[permuteMap[0]]; destPixel[1] = ARGB[permuteMap[1]]; destPixel[2] = ARGB[permuteMap[2]]; destPixel[3] = ARGB[permuteMap[3]]; destPixel += 4; @endcode @return \p kvImageNoError Is returned when there was no error. @return \p kvImageUnknownFlagsBit Is returned when there is a unknown flag. @return \p kvImageRoiLargerThanInputBuffer Is returned when src.width < dest.width || src.height < dest.height @return \p kvImageInvalidParameter Is returned when RGB101010RangeMin is bigger than RGB101010RangeMax or when RGB101010RangeMin < 0 || RGB101010RangeMax > 1023. @note Results are guaranteed to be faithfully rounded. @seealso vImageConvert_ARGB2101010ToARGB16Q12 C function: vImageConvert_XRGB2101010ToARGB16Q12
func VImageConvertXRGB2101010ToARGB16U ¶
func VImageConvertXRGB2101010ToARGB16U(src *VImageBuffer, alpha uint16, dest *VImageBuffer, rgb101010RangeMin int32, rgb101010RangeMax int32, permuteMap *uint8, flags uint32) int
@function vImageConvert_XRGB2101010ToARGB16U @abstract Convert XRGB2101010 to ARGB16U format. @param src A pointer to vImage_Buffer that references 10-bit RGB interleaved source pixels. @param dest A pointer to vImage_Buffer that references 16-bit ARGB interleaved destination pixels. @param RGB101010RangeMax A maximum value for 10-bit RGB pixel. @param RGB101010RangeMin A minimum value for 10-bit RGB pixel. @param permuteMap Values that can be used to switch the channel order of dest. For example, permuteMap[4] = {0, 1, 2, 3} or NULL are ARGB16U. permuteMap[4] = {3, 2, 1, 0} is BGRA16U. Any order of permuteMap is allowed when each permuteMap value is 0, 1, 2, or 3, as long as each channel appears only once. @param flags @param flags \p kvImageDoNotTile Disables internal multithreading, if any. @discussion This format is 10-bit little endian 32-bit pixels. The 2 MSB are zero. RGB101010RangeMin & RGB101010RangeMax are available for non-full-range pixel values. For full-range pixel values, the user can set these as @code RGB101010RangeMin = 0; RGB101010RangeMax = 1023; @endcode The per-pixel operation is: @code uint32_t *srcPixel = src.data; uint32_t pixel = ntohl(srcPixel[0]); srcPixel += 1; int32_t R10 = (pixel >> 20) & 0x3ff; int32_t G10 = (pixel >> 10) & 0x3ff; int32_t B10 = (pixel >> 0) & 0x3ff; int32_t range10 = RGB101010RangeMax - RGB101010RangeMin; R10 = ((R10 - RGB101010RangeMin) * USHRT_MAX + (range10 >> 1)) / range10; G10 = ((G10 - RGB101010RangeMin) * USHRT_MAX + (range10 >> 1)) / range10; B10 = ((B10 - RGB101010RangeMin) * USHRT_MAX + (range10 >> 1)) / range10; uint16_t R16, G16, B16; R16 = CLAMP(0, R10, USHRT_MAX); G16 = CLAMP(0, G10, USHRT_MAX); B16 = CLAMP(0, B10, USHRT_MAX); uint16_t ARGB[4]; ARGB[0] = alpha; ARGB[1] = R16; ARGB[2] = G16; ARGB[3] = B16; uint16_t *destPixel = dest.data; destPixel[0] = ARGB[permuteMap[0]]; destPixel[1] = ARGB[permuteMap[1]]; destPixel[2] = ARGB[permuteMap[2]]; destPixel[3] = ARGB[permuteMap[3]]; destPixel += 4; @endcode @return \p kvImageNoError Is returned when there was no error. @return \p kvImageUnknownFlagsBit Is returned when there is a unknown flag. @return \p kvImageRoiLargerThanInputBuffer Is returned when src.width < dest.width || src.height < dest.height @return \p kvImageInvalidParameter Is returned when RGB101010RangeMin is bigger than RGB101010RangeMax or when RGB101010RangeMin < 0 || RGB101010RangeMax > 1023. @note Results are guaranteed to be faithfully rounded. @seealso vImageConvert_ARGB2101010ToARGB16U C function: vImageConvert_XRGB2101010ToARGB16U
func VImageConvertXRGB2101010ToARGB8888 ¶
func VImageConvertXRGB2101010ToARGB8888(src *VImageBuffer, alpha uint8, dest *VImageBuffer, rgb101010RangeMin int32, rgb101010RangeMax int32, permuteMap *uint8, flags uint32) int
@functiongroup XRGB2101010 @function vImageConvert_XRGB2101010ToARGB8888 @abstract Convert XRGB2101010 to ARGB8888 format. @param src A pointer to vImage_Buffer that references 10-bit RGB interleaved source pixels. XRGB2101010 pixels must be at least 4 byte aligned. @param dest A pointer to vImage_Buffer that references 8-bit ARGB interleaved destination pixels. ARGB8888 pixels may have any alignment. @param RGB101010RangeMax A maximum value for 10-bit RGB pixel. @param RGB101010RangeMin A minimum value for 10-bit RGB pixel. @param permuteMap Values that can be used to switch the channel order of dest. For example, permuteMap[4] = {0, 1, 2, 3} or NULL are ARGB8888. permuteMap[4] = {3, 2, 1, 0} is BGRA8888. Any order of permuteMap is allowed when each permuteMap value is 0, 1, 2, or 3, as long as each channel appears only once. @param flags <pre> @textblock kvImageDoNotTile Disables internal multithreading, if any. @/textblock <pre> @discussion This format is 10-bit little endian 32-bit pixels. The 2 MSB are zero. RGB101010RangeMin & RGB101010RangeMax are available for non-full-range pixel values. For full-range pixel values, the user can set these as @code RGB101010RangeMin = 0; RGB101010RangeMax = 1023; @endcode The per-pixel operation is: @code uint32_t *srcPixel = src.data; uint32_t pixel = srcPixel[0]; srcPixel += 1; int32_t R10 = (pixel >> 20) & 0x3ff; int32_t G10 = (pixel >> 10) & 0x3ff; int32_t B10 = (pixel >> 0) & 0x3ff; int32_t range10 = RGB101010RangeMax - RGB101010RangeMin; R10 = ((R10 - RGB101010RangeMin) * UCHAR_MAX + (range10 >> 1)) / range10; G10 = ((G10 - RGB101010RangeMin) * UCHAR_MAX + (range10 >> 1)) / range10; B10 = ((B10 - RGB101010RangeMin) * UCHAR_MAX + (range10 >> 1)) / range10; uint8_t R8, G8, B8; R8 = CLAMP(0, R10, UCHAR_MAX); G8 = CLAMP(0, G10, UCHAR_MAX); B8 = CLAMP(0, B10, UCHAR_MAX); uint8_t ARGB[4]; ARGB[0] = alpha; ARGB[1] = R8; ARGB[2] = G8; ARGB[3] = B8; uint8_t *destPixel = dest.data; destPixel[0] = ARGB[permuteMap[0]]; destPixel[1] = ARGB[permuteMap[1]]; destPixel[2] = ARGB[permuteMap[2]]; destPixel[3] = ARGB[permuteMap[3]]; destPixel += 4; @endcode @return \p kvImageNoError Is returned when there was no error. @return \p kvImageUnknownFlagsBit Is returned when there is a unknown flag. @return \p kvImageRoiLargerThanInputBuffer Is returned when src.width < dest.width || src.height < dest.height @return \p kvImageInvalidParameter Is returned when RGB101010RangeMin is bigger than RGB101010RangeMax or when RGB101010RangeMin < 0 || RGB101010RangeMax > 1023. @note Results are guaranteed to be faithfully rounded. @seealso vImageConvert_ARGB2101010ToARGB8888 C function: vImageConvert_XRGB2101010ToARGB8888
func VImageConvertXRGB2101010ToARGBFFFF ¶
func VImageConvertXRGB2101010ToARGBFFFF(src *VImageBuffer, alpha float32, dest *VImageBuffer, rgb101010RangeMin int32, rgb101010RangeMax int32, permuteMap *uint8, flags uint32) int
@function vImageConvert_XRGB2101010ToARGBFFFF @abstract Convert XRGB2101010 to ARGBFFFF format. @param src A pointer to vImage_Buffer that references 10-bit RGB interleaved source pixels. @param dest A pointer to vImage_Buffer that references 32-bit float ARGB interleaved destination pixels. @param RGB101010RangeMax A maximum value for 10-bit RGB pixel. @param RGB101010RangeMin A minimum value for 10-bit RGB pixel. @param permuteMap Values that can be used to switch the channel order of dest. For example, permuteMap[4] = {0, 1, 2, 3} or NULL are ARGBFFFF. permuteMap[4] = {3, 2, 1, 0} is BGRAFFFF. Any order of permuteMap is allowed when each permuteMap value is 0, 1, 2, or 3, as long as each channel appears only once. @param flags \p kvImageDoNotTile Disables internal multithreading, if any. \p kvImageDoNotClamp Disables clamping floating point values to [0, 1]. @discussion This format is 10-bit little endian 32-bit pixels. The 2 MSB are zero. RGB101010RangeMin & RGB101010RangeMax are available for non-full-range pixel values. For full-range pixel values, the user can set these as @code RGB101010RangeMin = 0; RGB101010RangeMax = 1023; @endcode The per-pixel operation is: @code uint32_t *srcPixel = src.data; uint32_t pixel = ntohl(srcPixel[0]); srcPixel += 1; int32_t R10 = (pixel >> 20) & 0x3ff; int32_t G10 = (pixel >> 10) & 0x3ff; int32_t B10 = (pixel >> 0) & 0x3ff; int32_t range10 = RGB101010RangeMax - RGB101010RangeMin; float RF, GF, BF; RF = (R10 - RGB101010RangeMin) / (float)range10; GF = (G10 - RGB101010RangeMin) / (float)range10; BF = (B10 - RGB101010RangeMin) / (float)range10; if (!(flags & kvImageDoNotClamp)) { RF = CLAMP(RF, 0.0f, 1.0f); GF = CLAMP(GF, 0.0f, 1.0f); BF = CLAMP(BF, 0.0f, 1.0f); } float ARGB[4]; ARGB[0] = alpha; ARGB[1] = RF; ARGB[2] = GF; ARGB[3] = BF; float *destPixel = dest.data; destRow[0] = ARGB[permuteMap[0]]; destRow[1] = ARGB[permuteMap[1]]; destRow[2] = ARGB[permuteMap[2]]; destRow[3] = ARGB[permuteMap[3]]; destPixel += 4; @endcode @return \p kvImageNoError Is returned when there was no error. @return \p kvImageUnknownFlagsBit Is returned when there is a unknown flag. @return \p kvImageRoiLargerThanInputBuffer Is returned when src.width < dest.width || src.height < dest.height @return \p kvImageInvalidParameter Is returned when RGB101010RangeMin is bigger than RGB101010RangeMax or when RGB101010RangeMin < 0 || RGB101010RangeMax > 1023. @note Results are guaranteed to be faithfully rounded. @seealso vImageConvert_ARGB2101010ToARGBFFFF C function: vImageConvert_XRGB2101010ToARGBFFFF
func VImageConvertXRGBFFFFToPlanarF ¶
func VImageConvertXRGBFFFFToPlanarF(src *VImageBuffer, red *VImageBuffer, green *VImageBuffer, blue *VImageBuffer, flags uint32) int
C function: vImageConvert_XRGBFFFFToPlanarF
func VImageConvertYpCbCrToARGBGenerateConversion ¶
func VImageConvertYpCbCrToARGBGenerateConversion(matrix *VImageYpCbCrToARGBMatrix, pixelRange *VImageYpCbCrPixelRange, outInfo *VImageYpCbCrToARGB, inYpCbCrType accelerate.VImageYpCbCrType, outARGBType accelerate.VImageARGBType, flags uint32) int
C function: vImageConvert_YpCbCrToARGB_GenerateConversion
func VImageConverterCreateForCGToCVImageFormat ¶
func VImageConverterCreateForCGToCVImageFormat(srcFormat *VImageCGImageFormat, destFormat unsafe.Pointer, backgroundColor *float64, flags uint32, error_ *int) unsafe.Pointer
C function: vImageConverter_CreateForCGToCVImageFormat
func VImageConverterCreateForCVToCGImageFormat ¶
func VImageConverterCreateForCVToCGImageFormat(srcFormat unsafe.Pointer, destFormat *VImageCGImageFormat, backgroundColor *float64, flags uint32, error_ *int) unsafe.Pointer
@function vImageConverter_CreateForCVToCGImageFormat @abstract Create a vImageConverterRef that converts a CoreVideo formatted image to a CoreGraphics formatted image @discussion This creates a vImageConverterRef which may be used with vImageConvert_AnyToAny to do conversions of CV image data, as described by a vImageCVImageFormatRef to CoreGraphics formatted image data, as described by a vImage_CGImageFormat. @param srcFormat The vImageCVImageFormatRef that describes the pixel format associated with the source image buffers. @param destFormat The vImage_CGImageFormat that describes the pixel format associated with the destination buffers. @param backgroundColor In cases where the source format has an alpha channel and the destination does not (or is kCGImageAlphaNoneSkipFirst/Last) the conversion will remove the alpha channel by flattening it against an opaque background color. The background color is given as CGFloat[3] {red, green, blue} (sRGB). @param flags The following flags are honored: <pre> @textblock kvImagePrintDiagnosticsToConsole cause extra information to be sent to Apple System Logger (Console) in case of failure kvImageHighQualityResampling In some cases, chroma may have to be up or downsampled as part of the conversion When this flag bit is set, it instructs the converter to spend extra time to achieve better image quality. kvImageDoNotTile Disable multithreading in the conversion step when this converter is used with vImageConvert_AnyToAny. @/textblock </pre> @param error An optional pointer to a vImage_Error in which the returned error code is written. Error be NULL, in which case no error value will be written. @result On success, a non-NULL vImageConverteRef will be returned, suitable for use with vImageConvert_AnyToAny(). If error is non-NULL, kvImageNoError will be written to *error, indicating success. You must release the vImageConverterRef when you are done with it, to return its resources to the system. It has a reference count of 1. On failure, a NULL vImageConverteRef will be returned. If error is non-NULL, an error code will be written to *error. Some possible error values: <pre> @textblock kvImageNoError Success. No error occurred. A non-NULL vImageConverterRef will be returned. kvImageInternalError Your usage was likely correct, but something appears to be very wrong inside vImage. Please file a bug, with a reproducible example of this failure. Please also try the kvImagePrintDiagnosticsToConsole flag for more information. kvImageInvalidImageFormat The vImage_CGImageFormat is invalid. kvImagePrintDiagnosticsToConsole may provide more information. kvImageInvalidCVImageFormat The vImageCVImageFormatRef is invalid. Probably, the vImageCVImageFormatRef is incomplete. This can happen when a vImageCVImageFormatRef is created from a CVPixelBufferRef and that itself has incomplete conversion information. Please see "vImageCVImageFormatRef Repair" above. kvImagePrintDiagnosticsToConsole may provide more information. kvImageCVImageFormat_ConversionMatrix The conversion matrix is missing from the vImageCVImageFormatRef. Please add one. kvImageCVImageFormat_ChromaSiting The chroma siting info is missing from the vImageCVImageFormatRef. Please add. kvImageCVImageFormat_ColorSpace The colorspace containing primaries and transfer function is missing from the vImageCVImageFormatRef. @/textblock </pre> @seealso vImageBuffer_InitForCopyFromCVPixelBuffer When converting from CVPixelBuffer types with vImageConvert_AnyToAny, the CV format sometimes contains multiple data planes which are in turn represented by multiple vImage_Buffers. @seealso vImageConverter_GetSourceBufferOrder for manual ordering information C function: vImageConverter_CreateForCVToCGImageFormat
func VImageConverterCreateWithCGColorConversionInfo ¶
func VImageConverterCreateWithCGColorConversionInfo(colorConversionInfoRef unsafe.Pointer, sFormat *VImageCGImageFormat, dFormat *VImageCGImageFormat, bg *float64, flags uint32, error_ *int) unsafe.Pointer
C function: vImageConverter_CreateWithCGColorConversionInfo
func VImageConverterCreateWithCGImageFormat ¶
func VImageConverterCreateWithCGImageFormat(srcFormat *VImageCGImageFormat, destFormat *VImageCGImageFormat, backgroundColor *float64, flags uint32, error_ *int) unsafe.Pointer
C function: vImageConverter_CreateWithCGImageFormat
func VImageConverterCreateWithColorSyncCodeFragment ¶
func VImageConverterCreateWithColorSyncCodeFragment(codeFragment unsafe.Pointer, srcFormat *VImageCGImageFormat, destFormat *VImageCGImageFormat, backgroundColor *float64, flags uint32, error_ *int) unsafe.Pointer
C function: vImageConverter_CreateWithColorSyncCodeFragment
func VImageConverterGetDestinationBufferOrder ¶
@function vImageConverter_GetDestinationBufferOrder @abstract Get a list of vImage_Buffer channel names specifying the order of planes @discussion These functions describe the identity of each buffer passed in the dests parameters of vImageConvert_AnyToAny, to allow you to order the buffers correctly. It is provided for informational purposes, to help wire up image processing pipelines to vImage that are not supported through more direct means, CGImages, CVPixelBuffers, the alternative handling of which is described at the end of this comment. Prior to OS X.10 and iOS 8.0, only CG Image formats are handled by vImageConvert_AnyToAny. Had these functions existed then, the result would always be {kvImageBufferTypeCode_CGFormat, kvImageBufferTypeCode_EndOfList} <pre>@textblock Simplified Common Cases ----------------------- CGImageRefs: CoreGraphics formats always come as a single buffer, with one or more channels. No buffer ordering is requred. The buffer order is always kvImageBufferTypeCode_CGFormat. Prior to OS X.10 and iOS 8.0, only converters to CG image formats are available, so where these functions are not available, the answer would have always been { kvImageBufferTypeCode_CGFormat, 0}. As a point of trivia, the ordering of the channels within a buffer is by convention as follows: number of channels = number of channels in colorspace + (alpha != kCGImageAlphaNone) alpha is either first or last, given by the alpha component of the CGBitmapInfo The ordering of the non-alpha channels is given by the colorspace, e.g. {R,G,B} for a RGB image. For 8-bit images, the ordering of the channels may be reversed according to kCGBitmapByteOrderLittleEndian32 or kCGBitmapByteOrderLittleEndian16, but the pixel size must match the endian swap chunk size. This gives you access to formats like BGRA8888. If the endian is default or big endian, then no swap occurs. CVPixelBufferRefs: Though these APIs will work for this purpose, it is expected to be simpler to use vImageBuffer_InitForCopyToCVPixelBuffer or vImageBuffer_InitForCopyFromCVPixelBuffer to set up a vImage_Buffer array for srcs and dests. Pass kvImageDoNotAllocate to have it automatically alias a locked CVPixelBuffer. The conversion will then copy the data right into or out of the CVPixelBuffer without further copying or modification. (It may still need to be copied out to the GPU, for example, however.) @/textblock</pre> @param converter The conversion for which you wish to know the ordering of source or result buffers. converter must be a valid vImageConverterRef. @return The function returns a kvImageBufferTypeCode_EndOfList terminated array of buffer type codes. The type codes indicate the order that the vImage_Buffers are passed in to vImageConvert_AnyToAny. The array is valid for the lifetime of the vImageConverterRef. It belongs to the vImageConverterRef and should not be freed by you. C function: vImageConverter_GetDestinationBufferOrder
func VImageConverterGetNumberOfDestinationBuffers ¶
@function vImageConverter_GetNumberOfDestinationBuffers @abstract Get the number of destination buffers written to by the converter. @discussion All formats discribed by a vImage_CGImageFormat just consume one vImage_Buffer and produce one vImage_Buffer. There are no multi-plane vImage_CGImageFormats. However, some video formats (see vImage/vImage_CVUtilities) have planar data formats with data in more than one plane. For such conversions, it may be necessary to know how many out buffers are overwritten by a converter. For older operating systems, where these functions are not available, the number of source and destination buffers is always 1. @param converter The conversion for which you wish to know the number of result buffers @return On success, the number of result buffers is returned. On failure, 0 is returned. C function: vImageConverter_GetNumberOfDestinationBuffers
func VImageConverterGetNumberOfSourceBuffers ¶
@function vImageConverter_GetNumberOfSourceBuffers @abstract Get the number of source buffers consumed by the converter. @discussion All formats discribed by a vImage_CGImageFormat just consume one vImage_Buffer and produce one vImage_Buffer. There are no multi-plane vImage_CGImageFormats. However, some video formats (see vImage/vImage_CVUtilities) have planar data formats with data in more than one plane. For such conversions, it may be necessary to know how many input buffers are consumed by a converter. For older operating systems, where these functions are not available, the number of source and destination buffers is always 1. @param converter The conversion for which you wish to know the number of source buffers @return On success, the number of source buffers is returned. On failure, 0 is returned. C function: vImageConverter_GetNumberOfSourceBuffers
func VImageConverterGetSourceBufferOrder ¶
@function vImageConverter_GetSourceBufferOrder @abstract Get a list of vImage_Buffer channel names specifying the order of planes @discussion These functions describe the identity of each buffer passed in the srcs parameters of vImageConvert_AnyToAny, to allow you to order the buffers correctly. It is provided for informational purposes, to help wire up image processing pipelines to vImage that are not supported through more direct means, CGImages, CVPixelBuffers, the alternative handling of which is described at the end of this comment. Prior to OS X.10 and iOS 8.0, only CG Image formats are handled by vImageConvert_AnyToAny. Had these functions existed then, the result would always be {kvImageBufferTypeCode_CGFormat, kvImageBufferTypeCode_EndOfList} <pre>@textblock Simplified Common Cases ----------------------- CGImageRefs: CoreGraphics formats always come as a single buffer, with one or more channels. No buffer ordering is requred. The buffer order is always kvImageBufferTypeCode_CGFormat. Prior to OS X.10 and iOS 8.0, only converters to CG image formats are available, so where these functions are not available, the answer would have always been { kvImageBufferTypeCode_CGFormat, 0}. As a point of trivia, the ordering of the channels within a buffer is by convention as follows: number of channels = number of channels in colorspace + (alpha != kCGImageAlphaNone) alpha is either first or last, given by the alpha component of the CGBitmapInfo The ordering of the non-alpha channels is given by the colorspace, e.g. {R,G,B} for a RGB image. For 8-bit images, the ordering of the channels may be reversed according to kCGBitmapByteOrderLittleEndian32 or kCGBitmapByteOrderLittleEndian16, but the pixel size must match the endian swap chunk size. This gives you access to formats like BGRA8888. If the endian is default or big endian, then no swap occurs. CVPixelBufferRefs: Though these APIs will work for this purpose, it is expected to be simpler to use vImageBuffer_InitForCopyToCVPixelBuffer or vImageBuffer_InitForCopyFromCVPixelBuffer to set up a vImage_Buffer array for srcs and dests. Pass kvImageDoNotAllocate to have it automatically alias a locked CVPixelBuffer. The conversion will then copy the data right into or out of the CVPixelBuffer without further copying or modification. (It may still need to be copied out to the GPU, for example, however.) @/textblock</pre> @param converter The conversion for which you wish to know the ordering of source or result buffers. converter must be a valid vImageConverterRef. @return The function returns a kvImageBufferTypeCode_EndOfList terminated array of buffer type codes. The type codes indicate the order that the vImage_Buffers are passed in to vImageConvert_AnyToAny. The array is valid for the lifetime of the vImageConverterRef. It belongs to the vImageConverterRef and should not be freed by you. C function: vImageConverter_GetSourceBufferOrder
func VImageConverterMustOperateOutOfPlace ¶
func VImageConverterMustOperateOutOfPlace(converter unsafe.Pointer, srcs *VImageBuffer, dests *VImageBuffer, flags uint32) int
@function vImageConverter_MustOperateOutOfPlace @abstract Determine whether a converter is capable of operating in place. @discussion Some conversions will work if the src and destination image buffer scanlines start at the same address. Others will not. In such cases, you need to allocate additional storage to hold the destination buffer. This function returns kvImageOutOfPlaceOperationRequired if the conversion requires out of place operation. <pre>@textblock In-place operation is considered to mean srcs[i].data = dests[i].data and srcs[i].rowBytes = dests[i].rowBytes. Other styles of partial buffer overlap produce undefined behavior. @/textblock </pre> The list of source and destination buffers is optional. Results are as follows: <pre>@textblock srcs = dests = NULL kvImageNoError if any conversion with this converter is guaranteed to work in place, provided that srcs[i].data = dests[i].data and srcs[i].rowBytes = dests[i].rowBytes. If there exists at least one combination of height and width for which in place operation is not possible with this converter, then kvImageOutOfPlaceOperationRequired will be returned. srcs != NULL, dests = NULL kvImageNullPointerArgument srcs = NULL, dests != NULL kvImageNullPointerArgument srcs != NULL, dests != NULL kvImageNoError if the conversion will successfully operate in place for this particular combination of heights, widths and rowBytes. In this case, vImage does not check to see if the buffers overlap. It presumes that srcs[i].data = dests[i].data. This is intended to allow you to defer allocation until later. If in place operation will not work, then kvImageOutOfPlaceOperationRequired is returned. @/textblock </pre> In no case during this function call does vImage examine the contents of the memory pointed to by srcs[i].data or dests[i].data. @param converter The converter to check @param srcs The list of source buffers you plan to use with vImageConvert_AnyToAny. May be NULL. @param dests The list of destination buffers you plan to use with vImageConvert_AnyToAny. May be NULL. @param flags The flags you plan to pass to vImageConvert_AnyToAny. <pre>@textblock Note: in the case of kvImagePrintDiagnosticsToConsole, the flag means print error information to the console for errors caught by vImageConverter_MustOperateOutOfPlace, not vImageConvert_AnyToAny. At times, vImageConverter_MustOperateOutOfPlace may fail because it detects an error condition that would cause vImageConvert_AnyToAny to fail. @/textblock </pre> @return Error Codes: <pre>@textblock kvImageNoError In-place operation will work kvImageNullPointerArgument The converter may not be NULL kvImageNullPointerArgument srcs and dests must either both be NULL or neither must be NULL. kvImageInvalidParameter The converter is invalid kvImageUnknownFlagsBit An unknown / unsupported flag was used kvImageOutOfPlaceOperationRequired vImageConvert_AnyToAny requires separate buffers be used for this operation @/textblock </pre> C function: vImageConverter_MustOperateOutOfPlace
func VImageConverterRelease ¶
@function vImageConverter_Release @abstract Release a vImageConverterRef @discussion If the retain count of a vImageConverterRef becomes zero, the memory allocated to the object is deallocated and the object is destroyed. If you create or explicitly retain (see the vImageConverter_Retain function) a vImageConverterRef, you are responsible for releasing it when you no longer need it (see Memory Management Programming Guide for Core Foundation). Like all of vImage, this interface is thread safe and may be called reentrantly. @param converter The vImageConverter to release. If NULL, then nothing happens. C function: vImageConverter_Release
func VImageConverterRetain ¶
@function vImageConverter_Retain @abstract Retain a vImageConverterRef @discussion You should retain a vImageConverterRef when you receive it from elsewhere (that is, you did not create or copy it) and you want it to persist. If you retain a vImageConverterRef you are responsible for releasing it (see Memory Management Programming Guide for Core Foundation). Like all of vImage, this interface is thread safe and may be called reentrantly. @param converter The vImageConverter to retain. If NULL, then nothing happens. C function: vImageConverter_Retain
func VImageConvolveARGB16F ¶
func VImageConvolveARGB16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernel *float32, kernelHeight uint32, kernelWidth uint32, backgroundColor *uint16, flags uint32) int
@function vImageConvolve_ARGB16F @abstract General convolution on a ARGB16F image of any channel order. @discussion This filter applies a convolution filter of your choosing to a ARGB16F image. This filter will work on any four-channel, half-float per component image format, not just ARGB. The kernel values are specified as 32-bit single-precision floats and the weighted average is also computed in single precision by default. However, if the flag kvImageUseFP16Accumulator is set all internal filtering operations will use 16-bit half-precision floating-point arithmetic when the CPU architecture supports it. This results in up to 2x performance improvements but at the expense of a less precise result; typically 2-3 bits of precision is lost. For each pixel: <pre>@textblock for each pixel[y][x] in image{ // Sums are declared as type _Float16 when the flag kvImageUseFP16Accumulator is set float sumA = 0; float sumR = 0; float sumG = 0; float sumB = 0; // Calculate weighted average over kernel area for each kernel_element[i][j] in kernel{ sumA += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2][0]; sumR += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2][1]; sumG += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2][2]; sumB += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2][3]; } // write out result result[y][x][0] = (_Float16)sumA; result[y][x][1] = (_Float16)sumR; result[y][x][2] = (_Float16)sumG; result[y][x][3] = (_Float16)sumB; } @/textblock </pre> (Above, we imagine the kernel to be a 2D array of size kernel_height by kernel_width. However, in practice it is passed in as a contiguous 1D array of size kernel_height * kernel_width.) This filter does not work in place. @param src The input image @param dest A pointer to a preallocated vImage_Buffer to receive the result image. This may not alias the src image. @param tempBuffer An optional pointer to a region of memory to use as a working area during computation. The size of the tempBuffer is given by calling the function with the same parameters and the kvImageGetTempBufferSize flag, in which case the size is returned instead of an error code from the left hand side. You may pass NULL here, in which case a region of memory of similar size will be allocated by the function and freed before it returns. Temp Buffers are a way of avoiding lost time due to VM faults to initialize newly allocated buffers. If you will be calling this function repeatedly with similar parameters you should use a temp buffer. If the function is called from different threads concurrently, a different temp buffer should be used for each. @param srcOffsetToROI_X An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the left edge of the image. @param srcOffsetToROI_Y An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the top edge of the image. @param kernel A pointer to a 1D array of weights of dimension kernel_height x kernel_width. For example, for a simple 3x3 blur, it might be: <pre>@textblock const float kernel[9] = { 1./16, 2./16, 1./16, 2./16, 4./16, 2./16, 1./16, 2./16, 1./16 }; @/textblock </pre> @param kernel_height The height of the 2D table of weights passed in as kernel. It must be an odd number. @param kernel_width The width of the 2D table of weights passed in as kernel. It must be an odd number. @param backgroundColor When the kvImageBackgroundColorFill edging mode is active, the backgroundColor parameter provides the background color to be used for missing pixels when the kernel extends off the edge of the image. @param flags The following flags are allowed: <pre>@textblock kvImageCopyInPlace If any pixels covered by the kernel do no not exist, simply copy the corresponding source pixel to the destination. This will result in a ring off unconvolved content at the edges and convolved content in the middle. kvImageBackgroundColorFill Substitute in the provided background color for missing pixels. For a blur filter this will look like the edges of the image have been blurred into a particular color. This is usually appropriate when the color of the surface onto which the image will be drawn is known. You can also use {Alpha = 0, color = 0} as a background color, and let the downstream image compositor blend in the background color. In this case, the result image should be treated as a premultiplied image. kvImageEdgeExtend Substitute in the nearest defined pixel for missing pixels. This is better when the image is drawn into a frame or other context where the background is not expected to contribute to the final content. kvImageTruncateKernel This is similar to kvImageEdgeExtend, except that edge pixels are simply ignored, and the bias and divisor are adjusted accordingly. Because of the complication at the edges, this edging mode can be significantly slower than the others. It can be numerically unstable if the sum over any rectangular subsection of the kernel is zero, which can result in division by zero during the computation. The results for this edging mode are usually quite visually similar to kvImageEdgeExtend. kvImageGetTempBufferSize Instead of calculating the convolution of the image, return the size of the temp buffer needed for this set of parameters. Does not touch the src or dest image. kvImageDoNotTile Disable internal multithreading. kvImageUseFP16Accumulator Enable 16-bit half-precision floating-point arithmetic when computing the kernel averages when the CPU architecture supports it. @/textblock </pre> The first four flags listed are edging modes. One and only one edging mode must be provided. If no edging mode is provided (e.g. kvImageNoFlags), then an error will be returned. @return One of the following error codes may be returned: <pre>@textblock kvImageNoError Success. >= 0 If kvImageGetTempBufferSize is passed, this is the size of the temp buffer to use with this function and this set of parameters. kvImageInvalidEdgeStyle One and only one of the following flags must be provided: { kvImageCopyInPlace, kvImageBackgroundColorFill, kvImageEdgeExtend, kvImageTruncateKernel } kvImageRoiLargerThanInputBuffer The dest->width and height must be less than or equal to corresponding dimensions of the source buffer. kvImageInvalidOffset_X The destination width + srcOffsetToROI_X > src->width kvImageInvalidOffset_Y The destination height + srcOffsetToROI_Y > src->height kvImageNullPointerArgument kernel may not be NULL kvImageMemoryAllocationError Could not allocate memory to serve as a temp buffer. kvImageInvalidKernelSize The kernel height and width must be odd numbers. @/textblock </pre> C function: vImageConvolve_ARGB16F
func VImageConvolveARGB8888 ¶
func VImageConvolveARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernel *int16, kernelHeight uint32, kernelWidth uint32, divisor int32, backgroundColor *uint8, flags uint32) int
@function vImageConvolve_ARGB8888 @abstract General convolution on a ARGB888 image of any channel order. @discussion This filter applies a convolution filter of your choosing to a ARGB8888 image. This filter will work on any four-channel, 8-bit per component image format, not just ARGB. For each pixel: <pre>@textblock for each pixel[y][x] in image{ int sumA = 0; int sumR = 0; int sumG = 0; int sumB = 0; // Calculate weighted average over kernel area for each kernel_element[i][j] in kernel{ sumA += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2][x+j+srcOffsetToROI_X- kernel_width/2][0]; sumR += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2][x+j+srcOffsetToROI_X- kernel_width/2][1]; sumG += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2][x+j+srcOffsetToROI_X- kernel_width/2][2]; sumB += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2][x+j+srcOffsetToROI_X- kernel_width/2][3]; } // Correct for the scaling introduced by multiplying by the weights table sumA = (sumA + divisor/2) / divisor; sumR = (sumR + divisor/2) / divisor; sumG = (sumG + divisor/2) / divisor; sumB = (sumB + divisor/2) / divisor; // write out result result[y][x][0] = CLAMP(sumA, 0, 255); result[y][x][1] = CLAMP(sumR, 0, 255); result[y][x][2] = CLAMP(sumG, 0, 255); result[y][x][3] = CLAMP(sumB, 0, 255); } @/textblock </pre> (Above, we imagine the kernel to be a 2D array of size kernel_height by kernel_width. However, in practice it is passed in as a contiguous 1D array of size kernel_height * kernel_width.) This filter does not work in place. @param src The input image @param dest A pointer to a preallocated vImage_Buffer to receive the result image. This may not alias the src image. @param tempBuffer An optional pointer to a region of memory to use as a working area during computation. The size of the tempBuffer is given by calling the function with the same parameters and the kvImageGetTempBufferSize flag, in which case the size is returned instead of an error code from the left hand side. You may pass NULL here, in which case a region of memory of similar size will be allocated by the function and freed before it returns. Temp Buffers are a way of avoiding lost time due to VM faults to initialize newly allocated buffers. If you will be calling this function repeatedly with similar parameters you should use a temp buffer. If the function is called from different threads concurrently, a different temp buffer should be used for each. @param srcOffsetToROI_X An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the left edge of the image. @param srcOffsetToROI_Y An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the top edge of the image. @param kernel A pointer to a 1D array of weights of dimension kernel_height x kernel_width. For example, for a simple 3x3 blur, it might be: <pre>@textblock const int16_t kernel[9] = { 1, 2, 1, 2, 4, 2, 1, 2, 1 }; @/textblock </pre> The kernel values may not sum in any combination to be outside the range [-2**23, 2**23), or modulo overflow in the accumulator may result. @param kernel_height The height of the 2D table of weights passed in as kernel. It must be an odd number. @param kernel_width The width of the 2D table of weights passed in as kernel. It must be an odd number. @param divisor The weighted sum of nearby pixels is typically a large number, which must be corrected to fit back into the image format of the destination image. The correction factor is passed in as divisor here, and is divided from the sum before the result is returned. Typically, the divisor is the sum over the area of the kernel. If the divisor is 0, 1 will be used instead. @param backgroundColor When the kvImageBackgroundColorFill edging mode is active, the backgroundColor parameter provides the background color to be used for missing pixels when the kernel extends off the edge of the image. @param flags The following flags are allowed: <pre>@textblock kvImageCopyInPlace If any pixels covered by the kernel do no not exist, simply copy the corresponding source pixel to the destination. This will result in a ring off unconvolved content at the edges and convolved content in the middle. kvImageBackgroundColorFill Substitute in the provided background color for missing pixels. For a blur filter this will look like the edges of the image have been blurred into a particular color. This is usually appropriate when the color of the surface onto which the image will be drawn is known. You can also use {Alpha = 0, color = 0} as a background color, and let the downstream image compositor blend in the background color. In this case, the result image should be treated as a premultiplied image. kvImageEdgeExtend Substitute in the nearest defined pixel for missing pixels. This is better when the image is drawn into a frame or other context where the background is not expected to contribute to the final content. kvImageTruncateKernel This is similar to kvImageEdgeExtend, except that edge pixels are simply ignored, and the bias and divisor are adjusted accordingly. Because of the complication at the edges, this edging mode can be significantly slower than the others. It can be numerically unstable if the sum over any rectangular subsection of the kernel is zero, which can result in division by zero during the computation. The results for this edging mode are usually quite visually similar to kvImageEdgeExtend. kvImageGetTempBufferSize Instead of calculating the convolution of the image, return the size of the temp buffer needed for this set of parameters. Does not touch the src or dest image. kvImageDoNotTile Disable internal multithreading. @/textblock </pre> The first four flags listed are edging modes. One and only one edging mode must be provided. If no edging mode is provided (e.g. kvImageNoFlags), then an error will be returned. @return One of the following error codes may be returned: <pre>@textblock kvImageNoError Success. >= 0 If kvImageGetTempBufferSize is passed, this is the size of the temp buffer to use with this function and this set of parameters. kvImageInvalidEdgeStyle One and only one of the following flags must be provided: { kvImageCopyInPlace, kvImageBackgroundColorFill, kvImageEdgeExtend, kvImageTruncateKernel } kvImageRoiLargerThanInputBuffer The dest->width and height must be less than or equal to corresponding dimensions of the source buffer. kvImageInvalidOffset_X The destination width + srcOffsetToROI_X > src->width kvImageInvalidOffset_Y The destination height + srcOffsetToROI_Y > src->height kvImageNullPointerArgument kernel may not be NULL kvImageMemoryAllocationError Could not allocate memory to serve as a temp buffer. kvImageInvalidKernelSize The kernel height and width must be odd numbers. @/textblock </pre> C function: vImageConvolve_ARGB8888
func VImageConvolveARGBFFFF ¶
func VImageConvolveARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernel *float32, kernelHeight uint32, kernelWidth uint32, backgroundColor *float32, flags uint32) int
@function vImageConvolve_ARGBFFFF @abstract General convolution on a ARGBFFFF image of any channel order. @discussion This filter applies a convolution filter of your choosing to a ARGBFFFF image. This filter will work on any four-channel, float per component image format, not just ARGB. For each pixel: <pre>@textblock for each pixel[y][x] in image{ float sumA = 0; float sumR = 0; float sumG = 0; float sumB = 0; // Calculate weighted average over kernel area for each kernel_element[i][j] in kernel{ sumA += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2][0]; sumR += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2][1]; sumG += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2][2]; sumB += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2][3]; } // write out result result[y][x][0] = sumA; result[y][x][1] = sumR; result[y][x][2] = sumG; result[y][x][3] = sumB; } @/textblock </pre> (Above, we imagine the kernel to be a 2D array of size kernel_height by kernel_width. However, in practice it is passed in as a contiguous 1D array of size kernel_height * kernel_width.) This filter does not work in place. @param src The input image @param dest A pointer to a preallocated vImage_Buffer to receive the result image. This may not alias the src image. @param tempBuffer An optional pointer to a region of memory to use as a working area during computation. The size of the tempBuffer is given by calling the function with the same parameters and the kvImageGetTempBufferSize flag, in which case the size is returned instead of an error code from the left hand side. You may pass NULL here, in which case a region of memory of similar size will be allocated by the function and freed before it returns. Temp Buffers are a way of avoiding lost time due to VM faults to initialize newly allocated buffers. If you will be calling this function repeatedly with similar parameters you should use a temp buffer. If the function is called from different threads concurrently, a different temp buffer should be used for each. @param srcOffsetToROI_X An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the left edge of the image. @param srcOffsetToROI_Y An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the top edge of the image. @param kernel A pointer to a 1D array of weights of dimension kernel_height x kernel_width. For example, for a simple 3x3 blur, it might be: <pre>@textblock const float kernel[9] = { 1./16, 2./16, 1./16, 2./16, 4./16, 2./16, 1./16, 2./16, 1./16 }; @/textblock </pre> @param kernel_height The height of the 2D table of weights passed in as kernel. It must be an odd number. @param kernel_width The width of the 2D table of weights passed in as kernel. It must be an odd number. @param backgroundColor When the kvImageBackgroundColorFill edging mode is active, the backgroundColor parameter provides the background color to be used for missing pixels when the kernel extends off the edge of the image. @param flags The following flags are allowed: <pre>@textblock kvImageCopyInPlace If any pixels covered by the kernel do no not exist, simply copy the corresponding source pixel to the destination. This will result in a ring off unconvolved content at the edges and convolved content in the middle. kvImageBackgroundColorFill Substitute in the provided background color for missing pixels. For a blur filter this will look like the edges of the image have been blurred into a particular color. This is usually appropriate when the color of the surface onto which the image will be drawn is known. You can also use {Alpha = 0, color = 0} as a background color, and let the downstream image compositor blend in the background color. In this case, the result image should be treated as a premultiplied image. kvImageEdgeExtend Substitute in the nearest defined pixel for missing pixels. This is better when the image is drawn into a frame or other context where the background is not expected to contribute to the final content. kvImageTruncateKernel This is similar to kvImageEdgeExtend, except that edge pixels are simply ignored, and the bias and divisor are adjusted accordingly. Because of the complication at the edges, this edging mode can be significantly slower than the others. It can be numerically unstable if the sum over any rectangular subsection of the kernel is zero, which can result in division by zero during the computation. The results for this edging mode are usually quite visually similar to kvImageEdgeExtend. kvImageGetTempBufferSize Instead of calculating the convolution of the image, return the size of the temp buffer needed for this set of parameters. Does not touch the src or dest image. kvImageDoNotTile Disable internal multithreading. @/textblock </pre> The first four flags listed are edging modes. One and only one edging mode must be provided. If no edging mode is provided (e.g. kvImageNoFlags), then an error will be returned. @return One of the following error codes may be returned: <pre>@textblock kvImageNoError Success. >= 0 If kvImageGetTempBufferSize is passed, this is the size of the temp buffer to use with this function and this set of parameters. kvImageInvalidEdgeStyle One and only one of the following flags must be provided: { kvImageCopyInPlace, kvImageBackgroundColorFill, kvImageEdgeExtend, kvImageTruncateKernel } kvImageRoiLargerThanInputBuffer The dest->width and height must be less than or equal to corresponding dimensions of the source buffer. kvImageInvalidOffset_X The destination width + srcOffsetToROI_X > src->width kvImageInvalidOffset_Y The destination height + srcOffsetToROI_Y > src->height kvImageNullPointerArgument kernel may not be NULL kvImageMemoryAllocationError Could not allocate memory to serve as a temp buffer. kvImageInvalidKernelSize The kernel height and width must be odd numbers. @/textblock </pre> C function: vImageConvolve_ARGBFFFF
func VImageConvolveFloatKernelARGB8888 ¶
func VImageConvolveFloatKernelARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernel *float32, kernelHeight uint32, kernelWidth uint32, bias float32, backgroundColor *uint8, flags uint32) int
@function vImageConvolveFloatKernel_ARGB8888 @abstract General convolution on a ARGB888 image of any channel order with a kernel with floating-point weights. @discussion Performs a filtering operation just like vImageConvolveWithBias_ARGB8888 but with a float rather than an integer (with divisor) kernel. C function: vImageConvolveFloatKernel_ARGB8888
func VImageConvolveMultiKernelARGB8888 ¶
func VImageConvolveMultiKernelARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernels *int16, kernelHeight uint32, kernelWidth uint32, divisors *int32, biases *int32, backgroundColor *uint8, flags uint32) int
@function vImageConvolveMultiKernel_ARGB8888 @abstract General convolution on a ARGB8888 image of any channel order with separate bias, kernel and divisor for each channel. @discussion This filter applies a convolution filter of your choosing to a ARGB8888 image. This filter will work on any four-channel, 8-bit per component image format, not just ARGB. For each pixel: <pre>@textblock for each pixel[y][x] in image{ int sumA = 0; int sumR = 0; int sumG = 0; int sumB = 0; const int16_t *kA = kernel[0]; const int16_t *kR = kernel[1]; const int16_t *kG = kernel[2]; const int16_t *kB = kernel[3]; // Calculate weighted average over kernel area for each kernel_element[i][j] in kernel{ sumA += kA[i*kernel_width+j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2][x+j+srcOffsetToROI_X- kernel_width/2][0]; sumR += kR[i*kernel_width+j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2][x+j+srcOffsetToROI_X- kernel_width/2][1]; sumG += kG[i*kernel_width+j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2][x+j+srcOffsetToROI_X- kernel_width/2][2]; sumB += kB[i*kernel_width+j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2][x+j+srcOffsetToROI_X- kernel_width/2][3]; } // Correct for the scaling introduced by multiplying by the weights table sumA = (sumA + bias[0]) / divisor[0]; sumR = (sumR + bias[1]) / divisor[1]; sumG = (sumG + bias[2]) / divisor[2]; sumB = (sumB + bias[3]) / divisor[3]; // write out result result[y][x][0] = CLAMP(sumA, 0, 255); result[y][x][1] = CLAMP(sumR, 0, 255); result[y][x][2] = CLAMP(sumG, 0, 255); result[y][x][3] = CLAMP(sumB, 0, 255); } @/textblock </pre> (Above, we imagine the kernel to be a 2D array of size kernel_height by kernel_width. However, in practice it is passed in as a contiguous 1D array of size kernel_height * kernel_width.) This filter does not work in place. @param src The input image @param dest A pointer to a preallocated vImage_Buffer to receive the result image. This may not alias the src image. @param tempBuffer An optional pointer to a region of memory to use as a working area during computation. The size of the tempBuffer is given by calling the function with the same parameters and the kvImageGetTempBufferSize flag, in which case the size is returned instead of an error code from the left hand side. You may pass NULL here, in which case a region of memory of similar size will be allocated by the function and freed before it returns. Temp Buffers are a way of avoiding lost time due to VM faults to initialize newly allocated buffers. If you will be calling this function repeatedly with similar parameters you should use a temp buffer. If the function is called from different threads concurrently, a different temp buffer should be used for each. @param srcOffsetToROI_X An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the left edge of the image. @param srcOffsetToROI_Y An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the top edge of the image. @param kernel An array of 4 pointers to weights of dimension kernel_height x kernel_width. The kernel values in each array may not sum in any combination to be outside the range [-2**23, 2**23), or modulo overflow in the accumulator may result. @param kernel_height The height of the 2D table of weights passed in as kernel. It must be an odd number. @param kernel_width The width of the 2D table of weights passed in as kernel. It must be an odd number. @param divisor The weighted sum of nearby pixels is typically a large number, which must be corrected to fit back into the image format of the destination image. The correction factor is passed in as divisor here, and is divided from the sum before the result is returned. Typically, the divisor is the sum over the area of the kernel. If the divisor is 0, 1 will be used instead. @param bias This array of values is added to the sum of weighted pixels for each channel respectively before the divisor is applied. It can serve to both control rounding and adjust the brightness of the result. A large bias (e.g 128 * divisor) may be required for some kernels, such as edge detection filters, to return representable results. @param backgroundColor When the kvImageBackgroundColorFill edging mode is active, the backgroundColor parameter provides the background color to be used for missing pixels when the kernel extends off the edge of the image. @param flags The following flags are allowed: <pre>@textblock kvImageCopyInPlace If any pixels covered by the kernel do no not exist, simply copy the corresponding source pixel to the destination. This will result in a ring off unconvolved content at the edges and convolved content in the middle. kvImageBackgroundColorFill Substitute in the provided background color for missing pixels. For a blur filter this will look like the edges of the image have been blurred into a particular color. This is usually appropriate when the color of the surface onto which the image will be drawn is known. You can also use {Alpha = 0, color = 0} as a background color, and let the downstream image compositor blend in the background color. In this case, the result image should be treated as a premultiplied image. kvImageEdgeExtend Substitute in the nearest defined pixel for missing pixels. This is better when the image is drawn into a frame or other context where the background is not expected to contribute to the final content. kvImageTruncateKernel This is similar to kvImageEdgeExtend, except that edge pixels are simply ignored, and the bias and divisor are adjusted accordingly. Because of the complication at the edges, this edging mode can be significantly slower than the others. It can be numerically unstable if the sum over any rectangular subsection of the kernel is zero, which can result in division by zero during the computation. The results for this edging mode are usually quite visually similar to kvImageEdgeExtend. kvImageGetTempBufferSize Instead of calculating the convolution of the image, return the size of the temp buffer needed for this set of parameters. Does not touch the src or dest image. kvImageDoNotTile Disable internal multithreading. @/textblock </pre> The first four flags listed are edging modes. One and only one edging mode must be provided. If no edging mode is provided (e.g. kvImageNoFlags), then an error will be returned. @return One of the following error codes may be returned: <pre>@textblock kvImageNoError Success. >= 0 If kvImageGetTempBufferSize is passed, this is the size of the temp buffer to use with this function and this set of parameters. kvImageInvalidEdgeStyle One and only one of the following flags must be provided: { kvImageCopyInPlace, kvImageBackgroundColorFill, kvImageEdgeExtend, kvImageTruncateKernel } kvImageRoiLargerThanInputBuffer The dest->width and height must be less than or equal to corresponding dimensions of the source buffer. kvImageInvalidOffset_X The destination width + srcOffsetToROI_X > src->width kvImageInvalidOffset_Y The destination height + srcOffsetToROI_Y > src->height kvImageNullPointerArgument kernel may not be NULL kvImageMemoryAllocationError Could not allocate memory to serve as a temp buffer. kvImageInvalidKernelSize The kernel height and width must be odd numbers. @/textblock </pre> C function: vImageConvolveMultiKernel_ARGB8888
func VImageConvolveMultiKernelARGBFFFF ¶
func VImageConvolveMultiKernelARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernels *float32, kernelHeight uint32, kernelWidth uint32, biases *float32, backgroundColor *float32, flags uint32) int
@function vImageConvolveMultiKernel_ARGBFFFF @abstract General convolution on a ARGBFFFF image of any channel order with separate bias and kernel for each channel. @discussion This filter applies a convolution filter of your choosing to a ARGBFFFF image. This filter will work on any four-channel, float per component image format, not just ARGB. For each pixel: <pre>@textblock for each pixel[y][x] in image{ float sumA = bias[0]; float sumR = bias[1]; float sumG = bias[2]; float sumB = bias[3]; const float *kA = kernel[0]; const float *kR = kernel[1]; const float *kG = kernel[2]; const float *kB = kernel[3]; // Calculate weighted average over kernel area for each kernel_element[i][j] in kernel{ sumA += kA[i*kernel_width+j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2][0]; sumR += kR[i*kernel_width+j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2][1]; sumG += kG[i*kernel_width+j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2][2]; sumB += kB[i*kernel_width+j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2][3]; } // write out result result[y][x][0] = sumA; result[y][x][1] = sumR; result[y][x][2] = sumG; result[y][x][3] = sumB; } @/textblock </pre> (Above, we imagine the kernel to be a 2D array of size kernel_height by kernel_width. However, in practice it is passed in as a contiguous 1D array of size kernel_height * kernel_width.) This filter does not work in place. @param src The input image @param dest A pointer to a preallocated vImage_Buffer to receive the result image. This may not alias the src image. @param tempBuffer An optional pointer to a region of memory to use as a working area during computation. The size of the tempBuffer is given by calling the function with the same parameters and the kvImageGetTempBufferSize flag, in which case the size is returned instead of an error code from the left hand side. You may pass NULL here, in which case a region of memory of similar size will be allocated by the function and freed before it returns. Temp Buffers are a way of avoiding lost time due to VM faults to initialize newly allocated buffers. If you will be calling this function repeatedly with similar parameters you should use a temp buffer. If the function is called from different threads concurrently, a different temp buffer should be used for each. @param srcOffsetToROI_X An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the left edge of the image. @param srcOffsetToROI_Y An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the top edge of the image. @param kernel A pointer to a 1D array of weights of dimension kernel_height x kernel_width. For example, for a simple 3x3 blur, it might be: <pre>@textblock const float kernel[9] = { 1./16, 2./16, 1./16, 2./16, 4./16, 2./16, 1./16, 2./16, 1./16 }; @/textblock </pre> @param kernel_height The height of the 2D table of weights passed in as kernel. It must be an odd number. @param kernel_width The width of the 2D table of weights passed in as kernel. It must be an odd number. @param bias This value is added to the sum of weighted pixels. @param backgroundColor When the kvImageBackgroundColorFill edging mode is active, the backgroundColor parameter provides the background color to be used for missing pixels when the kernel extends off the edge of the image. @param flags The following flags are allowed: <pre>@textblock kvImageCopyInPlace If any pixels covered by the kernel do no not exist, simply copy the corresponding source pixel to the destination. This will result in a ring off unconvolved content at the edges and convolved content in the middle. kvImageBackgroundColorFill Substitute in the provided background color for missing pixels. For a blur filter this will look like the edges of the image have been blurred into a particular color. This is usually appropriate when the color of the surface onto which the image will be drawn is known. You can also use {Alpha = 0, color = 0} as a background color, and let the downstream image compositor blend in the background color. In this case, the result image should be treated as a premultiplied image. kvImageEdgeExtend Substitute in the nearest defined pixel for missing pixels. This is better when the image is drawn into a frame or other context where the background is not expected to contribute to the final content. kvImageTruncateKernel This is similar to kvImageEdgeExtend, except that edge pixels are simply ignored, and the bias and divisor are adjusted accordingly. Because of the complication at the edges, this edging mode can be significantly slower than the others. It can be numerically unstable if the sum over any rectangular subsection of the kernel is zero, which can result in division by zero during the computation. The results for this edging mode are usually quite visually similar to kvImageEdgeExtend. kvImageGetTempBufferSize Instead of calculating the convolution of the image, return the size of the temp buffer needed for this set of parameters. Does not touch the src or dest image. kvImageDoNotTile Disable internal multithreading. @/textblock </pre> The first four flags listed are edging modes. One and only one edging mode must be provided. If no edging mode is provided (e.g. kvImageNoFlags), then an error will be returned. @return One of the following error codes may be returned: <pre>@textblock kvImageNoError Success. >= 0 If kvImageGetTempBufferSize is passed, this is the size of the temp buffer to use with this function and this set of parameters. kvImageInvalidEdgeStyle One and only one of the following flags must be provided: { kvImageCopyInPlace, kvImageBackgroundColorFill, kvImageEdgeExtend, kvImageTruncateKernel } kvImageRoiLargerThanInputBuffer The dest->width and height must be less than or equal to corresponding dimensions of the source buffer. kvImageInvalidOffset_X The destination width + srcOffsetToROI_X > src->width kvImageInvalidOffset_Y The destination height + srcOffsetToROI_Y > src->height kvImageNullPointerArgument kernel may not be NULL kvImageMemoryAllocationError Could not allocate memory to serve as a temp buffer. kvImageInvalidKernelSize The kernel height and width must be odd numbers. @/textblock </pre> C function: vImageConvolveMultiKernel_ARGBFFFF
func VImageConvolvePlanar8 ¶
func VImageConvolvePlanar8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernel *int16, kernelHeight uint32, kernelWidth uint32, divisor int32, backgroundColor uint8, flags uint32) int
@function vImageConvolve_Planar8 @abstract General convolution on a Planar8 image. @discussion This filter applies a convolution filter of your choosing to a Planar8 image. For each pixel: <pre>@textblock for each pixel[y][x] in image{ int sum = 0; // Calculate weighted average over kernel area for each kernel_element[i][j] in kernel{ sum += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2]; } // Correct for the scaling introduced by multiplying by the weights table sum = (sum + divisor/2) / divisor; // write out result result[y][x] = CLAMP(sum, 0, 255); } @/textblock </pre> (Above, we imagine the kernel to be a 2D array of size kernel_height by kernel_width. However, in practice it is passed in as a contiguous 1D array of size kernel_height * kernel_width.) This filter does not work in place. @param src The input image @param dest A pointer to a preallocated vImage_Buffer to receive the result image. This may not alias the src image. @param tempBuffer An optional pointer to a region of memory to use as a working area during computation. The size of the tempBuffer is given by calling the function with the same parameters and the kvImageGetTempBufferSize flag, in which case the size is returned instead of an error code from the left hand side. You may pass NULL here, in which case a region of memory of similar size will be allocated by the function and freed before it returns. Temp Buffers are a way of avoiding lost time due to VM faults to initialize newly allocated buffers. If you will be calling this function repeatedly with similar parameters you should use a temp buffer. If the function is called from different threads concurrently, a different temp buffer should be used for each. @param srcOffsetToROI_X An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the left edge of the image. @param srcOffsetToROI_Y An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the top edge of the image. @param kernel A pointer to a 1D array of weights of dimension kernel_height x kernel_width. For example, for a simple 3x3 blur, it might be: <pre>@textblock const int16_t kernel[9] = { 1, 2, 1, 2, 4, 2, 1, 2, 1 }; @/textblock </pre> The kernel values may not sum in any combination to be outside the range [-2**23, 2**23), or modulo overflow in the accumulator may result. @param kernel_height The height of the 2D table of weights passed in as kernel. It must be an odd number. @param kernel_width The width of the 2D table of weights passed in as kernel. It must be an odd number. @param divisor The weighted sum of nearby pixels is typically a large number, which must be corrected to fit back into the image format of the destination image. The correction factor is passed in as divisor here, and is divided from the sum before the result is returned. Typically, the divisor is the sum over the area of the kernel. If the divisor is 0, 1 will be used instead. @param backgroundColor When the kvImageBackgroundColorFill edging mode is active, the backgroundColor parameter provides the background color to be used for missing pixels when the kernel extends off the edge of the image. @param flags The following flags are allowed: <pre>@textblock kvImageCopyInPlace If any pixels covered by the kernel do no not exist, simply copy the corresponding source pixel to the destination. This will result in a ring off unconvolved content at the edges and convolved content in the middle. kvImageBackgroundColorFill Substitute in the provided background color for missing pixels. For a blur filter this will look like the edges of the image have been blurred into a particular color. This is usually appropriate when the color of the surface onto which the image will be drawn is known. You can also use {Alpha = 0, color = 0} as a background color, and let the downstream image compositor blend in the background color. In this case, the result image should be treated as a premultiplied image. kvImageEdgeExtend Substitute in the nearest defined pixel for missing pixels. This is better when the image is drawn into a frame or other context where the background is not expected to contribute to the final content. kvImageTruncateKernel This is similar to kvImageEdgeExtend, except that edge pixels are simply ignored, and the bias and divisor are adjusted accordingly. Because of the complication at the edges, this edging mode can be significantly slower than the others. It can be numerically unstable if the sum over any rectangular subsection of the kernel is zero, which can result in division by zero during the computation. The results for this edging mode are usually quite visually similar to kvImageEdgeExtend. kvImageGetTempBufferSize Instead of calculating the convolution of the image, return the size of the temp buffer needed for this set of parameters. Does not touch the src or dest image. kvImageDoNotTile Disable internal multithreading. @/textblock </pre> The first four flags listed are edging modes. One and only one edging mode must be provided. If no edging mode is provided (e.g. kvImageNoFlags), then an error will be returned. @return One of the following error codes may be returned: <pre>@textblock kvImageNoError Success. >= 0 If kvImageGetTempBufferSize is passed, this is the size of the temp buffer to use with this function and this set of parameters. kvImageInvalidEdgeStyle One and only one of the following flags must be provided: { kvImageCopyInPlace, kvImageBackgroundColorFill, kvImageEdgeExtend, kvImageTruncateKernel } kvImageRoiLargerThanInputBuffer The dest->width and height must be less than or equal to corresponding dimensions of the source buffer. kvImageInvalidOffset_X The destination width + srcOffsetToROI_X > src->width kvImageInvalidOffset_Y The destination height + srcOffsetToROI_Y > src->height kvImageNullPointerArgument kernel may not be NULL kvImageMemoryAllocationError Could not allocate memory to serve as a temp buffer. kvImageInvalidKernelSize The kernel height and width must be odd numbers. @/textblock </pre> C function: vImageConvolve_Planar8
func VImageConvolvePlanar16F ¶
func VImageConvolvePlanar16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernel *float32, kernelHeight uint32, kernelWidth uint32, backgroundColor uint16, flags uint32) int
@function vImageConvolve_Planar16F @abstract General convolution on a Planar16F image. @discussion This filter applies a convolution filter of your choosing to a Planar16F image. The kernel values are specified as 32-bit single-precision floats and the weighted average is also computed in single precision by default. However, if the flag kvImageUseFP16Accumulator is set all internal filtering operations will use 16-bit half-precision floating-point arithmetic when the CPU architecture supports it. This results in up to 2x performance improvements but at the expense of a less precise result; typically 2-3 bits of precision is lost. For each pixel: <pre>@textblock for each pixel[y][x] in image{ // sum is declared as type _Float16 when the flag kvImageUseFP16Accumulator is set float sum = 0; // Calculate weighted average over kernel area for each kernel_element[i][j] in kernel{ sum += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2]; } // write out result result[y][x] = (_Float16)sum; } @/textblock </pre> (Above, we imagine the kernel to be a 2D array of size kernel_height by kernel_width. However, in practice it is passed in as a contiguous 1D array of size kernel_height * kernel_width.) This filter does not work in place. @param src The input image @param dest A pointer to a preallocated vImage_Buffer to receive the result image. This may not alias the src image. @param tempBuffer An optional pointer to a region of memory to use as a working area during computation. The size of the tempBuffer is given by calling the function with the same parameters and the kvImageGetTempBufferSize flag, in which case the size is returned instead of an error code from the left hand side. You may pass NULL here, in which case a region of memory of similar size will be allocated by the function and freed before it returns. Temp Buffers are a way of avoiding lost time due to VM faults to initialize newly allocated buffers. If you will be calling this function repeatedly with similar parameters you should use a temp buffer. If the function is called from different threads concurrently, a different temp buffer should be used for each. @param srcOffsetToROI_X An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the left edge of the image. @param srcOffsetToROI_Y An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the top edge of the image. @param kernel A pointer to a 1D array of weights of dimension kernel_height x kernel_width. For example, for a simple 3x3 blur, it might be: <pre>@textblock const float kernel[9] = { 1./16, 2./16, 1./16, 2./16, 4./16, 2./16, 1./16, 2./16, 1./16 }; @/textblock </pre> @param kernel_height The height of the 2D table of weights passed in as kernel. It must be an odd number. @param kernel_width The width of the 2D table of weights passed in as kernel. It must be an odd number. @param backgroundColor When the kvImageBackgroundColorFill edging mode is active, the backgroundColor parameter provides the background color to be used for missing pixels when the kernel extends off the edge of the image. @param flags The following flags are allowed: <pre>@textblock kvImageCopyInPlace If any pixels covered by the kernel do no not exist, simply copy the corresponding source pixel to the destination. This will result in a ring off unconvolved content at the edges and convolved content in the middle. kvImageBackgroundColorFill Substitute in the provided background color for missing pixels. For a blur filter this will look like the edges of the image have been blurred into a particular color. This is usually appropriate when the color of the surface onto which the image will be drawn is known. You can also use {Alpha = 0, color = 0} as a background color, and let the downstream image compositor blend in the background color. In this case, the result image should be treated as a premultiplied image. kvImageEdgeExtend Substitute in the nearest defined pixel for missing pixels. This is better when the image is drawn into a frame or other context where the background is not expected to contribute to the final content. kvImageTruncateKernel This is similar to kvImageEdgeExtend, except that edge pixels are simply ignored, and the bias and divisor are adjusted accordingly. Because of the complication at the edges, this edging mode can be significantly slower than the others. It can be numerically unstable if the sum over any rectangular subsection of the kernel is zero, which can result in division by zero during the computation. The results for this edging mode are usually quite visually similar to kvImageEdgeExtend. kvImageGetTempBufferSize Instead of calculating the convolution of the image, return the size of the temp buffer needed for this set of parameters. Does not touch the src or dest image. kvImageDoNotTile Disable internal multithreading. kvImageUseFP16Accumulator Enable 16-bit half-precision floating-point arithmetic when computing the kernel averages when the CPU architecture supports it. @/textblock </pre> The first four flags listed are edging modes. One and only one edging mode must be provided. If no edging mode is provided (e.g. kvImageNoFlags), then an error will be returned. @return One of the following error codes may be returned: <pre>@textblock kvImageNoError Success. >= 0 If kvImageGetTempBufferSize is passed, this is the size of the temp buffer to use with this function and this set of parameters. kvImageInvalidEdgeStyle One and only one of the following flags must be provided: { kvImageCopyInPlace, kvImageBackgroundColorFill, kvImageEdgeExtend, kvImageTruncateKernel } kvImageRoiLargerThanInputBuffer The dest->width and height must be less than or equal to corresponding dimensions of the source buffer. kvImageInvalidOffset_X The destination width + srcOffsetToROI_X > src->width kvImageInvalidOffset_Y The destination height + srcOffsetToROI_Y > src->height kvImageNullPointerArgument kernel may not be NULL kvImageMemoryAllocationError Could not allocate memory to serve as a temp buffer. kvImageInvalidKernelSize The kernel height and width must be odd numbers. @/textblock </pre> C function: vImageConvolve_Planar16F
func VImageConvolvePlanarF ¶
func VImageConvolvePlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernel *float32, kernelHeight uint32, kernelWidth uint32, backgroundColor float32, flags uint32) int
@function vImageConvolve_PlanarF @abstract General convolution on a PlanarF image. @discussion This filter applies a convolution filter of your choosing to a PlanarF image. For each pixel: <pre>@textblock for each pixel[y][x] in image{ float sum = 0; // Calculate weighted average over kernel area for each kernel_element[i][j] in kernel{ sum += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2]; } // write out result result[y][x] = sum; } @/textblock </pre> (Above, we imagine the kernel to be a 2D array of size kernel_height by kernel_width. However, in practice it is passed in as a contiguous 1D array of size kernel_height * kernel_width.) This filter does not work in place. @param src The input image @param dest A pointer to a preallocated vImage_Buffer to receive the result image. This may not alias the src image. @param tempBuffer An optional pointer to a region of memory to use as a working area during computation. The size of the tempBuffer is given by calling the function with the same parameters and the kvImageGetTempBufferSize flag, in which case the size is returned instead of an error code from the left hand side. You may pass NULL here, in which case a region of memory of similar size will be allocated by the function and freed before it returns. Temp Buffers are a way of avoiding lost time due to VM faults to initialize newly allocated buffers. If you will be calling this function repeatedly with similar parameters you should use a temp buffer. If the function is called from different threads concurrently, a different temp buffer should be used for each. @param srcOffsetToROI_X An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the left edge of the image. @param srcOffsetToROI_Y An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the top edge of the image. @param kernel A pointer to a 1D array of weights of dimension kernel_height x kernel_width. For example, for a simple 3x3 blur, it might be: <pre>@textblock const float kernel[9] = { 1./16, 2./16, 1./16, 2./16, 4./16, 2./16, 1./16, 2./16, 1./16 }; @/textblock </pre> @param kernel_height The height of the 2D table of weights passed in as kernel. It must be an odd number. @param kernel_width The width of the 2D table of weights passed in as kernel. It must be an odd number. @param backgroundColor When the kvImageBackgroundColorFill edging mode is active, the backgroundColor parameter provides the background color to be used for missing pixels when the kernel extends off the edge of the image. @param flags The following flags are allowed: <pre>@textblock kvImageCopyInPlace If any pixels covered by the kernel do no not exist, simply copy the corresponding source pixel to the destination. This will result in a ring off unconvolved content at the edges and convolved content in the middle. kvImageBackgroundColorFill Substitute in the provided background color for missing pixels. For a blur filter this will look like the edges of the image have been blurred into a particular color. This is usually appropriate when the color of the surface onto which the image will be drawn is known. You can also use {Alpha = 0, color = 0} as a background color, and let the downstream image compositor blend in the background color. In this case, the result image should be treated as a premultiplied image. kvImageEdgeExtend Substitute in the nearest defined pixel for missing pixels. This is better when the image is drawn into a frame or other context where the background is not expected to contribute to the final content. kvImageTruncateKernel This is similar to kvImageEdgeExtend, except that edge pixels are simply ignored, and the bias and divisor are adjusted accordingly. Because of the complication at the edges, this edging mode can be significantly slower than the others. It can be numerically unstable if the sum over any rectangular subsection of the kernel is zero, which can result in division by zero during the computation. The results for this edging mode are usually quite visually similar to kvImageEdgeExtend. kvImageGetTempBufferSize Instead of calculating the convolution of the image, return the size of the temp buffer needed for this set of parameters. Does not touch the src or dest image. kvImageDoNotTile Disable internal multithreading. @/textblock </pre> The first four flags listed are edging modes. One and only one edging mode must be provided. If no edging mode is provided (e.g. kvImageNoFlags), then an error will be returned. @return One of the following error codes may be returned: <pre>@textblock kvImageNoError Success. >= 0 If kvImageGetTempBufferSize is passed, this is the size of the temp buffer to use with this function and this set of parameters. kvImageInvalidEdgeStyle One and only one of the following flags must be provided: { kvImageCopyInPlace, kvImageBackgroundColorFill, kvImageEdgeExtend, kvImageTruncateKernel } kvImageRoiLargerThanInputBuffer The dest->width and height must be less than or equal to corresponding dimensions of the source buffer. kvImageInvalidOffset_X The destination width + srcOffsetToROI_X > src->width kvImageInvalidOffset_Y The destination height + srcOffsetToROI_Y > src->height kvImageNullPointerArgument kernel may not be NULL kvImageMemoryAllocationError Could not allocate memory to serve as a temp buffer. kvImageInvalidKernelSize The kernel height and width must be odd numbers. @/textblock </pre> C function: vImageConvolve_PlanarF
func VImageConvolveWithBiasARGB16F ¶
func VImageConvolveWithBiasARGB16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernel *float32, kernelHeight uint32, kernelWidth uint32, bias float32, backgroundColor *uint16, flags uint32) int
@function vImageConvolveWithBias_ARGB16F @abstract General convolution on a ARGB16F image of any channel order. @discussion This filter applies a convolution filter of your choosing to a ARGB16F image. This filter will work on any four-channel, half-float per component image format, not just ARGB. The kernel values are specified as 32-bit single-precision floats and the weighted average is also computed in single precision by default. However, if the flag kvImageUseFP16Accumulator is set all internal filtering operations will use 16-bit half-precision floating-point arithmetic when the CPU architecture supports it. This results in up to 2x performance improvements but at the expense of a less precise result; typically 2-3 bits of precision is lost. For each pixel: <pre>@textblock for each pixel[y][x] in image{ // Sums are declared as type _Float16 when the flag kvImageUseFP16Accumulator is set float sumA = bias; float sumR = bias; float sumG = bias; float sumB = bias; // Calculate weighted average over kernel area for each kernel_element[i][j] in kernel{ sumA += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2][0]; sumR += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2][1]; sumG += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2][2]; sumB += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2][3]; } // write out result result[y][x][0] = (_Float16)sumA; result[y][x][1] = (_Float16)sumR; result[y][x][2] = (_Float16)sumG; result[y][x][3] = (_Float16)sumB; } @/textblock </pre> (Above, we imagine the kernel to be a 2D array of size kernel_height by kernel_width. However, in practice it is passed in as a contiguous 1D array of size kernel_height * kernel_width.) This filter does not work in place. @param src The input image @param dest A pointer to a preallocated vImage_Buffer to receive the result image. This may not alias the src image. @param tempBuffer An optional pointer to a region of memory to use as a working area during computation. The size of the tempBuffer is given by calling the function with the same parameters and the kvImageGetTempBufferSize flag, in which case the size is returned instead of an error code from the left hand side. You may pass NULL here, in which case a region of memory of similar size will be allocated by the function and freed before it returns. Temp Buffers are a way of avoiding lost time due to VM faults to initialize newly allocated buffers. If you will be calling this function repeatedly with similar parameters you should use a temp buffer. If the function is called from different threads concurrently, a different temp buffer should be used for each. @param srcOffsetToROI_X An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the left edge of the image. @param srcOffsetToROI_Y An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the top edge of the image. @param kernel A pointer to a 1D array of weights of dimension kernel_height x kernel_width. For example, for a simple 3x3 blur, it might be: <pre>@textblock const float kernel[9] = { 1./16, 2./16, 1./16, 2./16, 4./16, 2./16, 1./16, 2./16, 1./16 }; @/textblock </pre> @param kernel_height The height of the 2D table of weights passed in as kernel. It must be an odd number. @param kernel_width The width of the 2D table of weights passed in as kernel. It must be an odd number. @param bias This value is added to the sum of weighted pixels. @param backgroundColor When the kvImageBackgroundColorFill edging mode is active, the backgroundColor parameter provides the background color to be used for missing pixels when the kernel extends off the edge of the image. @param flags The following flags are allowed: <pre>@textblock kvImageCopyInPlace If any pixels covered by the kernel do no not exist, simply copy the corresponding source pixel to the destination. This will result in a ring off unconvolved content at the edges and convolved content in the middle. kvImageBackgroundColorFill Substitute in the provided background color for missing pixels. For a blur filter this will look like the edges of the image have been blurred into a particular color. This is usually appropriate when the color of the surface onto which the image will be drawn is known. You can also use {Alpha = 0, color = 0} as a background color, and let the downstream image compositor blend in the background color. In this case, the result image should be treated as a premultiplied image. kvImageEdgeExtend Substitute in the nearest defined pixel for missing pixels. This is better when the image is drawn into a frame or other context where the background is not expected to contribute to the final content. kvImageTruncateKernel This is similar to kvImageEdgeExtend, except that edge pixels are simply ignored, and the bias and divisor are adjusted accordingly. Because of the complication at the edges, this edging mode can be significantly slower than the others. It can be numerically unstable if the sum over any rectangular subsection of the kernel is zero, which can result in division by zero during the computation. The results for this edging mode are usually quite visually similar to kvImageEdgeExtend. kvImageGetTempBufferSize Instead of calculating the convolution of the image, return the size of the temp buffer needed for this set of parameters. Does not touch the src or dest image. kvImageDoNotTile Disable internal multithreading. kvImageUseFP16Accumulator Enable 16-bit half-precision floating-point arithmetic when computing the kernel averages when the CPU architecture supports it. @/textblock </pre> The first four flags listed are edging modes. One and only one edging mode must be provided. If no edging mode is provided (e.g. kvImageNoFlags), then an error will be returned. @return One of the following error codes may be returned: <pre>@textblock kvImageNoError Success. >= 0 If kvImageGetTempBufferSize is passed, this is the size of the temp buffer to use with this function and this set of parameters. kvImageInvalidEdgeStyle One and only one of the following flags must be provided: { kvImageCopyInPlace, kvImageBackgroundColorFill, kvImageEdgeExtend, kvImageTruncateKernel } kvImageRoiLargerThanInputBuffer The dest->width and height must be less than or equal to corresponding dimensions of the source buffer. kvImageInvalidOffset_X The destination width + srcOffsetToROI_X > src->width kvImageInvalidOffset_Y The destination height + srcOffsetToROI_Y > src->height kvImageNullPointerArgument kernel may not be NULL kvImageMemoryAllocationError Could not allocate memory to serve as a temp buffer. kvImageInvalidKernelSize The kernel height and width must be odd numbers. @/textblock </pre> C function: vImageConvolveWithBias_ARGB16F
func VImageConvolveWithBiasARGB8888 ¶
func VImageConvolveWithBiasARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernel *int16, kernelHeight uint32, kernelWidth uint32, divisor int32, bias int32, backgroundColor *uint8, flags uint32) int
@function vImageConvolveWithBias_ARGB8888 @abstract General convolution on a ARGB888 image of any channel order with bias. @discussion This filter applies a convolution filter of your choosing to a ARGB8888 image. This filter will work on any four-channel, 8-bit per component image format, not just ARGB. For each pixel: <pre>@textblock for each pixel[y][x] in image{ int sumA = 0; int sumR = 0; int sumG = 0; int sumB = 0; // Calculate weighted average over kernel area for each kernel_element[i][j] in kernel{ sumA += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2][x+j+srcOffsetToROI_X- kernel_width/2][0]; sumR += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2][x+j+srcOffsetToROI_X- kernel_width/2][1]; sumG += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2][x+j+srcOffsetToROI_X- kernel_width/2][2]; sumB += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2][x+j+srcOffsetToROI_X- kernel_width/2][3]; } // Correct for the scaling introduced by multiplying by the weights table sumA = (sumA + bias[0]) / divisor; sumR = (sumR + bias[1]) / divisor; sumG = (sumG + bias[2]) / divisor; sumB = (sumB + bias[3]) / divisor; // write out result result[y][x][0] = CLAMP(sumA, 0, 255); result[y][x][1] = CLAMP(sumR, 0, 255); result[y][x][2] = CLAMP(sumG, 0, 255); result[y][x][3] = CLAMP(sumB, 0, 255); } @/textblock </pre> (Above, we imagine the kernel to be a 2D array of size kernel_height by kernel_width. However, in practice it is passed in as a contiguous 1D array of size kernel_height * kernel_width.) This filter does not work in place. @param src The input image @param dest A pointer to a preallocated vImage_Buffer to receive the result image. This may not alias the src image. @param tempBuffer An optional pointer to a region of memory to use as a working area during computation. The size of the tempBuffer is given by calling the function with the same parameters and the kvImageGetTempBufferSize flag, in which case the size is returned instead of an error code from the left hand side. You may pass NULL here, in which case a region of memory of similar size will be allocated by the function and freed before it returns. Temp Buffers are a way of avoiding lost time due to VM faults to initialize newly allocated buffers. If you will be calling this function repeatedly with similar parameters you should use a temp buffer. If the function is called from different threads concurrently, a different temp buffer should be used for each. @param srcOffsetToROI_X An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the left edge of the image. @param srcOffsetToROI_Y An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the top edge of the image. @param kernel A pointer to a 1D array of weights of dimension kernel_height x kernel_width. For example, for a simple 3x3 blur, it might be: <pre>@textblock const int16_t kernel[9] = { 1, 2, 1, 2, 4, 2, 1, 2, 1 }; @/textblock </pre> The kernel values may not sum in any combination to be outside the range [-2**23, 2**23), or modulo overflow in the accumulator may result. @param kernel_height The height of the 2D table of weights passed in as kernel. It must be an odd number. @param kernel_width The width of the 2D table of weights passed in as kernel. It must be an odd number. @param divisor The weighted sum of nearby pixels is typically a large number, which must be corrected to fit back into the image format of the destination image. The correction factor is passed in as divisor here, and is divided from the sum before the result is returned. Typically, the divisor is the sum over the area of the kernel. If the divisor is 0, 1 will be used instead. @param bias This value is added to the sum of weighted pixels before the divisor is applied. It can serve to both control rounding and adjust the brightness of the result. A large bias (e.g 128 * divisor) may be required for some kernels, such as edge detection filters, to return representable results. @param backgroundColor When the kvImageBackgroundColorFill edging mode is active, the backgroundColor parameter provides the background color to be used for missing pixels when the kernel extends off the edge of the image. @param flags The following flags are allowed: <pre>@textblock kvImageCopyInPlace If any pixels covered by the kernel do no not exist, simply copy the corresponding source pixel to the destination. This will result in a ring off unconvolved content at the edges and convolved content in the middle. kvImageBackgroundColorFill Substitute in the provided background color for missing pixels. For a blur filter this will look like the edges of the image have been blurred into a particular color. This is usually appropriate when the color of the surface onto which the image will be drawn is known. You can also use {Alpha = 0, color = 0} as a background color, and let the downstream image compositor blend in the background color. In this case, the result image should be treated as a premultiplied image. kvImageEdgeExtend Substitute in the nearest defined pixel for missing pixels. This is better when the image is drawn into a frame or other context where the background is not expected to contribute to the final content. kvImageTruncateKernel This is similar to kvImageEdgeExtend, except that edge pixels are simply ignored, and the bias and divisor are adjusted accordingly. Because of the complication at the edges, this edging mode can be significantly slower than the others. It can be numerically unstable if the sum over any rectangular subsection of the kernel is zero, which can result in division by zero during the computation. The results for this edging mode are usually quite visually similar to kvImageEdgeExtend. kvImageGetTempBufferSize Instead of calculating the convolution of the image, return the size of the temp buffer needed for this set of parameters. Does not touch the src or dest image. kvImageDoNotTile Disable internal multithreading. @/textblock </pre> The first four flags listed are edging modes. One and only one edging mode must be provided. If no edging mode is provided (e.g. kvImageNoFlags), then an error will be returned. @return One of the following error codes may be returned: <pre>@textblock kvImageNoError Success. >= 0 If kvImageGetTempBufferSize is passed, this is the size of the temp buffer to use with this function and this set of parameters. kvImageInvalidEdgeStyle One and only one of the following flags must be provided: { kvImageCopyInPlace, kvImageBackgroundColorFill, kvImageEdgeExtend, kvImageTruncateKernel } kvImageRoiLargerThanInputBuffer The dest->width and height must be less than or equal to corresponding dimensions of the source buffer. kvImageInvalidOffset_X The destination width + srcOffsetToROI_X > src->width kvImageInvalidOffset_Y The destination height + srcOffsetToROI_Y > src->height kvImageNullPointerArgument kernel may not be NULL kvImageMemoryAllocationError Could not allocate memory to serve as a temp buffer. kvImageInvalidKernelSize The kernel height and width must be odd numbers. @/textblock </pre> C function: vImageConvolveWithBias_ARGB8888
func VImageConvolveWithBiasARGBFFFF ¶
func VImageConvolveWithBiasARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernel *float32, kernelHeight uint32, kernelWidth uint32, bias float32, backgroundColor *float32, flags uint32) int
@function vImageConvolveWithBias_ARGBFFFF @abstract General convolution on a ARGBFFFF image of any channel order with bias. @discussion This filter applies a convolution filter of your choosing to a ARGBFFFF image. This filter will work on any four-channel, float per component image format, not just ARGB. For each pixel: <pre>@textblock for each pixel[y][x] in image{ float sumA = bias[0]; float sumR = bias[1]; float sumG = bias[2]; float sumB = bias[3]; // Calculate weighted average over kernel area for each kernel_element[i][j] in kernel{ sumA += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2][0]; sumR += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2][1]; sumG += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2][2]; sumB += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2][3]; } // write out result result[y][x][0] = sumA; result[y][x][1] = sumR; result[y][x][2] = sumG; result[y][x][3] = sumB; } @/textblock </pre> (Above, we imagine the kernel to be a 2D array of size kernel_height by kernel_width. However, in practice it is passed in as a contiguous 1D array of size kernel_height * kernel_width.) This filter does not work in place. @param src The input image @param dest A pointer to a preallocated vImage_Buffer to receive the result image. This may not alias the src image. @param tempBuffer An optional pointer to a region of memory to use as a working area during computation. The size of the tempBuffer is given by calling the function with the same parameters and the kvImageGetTempBufferSize flag, in which case the size is returned instead of an error code from the left hand side. You may pass NULL here, in which case a region of memory of similar size will be allocated by the function and freed before it returns. Temp Buffers are a way of avoiding lost time due to VM faults to initialize newly allocated buffers. If you will be calling this function repeatedly with similar parameters you should use a temp buffer. If the function is called from different threads concurrently, a different temp buffer should be used for each. @param srcOffsetToROI_X An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the left edge of the image. @param srcOffsetToROI_Y An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the top edge of the image. @param kernel A pointer to a 1D array of weights of dimension kernel_height x kernel_width. For example, for a simple 3x3 blur, it might be: <pre>@textblock const float kernel[9] = { 1./16, 2./16, 1./16, 2./16, 4./16, 2./16, 1./16, 2./16, 1./16 }; @/textblock </pre> @param kernel_height The height of the 2D table of weights passed in as kernel. It must be an odd number. @param kernel_width The width of the 2D table of weights passed in as kernel. It must be an odd number. @param bias This value is added to the sum of weighted pixels. @param backgroundColor When the kvImageBackgroundColorFill edging mode is active, the backgroundColor parameter provides the background color to be used for missing pixels when the kernel extends off the edge of the image. @param flags The following flags are allowed: <pre>@textblock kvImageCopyInPlace If any pixels covered by the kernel do no not exist, simply copy the corresponding source pixel to the destination. This will result in a ring off unconvolved content at the edges and convolved content in the middle. kvImageBackgroundColorFill Substitute in the provided background color for missing pixels. For a blur filter this will look like the edges of the image have been blurred into a particular color. This is usually appropriate when the color of the surface onto which the image will be drawn is known. You can also use {Alpha = 0, color = 0} as a background color, and let the downstream image compositor blend in the background color. In this case, the result image should be treated as a premultiplied image. kvImageEdgeExtend Substitute in the nearest defined pixel for missing pixels. This is better when the image is drawn into a frame or other context where the background is not expected to contribute to the final content. kvImageTruncateKernel This is similar to kvImageEdgeExtend, except that edge pixels are simply ignored, and the bias and divisor are adjusted accordingly. Because of the complication at the edges, this edging mode can be significantly slower than the others. It can be numerically unstable if the sum over any rectangular subsection of the kernel is zero, which can result in division by zero during the computation. The results for this edging mode are usually quite visually similar to kvImageEdgeExtend. kvImageGetTempBufferSize Instead of calculating the convolution of the image, return the size of the temp buffer needed for this set of parameters. Does not touch the src or dest image. kvImageDoNotTile Disable internal multithreading. @/textblock </pre> The first four flags listed are edging modes. One and only one edging mode must be provided. If no edging mode is provided (e.g. kvImageNoFlags), then an error will be returned. @return One of the following error codes may be returned: <pre>@textblock kvImageNoError Success. >= 0 If kvImageGetTempBufferSize is passed, this is the size of the temp buffer to use with this function and this set of parameters. kvImageInvalidEdgeStyle One and only one of the following flags must be provided: { kvImageCopyInPlace, kvImageBackgroundColorFill, kvImageEdgeExtend, kvImageTruncateKernel } kvImageRoiLargerThanInputBuffer The dest->width and height must be less than or equal to corresponding dimensions of the source buffer. kvImageInvalidOffset_X The destination width + srcOffsetToROI_X > src->width kvImageInvalidOffset_Y The destination height + srcOffsetToROI_Y > src->height kvImageNullPointerArgument kernel may not be NULL kvImageMemoryAllocationError Could not allocate memory to serve as a temp buffer. kvImageInvalidKernelSize The kernel height and width must be odd numbers. @/textblock </pre> C function: vImageConvolveWithBias_ARGBFFFF
func VImageConvolveWithBiasPlanar8 ¶
func VImageConvolveWithBiasPlanar8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernel *int16, kernelHeight uint32, kernelWidth uint32, divisor int32, bias int32, backgroundColor uint8, flags uint32) int
@function vImageConvolveWithBias_Planar8 @abstract General convolution on a Planar8 image with added bias. @discussion This filter applies a convolution filter of your choosing to a Planar8 image. For each pixel: <pre>@textblock for each pixel[y][x] in image{ int sum = 0; // Calculate weighted average over kernel area for each kernel_element[i][j] in kernel{ sum += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2]; } // Correct for the scaling introduced by multiplying by the weights table sum = (sum + bias) / divisor; // write out result result[y][x] = CLAMP(sum, 0, 255); } @/textblock </pre> (Above, we imagine the kernel to be a 2D array of size kernel_height by kernel_width. However, in practice it is passed in as a contiguous 1D array of size kernel_height * kernel_width.) This filter does not work in place. @param src The input image @param dest A pointer to a preallocated vImage_Buffer to receive the result image. This may not alias the src image. @param tempBuffer An optional pointer to a region of memory to use as a working area during computation. The size of the tempBuffer is given by calling the function with the same parameters and the kvImageGetTempBufferSize flag, in which case the size is returned instead of an error code from the left hand side. You may pass NULL here, in which case a region of memory of similar size will be allocated by the function and freed before it returns. Temp Buffers are a way of avoiding lost time due to VM faults to initialize newly allocated buffers. If you will be calling this function repeatedly with similar parameters you should use a temp buffer. If the function is called from different threads concurrently, a different temp buffer should be used for each. @param srcOffsetToROI_X An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the left edge of the image. @param srcOffsetToROI_Y An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the top edge of the image. @param kernel A pointer to a 1D array of weights of dimension kernel_height x kernel_width. For example, for a simple 3x3 blur, it might be: <pre>@textblock const int16_t kernel[9] = { 1, 2, 1, 2, 4, 2, 1, 2, 1 }; @/textblock </pre> The kernel values may not sum in any combination to be outside the range [-2**23, 2**23), or modulo overflow in the accumulator may result. @param kernel_height The height of the 2D table of weights passed in as kernel. It must be an odd number. @param kernel_width The width of the 2D table of weights passed in as kernel. It must be an odd number. @param divisor The weighted sum of nearby pixels is typically a large number, which must be corrected to fit back into the image format of the destination image. The correction factor is passed in as divisor here, and is divided from the sum before the result is returned. Typically, the divisor is the sum over the area of the kernel. If the divisor is 0, 1 will be used instead. @param bias This value is added to the sum of weighted pixels before the divisor is applied. It can serve to both control rounding and adjust the brightness of the result. A large bias (e.g 128 * divisor) may be required for some kernels to return representable results, such as edge detection filters. @param backgroundColor When the kvImageBackgroundColorFill edging mode is active, the backgroundColor parameter provides the background color to be used for missing pixels when the kernel extends off the edge of the image. @param flags The following flags are allowed: <pre>@textblock kvImageCopyInPlace If any pixels covered by the kernel do no not exist, simply copy the corresponding source pixel to the destination. This will result in a ring off unconvolved content at the edges and convolved content in the middle. kvImageBackgroundColorFill Substitute in the provided background color for missing pixels. For a blur filter this will look like the edges of the image have been blurred into a particular color. This is usually appropriate when the color of the surface onto which the image will be drawn is known. You can also use {Alpha = 0, color = 0} as a background color, and let the downstream image compositor blend in the background color. In this case, the result image should be treated as a premultiplied image. kvImageEdgeExtend Substitute in the nearest defined pixel for missing pixels. This is better when the image is drawn into a frame or other context where the background is not expected to contribute to the final content. kvImageTruncateKernel This is similar to kvImageEdgeExtend, except that edge pixels are simply ignored, and the bias and divisor are adjusted accordingly. Because of the complication at the edges, this edging mode can be significantly slower than the others. It can be numerically unstable if the sum over any rectangular subsection of the kernel is zero, which can result in division by zero during the computation. The results for this edging mode are usually quite visually similar to kvImageEdgeExtend. kvImageGetTempBufferSize Instead of calculating the convolution of the image, return the size of the temp buffer needed for this set of parameters. Does not touch the src or dest image. kvImageDoNotTile Disable internal multithreading. @/textblock </pre> The first four flags listed are edging modes. One and only one edging mode must be provided. If no edging mode is provided (e.g. kvImageNoFlags), then an error will be returned. @return One of the following error codes may be returned: <pre>@textblock kvImageNoError Success. >= 0 If kvImageGetTempBufferSize is passed, this is the size of the temp buffer to use with this function and this set of parameters. kvImageInvalidEdgeStyle One and only one of the following flags must be provided: { kvImageCopyInPlace, kvImageBackgroundColorFill, kvImageEdgeExtend, kvImageTruncateKernel } kvImageRoiLargerThanInputBuffer The dest->width and height must be less than or equal to corresponding dimensions of the source buffer. kvImageInvalidOffset_X The destination width + srcOffsetToROI_X > src->width kvImageInvalidOffset_Y The destination height + srcOffsetToROI_Y > src->height kvImageNullPointerArgument kernel may not be NULL kvImageMemoryAllocationError Could not allocate memory to serve as a temp buffer. kvImageInvalidKernelSize The kernel height and width must be odd numbers. @/textblock </pre> C function: vImageConvolveWithBias_Planar8
func VImageConvolveWithBiasPlanar16F ¶
func VImageConvolveWithBiasPlanar16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernel *float32, kernelHeight uint32, kernelWidth uint32, bias float32, backgroundColor uint16, flags uint32) int
@function vImageConvolveWithBias_Planar16F @abstract General convolution on a Planar16F image. @discussion This filter applies a convolution filter of your choosing to a Planar16F image. The kernel values are specified as 32-bit single-precision floats and the weighted average is also computed in single precision by default. However, if the flag kvImageUseFP16Accumulator is set all internal filtering operations will use 16-bit half-precision floating-point arithmetic when the CPU architecture supports it. This results in up to 2x performance improvements but at the expense of a less precise result; typically 2-3 bits of precision is lost. For each pixel: <pre>@textblock for each pixel[y][x] in image{ // sum is declared as type _Float16 when the flag kvImageUseFP16Accumulator is set float sum = bias; // Calculate weighted average over kernel area for each kernel_element[i][j] in kernel{ sum += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2]; } // write out result result[y][x] = (_Float16)sum; } @/textblock </pre> (Above, we imagine the kernel to be a 2D array of size kernel_height by kernel_width. However, in practice it is passed in as a contiguous 1D array of size kernel_height * kernel_width.) This filter does not work in place. @param src The input image @param dest A pointer to a preallocated vImage_Buffer to receive the result image. This may not alias the src image. @param tempBuffer An optional pointer to a region of memory to use as a working area during computation. The size of the tempBuffer is given by calling the function with the same parameters and the kvImageGetTempBufferSize flag, in which case the size is returned instead of an error code from the left hand side. You may pass NULL here, in which case a region of memory of similar size will be allocated by the function and freed before it returns. Temp Buffers are a way of avoiding lost time due to VM faults to initialize newly allocated buffers. If you will be calling this function repeatedly with similar parameters you should use a temp buffer. If the function is called from different threads concurrently, a different temp buffer should be used for each. @param srcOffsetToROI_X An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the left edge of the image. @param srcOffsetToROI_Y An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the top edge of the image. @param kernel A pointer to a 1D array of weights of dimension kernel_height x kernel_width. For example, for a simple 3x3 blur, it might be: <pre>@textblock const float kernel[9] = { 1./16, 2./16, 1./16, 2./16, 4./16, 2./16, 1./16, 2./16, 1./16 }; @/textblock </pre> @param kernel_height The height of the 2D table of weights passed in as kernel. It must be an odd number. @param kernel_width The width of the 2D table of weights passed in as kernel. It must be an odd number. @param bias This value is added to the sum of weighted pixels. @param backgroundColor When the kvImageBackgroundColorFill edging mode is active, the backgroundColor parameter provides the background color to be used for missing pixels when the kernel extends off the edge of the image. @param flags The following flags are allowed: <pre>@textblock kvImageCopyInPlace If any pixels covered by the kernel do no not exist, simply copy the corresponding source pixel to the destination. This will result in a ring off unconvolved content at the edges and convolved content in the middle. kvImageBackgroundColorFill Substitute in the provided background color for missing pixels. For a blur filter this will look like the edges of the image have been blurred into a particular color. This is usually appropriate when the color of the surface onto which the image will be drawn is known. You can also use {Alpha = 0, color = 0} as a background color, and let the downstream image compositor blend in the background color. In this case, the result image should be treated as a premultiplied image. kvImageEdgeExtend Substitute in the nearest defined pixel for missing pixels. This is better when the image is drawn into a frame or other context where the background is not expected to contribute to the final content. kvImageTruncateKernel This is similar to kvImageEdgeExtend, except that edge pixels are simply ignored, and the bias and divisor are adjusted accordingly. Because of the complication at the edges, this edging mode can be significantly slower than the others. It can be numerically unstable if the sum over any rectangular subsection of the kernel is zero, which can result in division by zero during the computation. The results for this edging mode are usually quite visually similar to kvImageEdgeExtend. kvImageGetTempBufferSize Instead of calculating the convolution of the image, return the size of the temp buffer needed for this set of parameters. Does not touch the src or dest image. kvImageDoNotTile Disable internal multithreading. kvImageUseFP16Accumulator Enable 16-bit half-precision floating-point arithmetic when computing the kernel averages when the CPU architecture supports it. @/textblock </pre> The first four flags listed are edging modes. One and only one edging mode must be provided. If no edging mode is provided (e.g. kvImageNoFlags), then an error will be returned. @return One of the following error codes may be returned: <pre>@textblock kvImageNoError Success. >= 0 If kvImageGetTempBufferSize is passed, this is the size of the temp buffer to use with this function and this set of parameters. kvImageInvalidEdgeStyle One and only one of the following flags must be provided: { kvImageCopyInPlace, kvImageBackgroundColorFill, kvImageEdgeExtend, kvImageTruncateKernel } kvImageRoiLargerThanInputBuffer The dest->width and height must be less than or equal to corresponding dimensions of the source buffer. kvImageInvalidOffset_X The destination width + srcOffsetToROI_X > src->width kvImageInvalidOffset_Y The destination height + srcOffsetToROI_Y > src->height kvImageNullPointerArgument kernel may not be NULL kvImageMemoryAllocationError Could not allocate memory to serve as a temp buffer. kvImageInvalidKernelSize The kernel height and width must be odd numbers. @/textblock </pre> C function: vImageConvolveWithBias_Planar16F
func VImageConvolveWithBiasPlanarF ¶
func VImageConvolveWithBiasPlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernel *float32, kernelHeight uint32, kernelWidth uint32, bias float32, backgroundColor float32, flags uint32) int
@function vImageConvolveWithBias_PlanarF @abstract General convolution on a PlanarF image with added bias. @discussion This filter applies a convolution filter of your choosing to a PlanarF image. For each pixel: <pre>@textblock for each pixel[y][x] in image{ float sum = bias; // Calculate weighted average over kernel area for each kernel_element[i][j] in kernel{ sum += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2]; } // write out result result[y][x] = sum; } @/textblock </pre> (Above, we imagine the kernel to be a 2D array of size kernel_height by kernel_width. However, in practice it is passed in as a contiguous 1D array of size kernel_height * kernel_width.) This filter does not work in place. @param src The input image @param dest A pointer to a preallocated vImage_Buffer to receive the result image. This may not alias the src image. @param tempBuffer An optional pointer to a region of memory to use as a working area during computation. The size of the tempBuffer is given by calling the function with the same parameters and the kvImageGetTempBufferSize flag, in which case the size is returned instead of an error code from the left hand side. You may pass NULL here, in which case a region of memory of similar size will be allocated by the function and freed before it returns. Temp Buffers are a way of avoiding lost time due to VM faults to initialize newly allocated buffers. If you will be calling this function repeatedly with similar parameters you should use a temp buffer. If the function is called from different threads concurrently, a different temp buffer should be used for each. @param srcOffsetToROI_X An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the left edge of the image. @param srcOffsetToROI_Y An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the top edge of the image. @param kernel A pointer to a 1D array of weights of dimension kernel_height x kernel_width. For example, for a simple 3x3 blur, it might be: <pre>@textblock const float kernel[9] = { 1./16, 2./16, 1./16, 2./16, 4./16, 2./16, 1./16, 2./16, 1./16 }; @/textblock </pre> @param kernel_height The height of the 2D table of weights passed in as kernel. It must be an odd number. @param kernel_width The width of the 2D table of weights passed in as kernel. It must be an odd number. @param bias This value is added to the sum of weighted pixels. @param backgroundColor When the kvImageBackgroundColorFill edging mode is active, the backgroundColor parameter provides the background color to be used for missing pixels when the kernel extends off the edge of the image. @param flags The following flags are allowed: <pre>@textblock kvImageCopyInPlace If any pixels covered by the kernel do no not exist, simply copy the corresponding source pixel to the destination. This will result in a ring off unconvolved content at the edges and convolved content in the middle. kvImageBackgroundColorFill Substitute in the provided background color for missing pixels. For a blur filter this will look like the edges of the image have been blurred into a particular color. This is usually appropriate when the color of the surface onto which the image will be drawn is known. You can also use {Alpha = 0, color = 0} as a background color, and let the downstream image compositor blend in the background color. In this case, the result image should be treated as a premultiplied image. kvImageEdgeExtend Substitute in the nearest defined pixel for missing pixels. This is better when the image is drawn into a frame or other context where the background is not expected to contribute to the final content. kvImageTruncateKernel This is similar to kvImageEdgeExtend, except that edge pixels are simply ignored, and the bias and divisor are adjusted accordingly. Because of the complication at the edges, this edging mode can be significantly slower than the others. It can be numerically unstable if the sum over any rectangular subsection of the kernel is zero, which can result in division by zero during the computation. The results for this edging mode are usually quite visually similar to kvImageEdgeExtend. kvImageGetTempBufferSize Instead of calculating the convolution of the image, return the size of the temp buffer needed for this set of parameters. Does not touch the src or dest image. kvImageDoNotTile Disable internal multithreading. @/textblock </pre> The first four flags listed are edging modes. One and only one edging mode must be provided. If no edging mode is provided (e.g. kvImageNoFlags), then an error will be returned. @return One of the following error codes may be returned: <pre>@textblock kvImageNoError Success. >= 0 If kvImageGetTempBufferSize is passed, this is the size of the temp buffer to use with this function and this set of parameters. kvImageInvalidEdgeStyle One and only one of the following flags must be provided: { kvImageCopyInPlace, kvImageBackgroundColorFill, kvImageEdgeExtend, kvImageTruncateKernel } kvImageRoiLargerThanInputBuffer The dest->width and height must be less than or equal to corresponding dimensions of the source buffer. kvImageInvalidOffset_X The destination width + srcOffsetToROI_X > src->width kvImageInvalidOffset_Y The destination height + srcOffsetToROI_Y > src->height kvImageNullPointerArgument kernel may not be NULL kvImageMemoryAllocationError Could not allocate memory to serve as a temp buffer. kvImageInvalidKernelSize The kernel height and width must be odd numbers. @/textblock </pre> C function: vImageConvolveWithBias_PlanarF
func VImageCopyBuffer ¶
func VImageCopyBuffer(src *VImageBuffer, dest *VImageBuffer, pixelSize uint, flags uint32) int
C function: vImageCopyBuffer
func VImageCreateCGImageFromBuffer ¶
func VImageCreateCGImageFromBuffer(buf *VImageBuffer, format *VImageCGImageFormat, callback unsafe.Pointer, userData unsafe.Pointer, flags uint32, error_ *int) unsafe.Pointer
C function: vImageCreateCGImageFromBuffer
func VImageCreateGammaFunction ¶
C function: vImageCreateGammaFunction
func VImageCreateMonochromeColorSpaceWithWhitePointAndTransferFunction ¶
func VImageCreateMonochromeColorSpaceWithWhitePointAndTransferFunction(whitePoint *VImageWhitePoint, tf *VImageTransferFunction, intent coregraphics.CGColorRenderingIntent, flags uint32, error_ *int) unsafe.Pointer
C function: vImageCreateMonochromeColorSpaceWithWhitePointAndTransferFunction
func VImageCreateRGBColorSpaceWithPrimariesAndTransferFunction ¶
func VImageCreateRGBColorSpaceWithPrimariesAndTransferFunction(primaries *VImageRGBPrimaries, tf *VImageTransferFunction, intent coregraphics.CGColorRenderingIntent, flags uint32, error_ *int) unsafe.Pointer
@function vImageCreateRGBColorSpaceWithPrimariesAndTransferFunction @abstract Create a RGB colorspace based on primitives typically found in Y'CbCr specifications @discussion This function may be used to create a CGColorSpaceRef to correspond with a given set of color primaries and transfer function. This defines a RGB colorspace. (A Y'CbCr colorspace is defined as a RGB colorspace and a conversion matrix from RGB to Y'CbCr.) The color primaries give the extent of a colorspace in x,y,z space and the transfer function gives the transformation from linear color to non-linear color that the pixels actually reside in. <pre> @textblock Example: ITU-R BT.709-5 const vImageTransferFunction f709 = { // 1.2 transfer function .c0 = 1.099, .c1 = 1.0, .c2 = 0.0, .c3 = -0.099, .gamma = 0.45, .cutoff = 0.018, .c4 = 4.5, .c5 = 0 }; const vImageRGBPrimaries p709 = { .red_x = .64, // 1.3 red .green_x = .30, // 1.3 green .blue_x = .15, // 1.3 blue .white_x = 0.3127, // 1.4 white .red_y = .33, // 1.3 red .green_y = .60, // 1.3 green .blue_y = .06, // 1.3 blue .white_y = 0.3290 // 1.4 white }; vImage_Error err = kvImageNoError; CGColorSpaceRef colorSpace = vImageCreateRGBColorSpaceWithPrimariesAndTransferFunction( &p709, &f709, kvImageNoFlags, &err ); @/textblock </pre> Other methods to create a RGB colorspace: You may find it easier to use CVImageBufferCreateColorSpaceFromAttachments or CVImageBufferGetColorSpace, in some cases. If there is enough color information attached to a CVPixelBuffer, you can also get one using vImageCVImageFormat_CreateWithCVPixelBuffer(). There are also many ways to create a RGB CGColorSpace in CoreGraphics/CGColorSpace.h. <pre> @textblock Note: This low level function does not conform to CoreVideo practice of automatically substituting gamma 1/1.961 for kCVImageBufferTransferFunction_ITU_R_709_2 and kCVImageBufferTransferFunction_SMPTE_240M_1995 instead of using the ITU-R BT.709-5 specified transfer function. (vImageBuffer_InitWithCVPixelBuffer and vImageBuffer_CopyToCVPixelBuffer do.) If you would like that behavior, you can use the following transfer function: const vImageTransferFunction f709_Apple = { .c0 = 1.0, .c1 = 1.0, .c2 = 0.0, .c3 = 0, .gamma = 1.0/1.961, .cutoff = -INFINITY, .c4 = 1, .c5 = 0 }; @/textblock </pre> @param primaries A set of x, y tristimulus values to defined the color primaries for the RGB colorspace. Here: <pre> @textblock x = X/(X+Y+Z), y = Y/(X+Y+Z) @/textblock </pre> where X, Y, and Z are from CIEXYZ. z is derived automatically from x and y. @param tf The transfer function to convert from linear RGB (using above primaries) to non-linear RGB. The transfer function here is defined in the style of ITU-R BT.709 and is the inverse operation of what appears in a ICC color profile. @param flags Currently the only flag recognized here is kvImagePrintDiagnosticsToConsole, which may be used to debug the colorspace creation when it fails. @param error May be NULL. If not NULL, a vImage_Error code is written to the memory pointed to by error to indicate success or failure of the operation. @result On success, a non-NULL RGB CGColorSpaceRef will be returned. The color space has a reference count of 1. You are responsible for releasing the colorspace when you are done with it to return the memory back to the system. If error is not NULL, kvImageNoError is written to *error. On failure, NULL will be returned and one of the following errors is written to *error if error is non-NULL: <pre> @textblock Errors: kvImageInvalidParameter tf->gamma = 0 (transfer function is not round-trippable) kvImageInvalidParameter primaries define XYZ <-> RGB matrix which is not invertible @/textblock </pre> C function: vImageCreateRGBColorSpaceWithPrimariesAndTransferFunction
func VImageDestroyGammaFunction ¶
C function: vImageDestroyGammaFunction
func VImageDestroyResamplingFilter ¶
C function: vImageDestroyResamplingFilter
func VImageDilateARGB8888 ¶
func VImageDilateARGB8888(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernel *uint8, kernelHeight uint, kernelWidth uint, flags uint32) int
@function vImageDilate_ARGB8888 @abstract Apply a dilate filter to a ARGB8888 image @discussion This is a general purpose dilate filter for ARGB8888 data. If your filter is all 0's, you should use vImageMax_ARGB8888 instead. <pre> @textblock for each pixel result[i][j] in the image{ int a = 0; int r = 0; int g = 0; int b = 0; for( y = 0; y < kernel_height; y++ ){ for( x = 0; x < kernel_width; x++ ){ a = MAX( a, src[i+y-kernel_height/2]j+x-kernel_width/2[0] - k[y*kernel_width+x] ) r = MAX( r, src[i+y-kernel_height/2]j+x-kernel_width/2[1] - k[y*kernel_width+x] ) g = MAX( g, src[i+y-kernel_height/2]j+x-kernel_width/2[2] - k[y*kernel_width+x] ) b = MAX( b, src[i+y-kernel_height/2]j+x-kernel_width/2[3] - k[y*kernel_width+x] ) } } // normalize for kernel center not 0 a += k[y * (kernel_height/2) * kernel_width + kernel_width/2 ]; r += k[y * (kernel_height/2) * kernel_width + kernel_width/2 ]; g += k[y * (kernel_height/2) * kernel_width + kernel_width/2 ]; b += k[y * (kernel_height/2) * kernel_width + kernel_width/2 ]; // saturate overflow to representable range result[i][j][0] = (flags & kvImageLeaveAlphaUnchanged) ? src[i][j] : CLIP( a ); result[i][j][1] = CLIP( r ); result[i][j][2] = CLIP( g ); result[i][j][3] = CLIP( b ); } @/textblock </pre> If only part of the dilate filter of the entire image is desired, use srcOffsetToROI_X/Y to set the positioning of the result tile relative to the src image. Does not work in place. If kvImageLeaveAlphaUnchanged is not used, it works for any channel order. If kvImageLeaveAlphaUnchanged is used, then the alpha must be first. @param src The input image @param dest A preallocated buffer to contain the result image @param srcOffsetToROI_X An offset added to the horizontal position in the src image when calculating the dilate filter. It allows the dilate filter to operate in a tiled fashion for tiles that do not start on the left edge of the source image. @param srcOffsetToROI_Y An offset added to the vertical position in the src image when calculating the dilate filter. It allows the dilate filter to operate in a tiled fashion for tiles that do not start on the top edge of the source image. @param kernel A pointer to a array of filter values of dimension kernel_height x kernel_width. @param kernel_height The height of the rectangular kernel. Must be an odd number. @param kernel_width The width of the rectangular kernel. Must be an odd number. @param flags The following flags values are allowed: <pre> @textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading. Useful if, for example, you are doing your own multithreading and just want the filter to run local to the current thread. kvImageGetTempBufferSize Return 0. Do no work. kvImageLeaveAlphaUnchanged The alpha channel (first byte of pixel in memory) is copied to the destination without modification, instead of having a dilate filter applied to it. @/textblock </pre> @return The following error codes may result: <pre> @textblock kvImageNoError Success. 0 If kvImageGetTempBufferSize was among the flags, then no work was done. kvImageRoiLargerThanInputBuffer dest->width and dest->height must be less than or equal to the corresponding dimensions in the src image kvImageInvalidKernelSize The kernel_height and kernel_width must not be evenly divisible by 2. @/textblock </pre> C function: vImageDilate_ARGB8888
func VImageDilateARGBFFFF ¶
func VImageDilateARGBFFFF(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernel *float32, kernelHeight uint, kernelWidth uint, flags uint32) int
@function vImageDilate_ARGBFFFF @abstract Apply a dilate filter to a ARGBFFFF image @discussion This is a general purpose dilate filter for ARGBFFFF data. If your filter is all 0's, you should use vImageMax_ARGBFFFF instead. <pre> @textblock for each pixel result[i][j] in the image{ float a = -INFINITY; float r = -INFINITY; float g = -INFINITY; float b = -INFINITY; for( y = 0; y < kernel_height; y++ ){ for( x = 0; x < kernel_width; x++ ){ a = MAX( a, src[i+y-kernel_height/2]j+x-kernel_width/2[0] - k[y*kernel_width+x] ) r = MAX( r, src[i+y-kernel_height/2]j+x-kernel_width/2[1] - k[y*kernel_width+x] ) g = MAX( g, src[i+y-kernel_height/2]j+x-kernel_width/2[2] - k[y*kernel_width+x] ) b = MAX( b, src[i+y-kernel_height/2]j+x-kernel_width/2[3] - k[y*kernel_width+x] ) } } // normalize for kernel center not 0 a += k[y * (kernel_height/2) * kernel_width + kernel_width/2 ]; r += k[y * (kernel_height/2) * kernel_width + kernel_width/2 ]; g += k[y * (kernel_height/2) * kernel_width + kernel_width/2 ]; b += k[y * (kernel_height/2) * kernel_width + kernel_width/2 ]; // saturate overflow to representable range result[i][j][0] = (flags & kvImageLeaveAlphaUnchanged) ? src[i][j] : a; result[i][j][1] = r; result[i][j][2] = g; result[i][j][3] = b; } @/textblock </pre> If only part of the dilate filter of the entire image is desired, use srcOffsetToROI_X/Y to set the positioning of the result tile relative to the src image. Does not work in place. If kvImageLeaveAlphaUnchanged is not used, it works for any channel order. If kvImageLeaveAlphaUnchanged is used, then the alpha must be first. Floating-point values have host endianness. @param src The input image @param dest A preallocated buffer to contain the result image @param srcOffsetToROI_X An offset added to the horizontal position in the src image when calculating the dilate filter. It allows the dilate filter to operate in a tiled fashion for tiles that do not start on the left edge of the source image. @param srcOffsetToROI_Y An offset added to the vertical position in the src image when calculating the dilate filter. It allows the dilate filter to operate in a tiled fashion for tiles that do not start on the top edge of the source image. @param kernel A pointer to a array of filter values of dimension kernel_height x kernel_width. @param kernel_height The height of the rectangular kernel. Must be an odd number. @param kernel_width The width of the rectangular kernel. Must be an odd number. @param flags The following flags values are allowed: <pre> @textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading. Useful if, for example, you are doing your own multithreading and just want the filter to run local to the current thread. kvImageGetTempBufferSize Return 0. Do no work. kvImageLeaveAlphaUnchanged The alpha channel (first float in pixel in memory) is copied to the destination without modification, instead of having a dilate filter applied to it. @/textblock </pre> @return The following error codes may result: <pre> @textblock kvImageNoError Success. 0 If kvImageGetTempBufferSize was among the flags, then no work was done. kvImageRoiLargerThanInputBuffer dest->width and dest->height must be less than or equal to the corresponding dimensions in the src image kvImageInvalidKernelSize The kernel_height and kernel_width must not be evenly divisible by 2. @/textblock </pre> C function: vImageDilate_ARGBFFFF
func VImageDilatePlanar8 ¶
func VImageDilatePlanar8(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernel *uint8, kernelHeight uint, kernelWidth uint, flags uint32) int
@function vImageDilate_Planar8 @abstract Apply a dilate filter to a Planar8 image @discussion This is a general purpose dilate filter for Planar8 data. It is optimized to handle the special cases that occur in image masks -- large contiguous regions of all 0xff or 0x0. If your filter is all 0's, you should use vImageMax_Planar8 instead. <pre> @textblock for each pixel result[i][j] in the image{ int r = 0; for( y = 0; y < kernel_height; y++ ){ for( x = 0; x < kernel_width; x++ ){ r = MAX( r, src[i+y-kernel_height/2]j+x-kernel_width/2 - k[y*kernel_width+x] ) } } // normalize for kernel center not 0 r += k[y * (kernel_height/2) * kernel_width + kernel_width/2 ]; // saturate overflow to representable range result[i][j] = CLIP( r ); } @/textblock </pre> If only part of the dilate filter of the entire image is desired, use srcOffsetToROI_X/Y to set the positioning of the result tile relative to the src image. Does not work in place. @param src The input image @param dest A preallocated buffer to contain the result image @param srcOffsetToROI_X An offset added to the horizontal position in the src image when calculating the dilate filter. It allows the dilate filter to operate in a tiled fashion for tiles that do not start on the left edge of the source image. @param srcOffsetToROI_Y An offset added to the vertical position in the src image when calculating the dilate filter. It allows the dilate filter to operate in a tiled fashion for tiles that do not start on the top edge of the source image. @param kernel A pointer to a array of filter values of dimension kernel_height x kernel_width. @param kernel_height The height of the rectangular kernel. Must be an odd number. @param kernel_width The width of the rectangular kernel. Must be an odd number. @param flags The following flags values are allowed: <pre> @textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading. Useful if, for example, you are doing your own multithreading and just want the filter to run local to the current thread. kvImageGetTempBufferSize Return 0. Do no work. @/textblock </pre> @return The following error codes may result: <pre> @textblock kvImageNoError Success. 0 If kvImageGetTempBufferSize was among the flags, then no work was done. kvImageRoiLargerThanInputBuffer dest->width and dest->height must be less than or equal to the corresponding dimensions in the src image kvImageInvalidKernelSize The kernel_height and kernel_width must not be evenly divisible by 2. @/textblock </pre> C function: vImageDilate_Planar8
func VImageDilatePlanarF ¶
func VImageDilatePlanarF(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernel *float32, kernelHeight uint, kernelWidth uint, flags uint32) int
@function vImageDilate_PlanarF @abstract Apply a dilate filter to a PlanarF image @discussion This is a general purpose dilate filter for Planar8 data. If your filter is all 0's, you should use vImageMax_PlanarF instead. <pre> @textblock for each pixel result[i][j] in the image{ float r = -INFINITY; for( y = 0; y < kernel_height; y++ ){ for( x = 0; x < kernel_width; x++ ){ r = MAX( r, src[i+y-kernel_height/2]j+x-kernel_width/2 - k[y*kernel_width+x] ) } } // normalize for kernel center not 0 r += k[y * (kernel_height/2) * kernel_width + kernel_width/2 ]; // saturate overflow to representable range result[i][j] = r; } @/textblock </pre> If only part of the dilate filter of the entire image is desired, use srcOffsetToROI_X/Y to set the positioning of the result tile relative to the src image. Does not work in place. Floating-point values have host endianness. @param src The input image @param dest A preallocated buffer to contain the result image @param srcOffsetToROI_X An offset added to the horizontal position in the src image when calculating the dilate filter. It allows the dilate filter to operate in a tiled fashion for tiles that do not start on the left edge of the source image. @param srcOffsetToROI_Y An offset added to the vertical position in the src image when calculating the dilate filter. It allows the dilate filter to operate in a tiled fashion for tiles that do not start on the top edge of the source image. @param kernel A pointer to a array of filter values of dimension kernel_height x kernel_width. @param kernel_height The height of the rectangular kernel. Must be an odd number. @param kernel_width The width of the rectangular kernel. Must be an odd number. @param flags The following flags values are allowed: <pre> @textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading. Useful if, for example, you are doing your own multithreading and just want the filter to run local to the current thread. kvImageGetTempBufferSize Return 0. Do no work. @/textblock </pre> @return The following error codes may result: <pre> @textblock kvImageNoError Success. 0 If kvImageGetTempBufferSize was among the flags, then no work was done. kvImageRoiLargerThanInputBuffer dest->width and dest->height must be less than or equal to the corresponding dimensions in the src image kvImageInvalidKernelSize The kernel_height and kernel_width must not be evenly divisible by 2. @/textblock </pre> C function: vImageDilate_PlanarF
func VImageEndsInContrastStretchARGB8888 ¶
func VImageEndsInContrastStretchARGB8888(src *VImageBuffer, dest *VImageBuffer, percentLow *uint32, percentHigh *uint32, flags uint32) int
C function: vImageEndsInContrastStretch_ARGB8888
func VImageEndsInContrastStretchARGBFFFF ¶
func VImageEndsInContrastStretchARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, percentLow *uint32, percentHigh *uint32, histogramEntries uint, minVal float32, maxVal float32, flags uint32) int
C function: vImageEndsInContrastStretch_ARGBFFFF
func VImageEndsInContrastStretchPlanar8 ¶
func VImageEndsInContrastStretchPlanar8(src *VImageBuffer, dest *VImageBuffer, percentLow uint, percentHigh uint, flags uint32) int
C function: vImageEndsInContrastStretch_Planar8
func VImageEndsInContrastStretchPlanarF ¶
func VImageEndsInContrastStretchPlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, percentLow uint, percentHigh uint, histogramEntries uint, minVal float32, maxVal float32, flags uint32) int
C function: vImageEndsInContrastStretch_PlanarF
func VImageEqualizationARGB8888 ¶
func VImageEqualizationARGB8888(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageEqualization_ARGB8888
func VImageEqualizationARGBFFFF ¶
func VImageEqualizationARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, histogramEntries uint, minVal float32, maxVal float32, flags uint32) int
C function: vImageEqualization_ARGBFFFF
func VImageEqualizationPlanar8 ¶
func VImageEqualizationPlanar8(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageEqualization_Planar8
func VImageEqualizationPlanarF ¶
func VImageEqualizationPlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, histogramEntries uint, minVal float32, maxVal float32, flags uint32) int
C function: vImageEqualization_PlanarF
func VImageErodeARGB8888 ¶
func VImageErodeARGB8888(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernel *uint8, kernelHeight uint, kernelWidth uint, flags uint32) int
@function vImageErode_ARGB8888 @abstract Apply a erode filter to a ARGB8888 image @discussion This is a general purpose erode filter for ARGB8888 data. If your filter is all 0's, you should use vImageMin_ARGB8888 instead. <pre> @textblock for each pixel result[i][j] in the image{ int a = 255; int r = 255; int g = 255; int b = 255; for( y = 0; y < kernel_height; y++ ){ for( x = 0; x < kernel_width; x++ ){ a = MIN( a, src[i+y-kernel_height/2]j+x-kernel_width/2[0] - k[y*kernel_width+x] ) r = MIN( r, src[i+y-kernel_height/2]j+x-kernel_width/2[1] - k[y*kernel_width+x] ) g = MIN( g, src[i+y-kernel_height/2]j+x-kernel_width/2[2] - k[y*kernel_width+x] ) b = MIN( b, src[i+y-kernel_height/2]j+x-kernel_width/2[3] - k[y*kernel_width+x] ) } } // normalize for kernel center not 0 a += k[y * (kernel_height/2) * kernel_width + kernel_width/2 ]; r += k[y * (kernel_height/2) * kernel_width + kernel_width/2 ]; g += k[y * (kernel_height/2) * kernel_width + kernel_width/2 ]; b += k[y * (kernel_height/2) * kernel_width + kernel_width/2 ]; // saturate overflow to representable range result[i][j][0] = (flags & kvImageLeaveAlphaUnchanged) ? src[i][j] : CLIP( a ); result[i][j][1] = CLIP( r ); result[i][j][2] = CLIP( g ); result[i][j][3] = CLIP( b ); } @/textblock </pre> If only part of the erode filter of the entire image is desired, use srcOffsetToROI_X/Y to set the positioning of the result tile relative to the src image. Does not work in place. If kvImageLeaveAlphaUnchanged is not used, it works for any channel order. If kvImageLeaveAlphaUnchanged is used, then the alpha must be first. @param src The input image @param dest A preallocated buffer to contain the result image @param srcOffsetToROI_X An offset added to the horizontal position in the src image when calculating the erode filter. It allows the erode filter to operate in a tiled fashion for tiles that do not start on the left edge of the source image. @param srcOffsetToROI_Y An offset added to the vertical position in the src image when calculating the erode filter. It allows the erode filter to operate in a tiled fashion for tiles that do not start on the top edge of the source image. @param kernel A pointer to a array of filter values of dimension kernel_height x kernel_width. @param kernel_height The height of the rectangular kernel. Must be an odd number. @param kernel_width The width of the rectangular kernel. Must be an odd number. @param flags The following flags values are allowed: <pre> @textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading. Useful if, for example, you are doing your own multithreading and just want the filter to run local to the current thread. kvImageGetTempBufferSize Return 0. Do no work. kvImageLeaveAlphaUnchanged The alpha channel (first byte of pixel in memory) is copied to the destination without modification, instead of having a erode filter applied to it. @/textblock </pre> @return The following error codes may result: <pre> @textblock kvImageNoError Success. 0 If kvImageGetTempBufferSize was among the flags, then no work was done. kvImageRoiLargerThanInputBuffer dest->width and dest->height must be less than or equal to the corresponding dimensions in the src image kvImageInvalidKernelSize The kernel_height and kernel_width must not be evenly divisible by 2. @/textblock </pre> C function: vImageErode_ARGB8888
func VImageErodeARGBFFFF ¶
func VImageErodeARGBFFFF(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernel *float32, kernelHeight uint, kernelWidth uint, flags uint32) int
@function vImageErode_ARGBFFFF @abstract Apply a erode filter to a ARGBFFFF image @discussion This is a general purpose erode filter for ARGBFFFF data. If your filter is all 0's, you should use vImageMin_ARGBFFFF instead. <pre> @textblock for each pixel result[i][j] in the image{ float a = INFINITY; float r = INFINITY; float g = INFINITY; float b = INFINITY; for( y = 0; y < kernel_height; y++ ){ for( x = 0; x < kernel_width; x++ ){ a = MIN( a, src[i+y-kernel_height/2]j+x-kernel_width/2[0] - k[y*kernel_width+x] ) r = MIN( r, src[i+y-kernel_height/2]j+x-kernel_width/2[1] - k[y*kernel_width+x] ) g = MIN( g, src[i+y-kernel_height/2]j+x-kernel_width/2[2] - k[y*kernel_width+x] ) b = MIN( b, src[i+y-kernel_height/2]j+x-kernel_width/2[3] - k[y*kernel_width+x] ) } } // normalize for kernel center not 0 a += k[y * (kernel_height/2) * kernel_width + kernel_width/2 ]; r += k[y * (kernel_height/2) * kernel_width + kernel_width/2 ]; g += k[y * (kernel_height/2) * kernel_width + kernel_width/2 ]; b += k[y * (kernel_height/2) * kernel_width + kernel_width/2 ]; // saturate overflow to representable range result[i][j][0] = (flags & kvImageLeaveAlphaUnchanged) ? src[i][j] : a; result[i][j][1] = r; result[i][j][2] = g; result[i][j][3] = b; } @/textblock </pre> If only part of the erode filter of the entire image is desired, use srcOffsetToROI_X/Y to set the positioning of the result tile relative to the src image. Does not work in place. If kvImageLeaveAlphaUnchanged is not used, it works for any channel order. If kvImageLeaveAlphaUnchanged is used, then the alpha must be first. Floating-point values have host endianness. @param src The input image @param dest A preallocated buffer to contain the result image @param srcOffsetToROI_X An offset added to the horizontal position in the src image when calculating the erode filter. It allows the erode filter to operate in a tiled fashion for tiles that do not start on the left edge of the source image. @param srcOffsetToROI_Y An offset added to the vertical position in the src image when calculating the erode filter. It allows the erode filter to operate in a tiled fashion for tiles that do not start on the top edge of the source image. @param kernel A pointer to a array of filter values of dimension kernel_height x kernel_width. @param kernel_height The height of the rectangular kernel. Must be an odd number. @param kernel_width The width of the rectangular kernel. Must be an odd number. @param flags The following flags values are allowed: <pre> @textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading. Useful if, for example, you are doing your own multithreading and just want the filter to run local to the current thread. kvImageGetTempBufferSize Return 0. Do no work. kvImageLeaveAlphaUnchanged The alpha channel (first float in pixel in memory) is copied to the destination without modification, instead of having a erode filter applied to it. @/textblock </pre> @return The following error codes may result: <pre> @textblock kvImageNoError Success. 0 If kvImageGetTempBufferSize was among the flags, then no work was done. kvImageRoiLargerThanInputBuffer dest->width and dest->height must be less than or equal to the corresponding dimensions in the src image kvImageInvalidKernelSize The kernel_height and kernel_width must not be evenly divisible by 2. @/textblock </pre> C function: vImageErode_ARGBFFFF
func VImageErodePlanar8 ¶
func VImageErodePlanar8(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernel *uint8, kernelHeight uint, kernelWidth uint, flags uint32) int
@function vImageErode_Planar8 @abstract Apply a erode filter to a Planar8 image @discussion This is a general purpose erode filter for Planar8 data. If your filter is all 0's, you should use vImageMin_Planar8 instead. <pre> @textblock for each pixel result[i][j] in the image{ int r = MAX_CHANNEL_VALUE; for( y = 0; y < kernel_height; y++ ){ for( x = 0; x < kernel_width; x++ ){ r = MIN( r, src[i+y-kernel_height/2]j+x-kernel_width/2 - k[y*kernel_width+x] ) } } // normalize for kernel center not 0 r += k[y * (kernel_height/2) * kernel_width + kernel_width/2 ]; // saturate overflow to representable range result[i][j] = CLIP( r ); } @/textblock </pre> If only part of the erode filter of the entire image is desired, use srcOffsetToROI_X/Y to set the positioning of the result tile relative to the src image. Does not work in place. @param src The input image @param dest A preallocated buffer to contain the result image @param srcOffsetToROI_X An offset added to the horizontal position in the src image when calculating the erode filter. It allows the erode filter to operate in a tiled fashion for tiles that do not start on the left edge of the source image. @param srcOffsetToROI_Y An offset added to the vertical position in the src image when calculating the erode filter. It allows the erode filter to operate in a tiled fashion for tiles that do not start on the top edge of the source image. @param kernel A pointer to a array of filter values of dimension kernel_height x kernel_width. @param kernel_height The height of the rectangular kernel. Must be an odd number. @param kernel_width The width of the rectangular kernel. Must be an odd number. @param flags The following flags values are allowed: <pre> @textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading. Useful if, for example, you are doing your own multithreading and just want the filter to run local to the current thread. kvImageGetTempBufferSize Return 0. Do no work. @/textblock </pre> @return The following error codes may result: <pre> @textblock kvImageNoError Success. 0 If kvImageGetTempBufferSize was among the flags, then no work was done. kvImageRoiLargerThanInputBuffer dest->width and dest->height must be less than or equal to the corresponding dimensions in the src image kvImageInvalidKernelSize The kernel_height and kernel_width must not be evenly divisible by 2. @/textblock </pre> C function: vImageErode_Planar8
func VImageErodePlanarF ¶
func VImageErodePlanarF(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernel *float32, kernelHeight uint, kernelWidth uint, flags uint32) int
@function vImageErode_PlanarF @abstract Apply a erode filter to a PlanarF image @discussion This is a general purpose erode filter for Planar8 data. If your filter is all 0's, you should use vImageMin_PlanarF instead. <pre> @textblock for each pixel result[i][j] in the image{ float r = INFINITY; for( y = 0; y < kernel_height; y++ ){ for( x = 0; x < kernel_width; x++ ){ r = MIN( r, src[i+y-kernel_height/2]j+x-kernel_width/2 - k[y*kernel_width+x] ) } } // normalize for kernel center not 0 r += k[y * (kernel_height/2) * kernel_width + kernel_width/2 ]; // saturate overflow to representable range result[i][j] = r; } @/textblock </pre> If only part of the erode filter of the entire image is desired, use srcOffsetToROI_X/Y to set the positioning of the result tile relative to the src image. Does not work in place. Floating-point values have host endianness. @param src The input image @param dest A preallocated buffer to contain the result image @param srcOffsetToROI_X An offset added to the horizontal position in the src image when calculating the erode filter. It allows the erode filter to operate in a tiled fashion for tiles that do not start on the left edge of the source image. @param srcOffsetToROI_Y An offset added to the vertical position in the src image when calculating the erode filter. It allows the erode filter to operate in a tiled fashion for tiles that do not start on the top edge of the source image. @param kernel A pointer to a array of filter values of dimension kernel_height x kernel_width. @param kernel_height The height of the rectangular kernel. Must be an odd number. @param kernel_width The width of the rectangular kernel. Must be an odd number. @param flags The following flags values are allowed: <pre> @textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading. Useful if, for example, you are doing your own multithreading and just want the filter to run local to the current thread. kvImageGetTempBufferSize Return 0. Do no work. @/textblock </pre> @return The following error codes may result: <pre> @textblock kvImageNoError Success. 0 If kvImageGetTempBufferSize was among the flags, then no work was done. kvImageRoiLargerThanInputBuffer dest->width and dest->height must be less than or equal to the corresponding dimensions in the src image kvImageInvalidKernelSize The kernel_height and kernel_width must not be evenly divisible by 2. @/textblock </pre> C function: vImageErode_PlanarF
func VImageExtractChannelARGB16U ¶
func VImageExtractChannelARGB16U(src *VImageBuffer, dest *VImageBuffer, channelIndex int, flags uint32) int
@function vImageExtractChannel_ARGB16U @abstract Extract one channel from a 4-channel interleaved 16-bit per component buffer. @discussion vImageExtractChannel_ARGB16U reads one component from the four channel 16-bit per component buffer and writes it into a Planar16U buffer. Since this just copies data around, the data may be any 16-bit per component data type, including signed 16 bit integers and half-precision floating point, of any endianness. Likewise, the channel order does not need to be ARGB. RGBA, BGRA, CMYK, etc. all work. For each pixel i in src: @code Pixel_ARGB_16U *src_pixel; Pixel_16U *dest_pixel; dest_pixel[i] = src_pixel[i][channelIndex]; @endcode @param src A valid pointer to a vImage_Buffer struct which describes a 16-bit per component, four channel buffer. It does not have to be ARGB16U. It can be BGRA, RGBA, CMYK, etc. The data can be any 16-bit per component type such as int16_t or half-precision floating-point. Data must be at least 2-byte aligned. @param dest A valid pointer to a vImage_Buffer struct which describes a 16-bit per component, one channel buffer. The buffer pointed to by dest should be allocated by you. It will be overwritten with one of the channels. This function does work in place, so long as the rowBytes is the same for src and dest images and the start address also matches. The data returned will be in the same format (uint16_t, int16_t, half-float, etc.) as the data provided in the src format, except that only a single channel is present. Data must be at least 2-byte aligned. @param channelIndex The index of the channel to extract. For alpha in a ARGB image, this is 0. For alpha in a BGRA image, this is 3. @param flags The following flags are allowed: kvImageDoNotTile, kvImageGetTempBufferSize, kvImageNoFlags, kvImagePrintDiagnosticsToConsole @result kvImageNoError Success. However, see also 0 below, if the kvImageGetTempBufferSize flag is passed. @result 0 If the kvImageGetTempBufferSize flag is passed, this function returns 0 and does no work. @result kvImageRoiLargerThanInputBuffer The destination height or width is larger than the src height or width, respectively. @result kvImageUnknownFlagsBit A flag was used which was not among the approved set of flags. See flags param description above. @result kvImageInvalidParameter channelIndex must be in the range [0,3] C function: vImageExtractChannel_ARGB16U
func VImageExtractChannelARGB8888 ¶
func VImageExtractChannelARGB8888(src *VImageBuffer, dest *VImageBuffer, channelIndex int, flags uint32) int
@function vImageExtractChannel_ARGB8888 @abstract Extract one channel from a 4-channel interleaved 8-bit per component buffer @discussion This is the opposite operation from vImageOverwriteChannels_ARGB8888. It reads one component from the four channel 8-bit per component buffer and writes it into a Planar8 buffer. For each pixel i in src: @code Pixel_8888 *src_pixel; Pixel_8 *dest_pixel; dest_pixel[i] = src_pixel[i][channelIndex]; @endcode @param src A valid pointer to a vImage_Buffer struct which describes a 8-bit per component, four channel buffer. It does not have to be ARGB8888. It can be BGRA, RGBA, CMYK, etc. @param dest A valid pointer to a vImage_Buffer struct which describes a 8-bit per component, one channel buffer. The buffer pointed to by dest should be allocated by you. It will be overwritten with one of the channels. This function does work in place, so long as the rowBytes is the same for src and dest images and the start address also matches. @param channelIndex The index of the channel to extract. For alpha in a ARGB image, this is 0. For alpha in a BGRA image, this is 3. @param flags \p kvImageDoNotTile \p kvImageGetTempBufferSize \p kvImagePrintDiagnosticsToConsole @return \p kvImageNoError Success. However, see also 0 below, if the kvImageGetTempBufferSize flag is passed. @return \p 0 If the kvImageGetTempBufferSize flag is passed, this function returns 0 and does no work. @return \p kvImageRoiLargerThanInputBuffer The destination height or width is larger than the src height or width, respectively. @return \p kvImageUnknownFlagsBit A flag was used which was not among the approved set of flags. See flags param description above. @return \p kvImageInvalidParameter channelIndex must be in the range [0,3] C function: vImageExtractChannel_ARGB8888
func VImageExtractChannelARGBFFFF ¶
func VImageExtractChannelARGBFFFF(src *VImageBuffer, dest *VImageBuffer, channelIndex int, flags uint32) int
@function vImageExtractChannel_ARGBFFFF @abstract Extract one channel from a 4-channel interleaved 32-bit per component buffer @discussion This is the opposite operation from vImageOverwriteChannels_ARGBFFFF. It reads one component from the four channel 32-bit per component buffer and writes it into a PlanarF buffer. NaNs and and sNaNs are not modified. Sign of zero shall be preserved. For each pixel i in src: @code Pixel_FFFF *src_pixel; Pixel_F *dest_pixel; dest_pixel[i] = src_pixel[i][channelIndex]; @endcode @param src A valid pointer to a vImage_Buffer struct which describes a 32-bit per component, four channel buffer. It does not have to be ARGBFFFF. It can be BGRA, RGBA, CMYK, etc. of any endianness. Data must be at least 4-byte aligned. @param dest A valid pointer to a vImage_Buffer struct which describes a 32-bit per component, one channel buffer. The buffer pointed to by dest should be allocated by you. It will be overwritten with one of the channels. This function does work in place, so long as the rowBytes is the same for src and dest images and the start address also matches. Data must be at least 4 byte aligned. @param channelIndex The index of the channel to extract. For alpha in a ARGB image, this is 0. For alpha in a BGRA image, this is 3. @param flags The following flags are allowed: kvImageDoNotTile, kvImageGetTempBufferSize, kvImageNoFlags, kvImagePrintDiagnosticsToConsole @result kvImageNoError Success. However, see also 0 below, if the kvImageGetTempBufferSize flag is passed. @result 0 If the kvImageGetTempBufferSize flag is passed, this function returns 0 and does no work. @result kvImageRoiLargerThanInputBuffer The destination height or width is larger than the src height or width, respectively. @result kvImageUnknownFlagsBit A flag was used which was not among the approved set of flags. See flags param description above. @result kvImageInvalidParameter channelIndex must be in the range [0,3] C function: vImageExtractChannel_ARGBFFFF
func VImageFlattenARGB16Q12 ¶
func VImageFlattenARGB16Q12(argbSrc *VImageBuffer, argbDst *VImageBuffer, argbBackgroundColorPtr *int16, isImagePremultiplied bool, flags uint32) int
C function: vImageFlatten_ARGB16Q12
func VImageFlattenARGB16U ¶
func VImageFlattenARGB16U(argbSrc *VImageBuffer, argbDst *VImageBuffer, argbBackgroundColorPtr *uint16, isImagePremultiplied bool, flags uint32) int
C function: vImageFlatten_ARGB16U
func VImageFlattenARGB8888 ¶
func VImageFlattenARGB8888(argbSrc *VImageBuffer, argbDst *VImageBuffer, argbBackgroundColorPtr *uint8, isImagePremultiplied bool, flags uint32) int
C function: vImageFlatten_ARGB8888
func VImageFlattenARGB8888ToRGB888 ¶
func VImageFlattenARGB8888ToRGB888(arg *VImageBuffer, arg2 *VImageBuffer, arg3 *uint8, arg4 bool, arg5 uint32) int
C function: vImageFlatten_ARGB8888ToRGB888
func VImageFlattenARGBFFFF ¶
func VImageFlattenARGBFFFF(argbSrc *VImageBuffer, argbDst *VImageBuffer, argbBackgroundColorPtr *float32, isImagePremultiplied bool, flags uint32) int
C function: vImageFlatten_ARGBFFFF
func VImageFlattenARGBFFFFToRGBFFF ¶
func VImageFlattenARGBFFFFToRGBFFF(arg *VImageBuffer, arg2 *VImageBuffer, arg3 *float32, arg4 bool, arg5 uint32) int
C function: vImageFlatten_ARGBFFFFToRGBFFF
func VImageFlattenBGRA8888ToRGB888 ¶
func VImageFlattenBGRA8888ToRGB888(arg *VImageBuffer, arg2 *VImageBuffer, arg3 *uint8, arg4 bool, arg5 uint32) int
C function: vImageFlatten_BGRA8888ToRGB888
func VImageFlattenBGRAFFFFToRGBFFF ¶
func VImageFlattenBGRAFFFFToRGBFFF(arg *VImageBuffer, arg2 *VImageBuffer, arg3 *float32, arg4 bool, arg5 uint32) int
C function: vImageFlatten_BGRAFFFFToRGBFFF
func VImageFlattenRGBA16Q12 ¶
func VImageFlattenRGBA16Q12(argbSrc *VImageBuffer, argbDst *VImageBuffer, argbBackgroundColorPtr *int16, isImagePremultiplied bool, flags uint32) int
C function: vImageFlatten_RGBA16Q12
func VImageFlattenRGBA16U ¶
func VImageFlattenRGBA16U(rgbaSrc *VImageBuffer, rgbaDst *VImageBuffer, rgbaBackgroundColorPtr *uint16, isImagePremultiplied bool, flags uint32) int
C function: vImageFlatten_RGBA16U
func VImageFlattenRGBA8888 ¶
func VImageFlattenRGBA8888(rgbaSrc *VImageBuffer, rgbaDst *VImageBuffer, rgbaBackgroundColorPtr *uint8, isImagePremultiplied bool, flags uint32) int
C function: vImageFlatten_RGBA8888
func VImageFlattenRGBA8888ToRGB888 ¶
func VImageFlattenRGBA8888ToRGB888(arg *VImageBuffer, arg2 *VImageBuffer, arg3 *uint8, arg4 bool, arg5 uint32) int
C function: vImageFlatten_RGBA8888ToRGB888
func VImageFlattenRGBAFFFF ¶
func VImageFlattenRGBAFFFF(rgbaSrc *VImageBuffer, rgbaDst *VImageBuffer, rgbaBackgroundColorPtr *float32, isImagePremultiplied bool, flags uint32) int
C function: vImageFlatten_RGBAFFFF
func VImageFlattenRGBAFFFFToRGBFFF ¶
func VImageFlattenRGBAFFFFToRGBFFF(arg *VImageBuffer, arg2 *VImageBuffer, arg3 *float32, arg4 bool, arg5 uint32) int
C function: vImageFlatten_RGBAFFFFToRGBFFF
func VImageFloodFillARGB16U ¶
func VImageFloodFillARGB16U(srcDest *VImageBuffer, tempBuffer unsafe.Pointer, seedX uint, seedY uint, newValue *uint16, connectivity int, flags uint32) int
C function: vImageFloodFill_ARGB16U
func VImageFloodFillARGB8888 ¶
func VImageFloodFillARGB8888(srcDest *VImageBuffer, tempBuffer unsafe.Pointer, seedX uint, seedY uint, newValue *uint8, connectivity int, flags uint32) int
C function: vImageFloodFill_ARGB8888
func VImageFloodFillPlanar8 ¶
func VImageFloodFillPlanar8(srcDest *VImageBuffer, tempBuffer unsafe.Pointer, seedX uint, seedY uint, newValue uint8, connectivity int, flags uint32) int
C function: vImageFloodFill_Planar8
func VImageFloodFillPlanar16U ¶
func VImageFloodFillPlanar16U(srcDest *VImageBuffer, tempBuffer unsafe.Pointer, seedX uint, seedY uint, newValue uint16, connectivity int, flags uint32) int
C function: vImageFloodFill_Planar16U
func VImageGammaPlanar8toPlanarF ¶
func VImageGammaPlanar8toPlanarF(src *VImageBuffer, dest *VImageBuffer, gamma unsafe.Pointer, flags uint32) int
C function: vImageGamma_Planar8toPlanarF
func VImageGammaPlanarF ¶
func VImageGammaPlanarF(src *VImageBuffer, dest *VImageBuffer, gamma unsafe.Pointer, flags uint32) int
C function: vImageGamma_PlanarF
func VImageGammaPlanarFtoPlanar8 ¶
func VImageGammaPlanarFtoPlanar8(src *VImageBuffer, dest *VImageBuffer, gamma unsafe.Pointer, flags uint32) int
C function: vImageGamma_PlanarFtoPlanar8
func VImageGetPerspectiveWarp ¶
func VImageGetPerspectiveWarp(srcPoints unsafe.Pointer, destPoints unsafe.Pointer, transform *VImagePerpsectiveTransform, flags uint32) int
C function: vImageGetPerspectiveWarp
func VImageGetResamplingFilterExtent ¶
C function: vImageGetResamplingFilterExtent
func VImageGetResamplingFilterSize ¶
func VImageGetResamplingFilterSize(scale float32, kernelFunc unsafe.Pointer, kernelWidth float32, flags uint32) uint
C function: vImageGetResamplingFilterSize
func VImageHistogramCalculationARGB8888 ¶
func VImageHistogramCalculationARGB8888(src *VImageBuffer, histogram *uint, flags uint32) int
C function: vImageHistogramCalculation_ARGB8888
func VImageHistogramCalculationARGBFFFF ¶
func VImageHistogramCalculationARGBFFFF(src *VImageBuffer, histogram *uint, histogramEntries uint, minVal float32, maxVal float32, flags uint32) int
C function: vImageHistogramCalculation_ARGBFFFF
func VImageHistogramCalculationPlanar8 ¶
func VImageHistogramCalculationPlanar8(src *VImageBuffer, histogram *uint, flags uint32) int
C function: vImageHistogramCalculation_Planar8
func VImageHistogramCalculationPlanarF ¶
func VImageHistogramCalculationPlanarF(src *VImageBuffer, histogram *uint, histogramEntries uint, minVal float32, maxVal float32, flags uint32) int
C function: vImageHistogramCalculation_PlanarF
func VImageHistogramSpecificationARGB8888 ¶
func VImageHistogramSpecificationARGB8888(src *VImageBuffer, dest *VImageBuffer, desiredHistogram *uint, flags uint32) int
C function: vImageHistogramSpecification_ARGB8888
func VImageHistogramSpecificationARGBFFFF ¶
func VImageHistogramSpecificationARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, desiredHistogram *uint, histogramEntries uint, minVal float32, maxVal float32, flags uint32) int
C function: vImageHistogramSpecification_ARGBFFFF
func VImageHistogramSpecificationPlanar8 ¶
func VImageHistogramSpecificationPlanar8(src *VImageBuffer, dest *VImageBuffer, desiredHistogram *uint, flags uint32) int
C function: vImageHistogramSpecification_Planar8
func VImageHistogramSpecificationPlanarF ¶
func VImageHistogramSpecificationPlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, desiredHistogram *uint, histogramEntries uint, minVal float32, maxVal float32, flags uint32) int
C function: vImageHistogramSpecification_PlanarF
func VImageHorizontalReflectARGB16F ¶
func VImageHorizontalReflectARGB16F(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageHorizontalReflect_ARGB16F
func VImageHorizontalReflectARGB16S ¶
func VImageHorizontalReflectARGB16S(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageHorizontalReflect_ARGB16S
func VImageHorizontalReflectARGB16U ¶
func VImageHorizontalReflectARGB16U(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageHorizontalReflect_ARGB16U
func VImageHorizontalReflectARGB8888 ¶
func VImageHorizontalReflectARGB8888(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageHorizontalReflect_ARGB8888
func VImageHorizontalReflectARGBFFFF ¶
func VImageHorizontalReflectARGBFFFF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageHorizontalReflect_ARGBFFFF
func VImageHorizontalReflectCbCr16F ¶
func VImageHorizontalReflectCbCr16F(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageHorizontalReflect_CbCr16F
func VImageHorizontalReflectPlanar8 ¶
func VImageHorizontalReflectPlanar8(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageHorizontalReflect_Planar8
func VImageHorizontalReflectPlanar16F ¶
func VImageHorizontalReflectPlanar16F(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageHorizontalReflect_Planar16F
func VImageHorizontalReflectPlanar16U ¶
func VImageHorizontalReflectPlanar16U(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageHorizontalReflect_Planar16U
func VImageHorizontalReflectPlanarF ¶
func VImageHorizontalReflectPlanarF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageHorizontalReflect_PlanarF
func VImageHorizontalShearARGB16F ¶
func VImageHorizontalShearARGB16F(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, xTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor *uint16, flags uint32) int
C function: vImageHorizontalShear_ARGB16F
func VImageHorizontalShearARGB16S ¶
func VImageHorizontalShearARGB16S(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, xTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor *int16, flags uint32) int
C function: vImageHorizontalShear_ARGB16S
func VImageHorizontalShearARGB16U ¶
func VImageHorizontalShearARGB16U(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, xTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor *uint16, flags uint32) int
C function: vImageHorizontalShear_ARGB16U
func VImageHorizontalShearARGB8888 ¶
func VImageHorizontalShearARGB8888(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, xTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor *uint8, flags uint32) int
C function: vImageHorizontalShear_ARGB8888
func VImageHorizontalShearARGBFFFF ¶
func VImageHorizontalShearARGBFFFF(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, xTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor *float32, flags uint32) int
C function: vImageHorizontalShear_ARGBFFFF
func VImageHorizontalShearCbCr8 ¶
func VImageHorizontalShearCbCr8(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, xTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor *uint8, flags uint32) int
C function: vImageHorizontalShear_CbCr8
func VImageHorizontalShearCbCr16F ¶
func VImageHorizontalShearCbCr16F(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, xTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor *uint16, flags uint32) int
C function: vImageHorizontalShear_CbCr16F
func VImageHorizontalShearCbCr16S ¶
func VImageHorizontalShearCbCr16S(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, xTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor *int16, flags uint32) int
C function: vImageHorizontalShear_CbCr16S
func VImageHorizontalShearCbCr16U ¶
func VImageHorizontalShearCbCr16U(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, xTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor *uint16, flags uint32) int
C function: vImageHorizontalShear_CbCr16U
func VImageHorizontalShearDARGB16F ¶
func VImageHorizontalShearDARGB16F(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, xTranslate float64, shearSlope float64, filter unsafe.Pointer, backColor *uint16, flags uint32) int
C function: vImageHorizontalShearD_ARGB16F
func VImageHorizontalShearDARGB16S ¶
func VImageHorizontalShearDARGB16S(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, xTranslate float64, shearSlope float64, filter unsafe.Pointer, backColor *int16, flags uint32) int
C function: vImageHorizontalShearD_ARGB16S
func VImageHorizontalShearDARGB16U ¶
func VImageHorizontalShearDARGB16U(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, xTranslate float64, shearSlope float64, filter unsafe.Pointer, backColor *uint16, flags uint32) int
C function: vImageHorizontalShearD_ARGB16U
func VImageHorizontalShearDARGB8888 ¶
func VImageHorizontalShearDARGB8888(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, xTranslate float64, shearSlope float64, filter unsafe.Pointer, backColor *uint8, flags uint32) int
C function: vImageHorizontalShearD_ARGB8888
func VImageHorizontalShearDARGBFFFF ¶
func VImageHorizontalShearDARGBFFFF(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, xTranslate float64, shearSlope float64, filter unsafe.Pointer, backColor *float32, flags uint32) int
C function: vImageHorizontalShearD_ARGBFFFF
func VImageHorizontalShearDCbCr16F ¶
func VImageHorizontalShearDCbCr16F(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, xTranslate float64, shearSlope float64, filter unsafe.Pointer, backColor *uint16, flags uint32) int
C function: vImageHorizontalShearD_CbCr16F
func VImageHorizontalShearDCbCr16S ¶
func VImageHorizontalShearDCbCr16S(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, xTranslate float64, shearSlope float64, filter unsafe.Pointer, backColor *int16, flags uint32) int
C function: vImageHorizontalShearD_CbCr16S
func VImageHorizontalShearDCbCr16U ¶
func VImageHorizontalShearDCbCr16U(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, xTranslate float64, shearSlope float64, filter unsafe.Pointer, backColor *uint16, flags uint32) int
C function: vImageHorizontalShearD_CbCr16U
func VImageHorizontalShearDPlanar8 ¶
func VImageHorizontalShearDPlanar8(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, xTranslate float64, shearSlope float64, filter unsafe.Pointer, backColor uint8, flags uint32) int
C function: vImageHorizontalShearD_Planar8
func VImageHorizontalShearDPlanar16F ¶
func VImageHorizontalShearDPlanar16F(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, xTranslate float64, shearSlope float64, filter unsafe.Pointer, backColor uint16, flags uint32) int
C function: vImageHorizontalShearD_Planar16F
func VImageHorizontalShearDPlanarF ¶
func VImageHorizontalShearDPlanarF(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, xTranslate float64, shearSlope float64, filter unsafe.Pointer, backColor float32, flags uint32) int
C function: vImageHorizontalShearD_PlanarF
func VImageHorizontalShearPlanar8 ¶
func VImageHorizontalShearPlanar8(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, xTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor uint8, flags uint32) int
C function: vImageHorizontalShear_Planar8
func VImageHorizontalShearPlanar16F ¶
func VImageHorizontalShearPlanar16F(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, xTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor uint16, flags uint32) int
C function: vImageHorizontalShear_Planar16F
func VImageHorizontalShearPlanar16S ¶
func VImageHorizontalShearPlanar16S(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, xTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor int16, flags uint32) int
C function: vImageHorizontalShear_Planar16S
func VImageHorizontalShearPlanar16U ¶
func VImageHorizontalShearPlanar16U(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, xTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor uint16, flags uint32) int
C function: vImageHorizontalShear_Planar16U
func VImageHorizontalShearPlanarF ¶
func VImageHorizontalShearPlanarF(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, xTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor float32, flags uint32) int
C function: vImageHorizontalShear_PlanarF
func VImageHorizontalShearXRGB2101010W ¶
func VImageHorizontalShearXRGB2101010W(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, xTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor uint32, flags uint32) int
C function: vImageHorizontalShear_XRGB2101010W
func VImageInterpolatedLookupTablePlanarF ¶
func VImageInterpolatedLookupTablePlanarF(src *VImageBuffer, dest *VImageBuffer, table *float32, tableEntries uint, maxFloat float32, minFloat float32, flags uint32) int
C function: vImageInterpolatedLookupTable_PlanarF
func VImageLookupTable8to64U ¶
func VImageLookupTable8to64U(src *VImageBuffer, dest *VImageBuffer, lut *uint64, flags uint32) int
C function: vImageLookupTable_8to64U
func VImageLookupTablePlanar8toPlanar16 ¶
func VImageLookupTablePlanar8toPlanar16(src *VImageBuffer, dest *VImageBuffer, table *uint16, flags uint32) int
C function: vImageLookupTable_Planar8toPlanar16
func VImageLookupTablePlanar8toPlanar24 ¶
func VImageLookupTablePlanar8toPlanar24(src *VImageBuffer, dest *VImageBuffer, table *uint32, flags uint32) int
C function: vImageLookupTable_Planar8toPlanar24
func VImageLookupTablePlanar8toPlanar48 ¶
func VImageLookupTablePlanar8toPlanar48(src *VImageBuffer, dest *VImageBuffer, table *uint64, flags uint32) int
C function: vImageLookupTable_Planar8toPlanar48
func VImageLookupTablePlanar8toPlanar96 ¶
func VImageLookupTablePlanar8toPlanar96(src *VImageBuffer, dest *VImageBuffer, table *[4]float32, flags uint32) int
C function: vImageLookupTable_Planar8toPlanar96
func VImageLookupTablePlanar8toPlanar128 ¶
func VImageLookupTablePlanar8toPlanar128(src *VImageBuffer, dest *VImageBuffer, table *[4]float32, flags uint32) int
C function: vImageLookupTable_Planar8toPlanar128
func VImageLookupTablePlanar8toPlanarF ¶
func VImageLookupTablePlanar8toPlanarF(src *VImageBuffer, dest *VImageBuffer, table *float32, flags uint32) int
C function: vImageLookupTable_Planar8toPlanarF
func VImageLookupTablePlanar16 ¶
func VImageLookupTablePlanar16(src *VImageBuffer, dest *VImageBuffer, table *uint16, flags uint32) int
C function: vImageLookupTable_Planar16
func VImageLookupTablePlanarFtoPlanar8 ¶
func VImageLookupTablePlanarFtoPlanar8(src *VImageBuffer, dest *VImageBuffer, table *uint8, flags uint32) int
C function: vImageLookupTable_PlanarFtoPlanar8
func VImageMatrixMultiplyARGB8888 ¶
func VImageMatrixMultiplyARGB8888(src *VImageBuffer, dest *VImageBuffer, matrix *int16, divisor int32, preBias *int16, postBias *int32, flags uint32) int
C function: vImageMatrixMultiply_ARGB8888
func VImageMatrixMultiplyARGB8888ToPlanar8 ¶
func VImageMatrixMultiplyARGB8888ToPlanar8(src *VImageBuffer, dest *VImageBuffer, matrix *int16, divisor int32, preBias *int16, postBias int32, flags uint32) int
@function vImageMatrixMultiply_ARGB8888ToPlanar8 @abstract apply a 1d matrix to a four channel, 8-bit per component image and get a 1-channel 8-bit image as a result @discussion vImageMatrixMultiply_ARGB8888ToPlanar8 is like vImageMatrixMultiply_ARGB8888, except that it produces only a single channel of output. It is intended to produce grayscale images from four channel content, but can be used for other purposes. <pre>@textblock for each pixel[y][x] in image: int32_t p = (pixel[y][x][0] + pre_bias[0]) * matrix[0] + (pixel[y][x][1] + pre_bias[1]) * matrix[1] + (pixel[y][x][2] + pre_bias[2]) * matrix[2] + (pixel[y][x][3] + pre_bias[3]) * matrix[3]; result[y][x] = CLAMP( ( p + post_bias ) / divisor, 0, 0xff); @/textblock </pre> If you intend to just extract a single channel without modification (e.g. alpha), please see vImageExtractChannel_ARGB8888. This function will work in place, provided that src->data = dest->data and src->rowBytes = dest->rowBytes. @param src A four channel, 8-bit per component input buffer. It does not have to be ARGB. @param dest A preallocated buffer to receive the 8-bit per component monochromatic result. @param matrix The 1D matrix by which to multiply each pixel. @param divisor Used to renormalize the image after scaling by the matrix. Typically this is the sum over the matrix. If 0, 1 will be used. A faster implementation may be available if the divisor is an integer power of 2. @param pre_bias A set of values used to correct the input image so that 0 is encoded as 0. For example, if the input image is 444 AYCbCr video range, then {0, -16, -128, -128} could be used here. If NULL, {0,0,0,0} will be used. @param post_bias A value added to the sum at the end to provide both for rounding control and for allowing for a bias to be encoded into the image format. Typically, this is just divisor/2 to allow for round to nearest behavior. However, other values may be appropriate if the encoding for 0.0 is not 0. For example, for video range luminance, you might pass 16 * divisor + divisor/2. @param flags The following flags are allowed: <pre> @textblock kvImageNoFlags Default operation kvImageDoNotTile Disable internal multithreading. kvImageGetTempBufferSize return 0, do no work kvImagePrintDiagnosticsToConsole Might print more helpful diagnostic info to the console in the event of an error. @/textblock</pre> @return kvImageNoError Success. @return kvImageRoiLargerThanInputBuffer dest->width and height must be less than or equal to the corresponding dimension of src. @return kvImageUnknownFlagsBit A flag not from the above list of flags was passed in. @return If kvImageGetTempBufferSize was passed, 0 is returned and no work is done on the image. C function: vImageMatrixMultiply_ARGB8888ToPlanar8
func VImageMatrixMultiplyARGBFFFF ¶
func VImageMatrixMultiplyARGBFFFF(src *VImageBuffer, dest *VImageBuffer, matrix *float32, preBias *float32, postBias *float32, flags uint32) int
C function: vImageMatrixMultiply_ARGBFFFF
func VImageMatrixMultiplyARGBFFFFToPlanarF ¶
func VImageMatrixMultiplyARGBFFFFToPlanarF(src *VImageBuffer, dest *VImageBuffer, matrix *float32, preBias *float32, postBias float32, flags uint32) int
@function vImageMatrixMultiply_ARGBFFFFToPlanarF @abstract apply a 1d matrix to a four channel, float per component image and get a 1-channel float image as a result @discussion vImageMatrixMultiply_ARGBFFFFToPlanarF is like vImageMatrixMultiply_ARGBFFFF, except that it produces only a single channel of output. It is intended to produce grayscale images from four channel content, but can be used for other purposes. <pre>@textblock for each pixel[y][x] in image: float p = (pixel[y][x][0] + pre_bias[0]) * matrix[0] + (pixel[y][x][1] + pre_bias[1]) * matrix[1] + (pixel[y][x][2] + pre_bias[2]) * matrix[2] + (pixel[y][x][3] + pre_bias[3]) * matrix[3]; result[y][x] = p + post_bias; @/textblock </pre> vImage reserves the right to reorder computation from the above formulation to improve performance. If you intend to just extract a single channel without modification (e.g. alpha), please see vImageExtractChannel_ARGBFFFF. This function will work in place, provided that src->data = dest->data and src->rowBytes = dest->rowBytes. @param src A four channel, floating-point input buffer. It does not have to be ARGB. @param dest A preallocated buffer to receive the floating-point monochromatic result. @param matrix The 1D matrix by which to multiply each pixel. @param pre_bias A set of values used to correct the input image so that 0 is encoded as 0. If NULL, {0,0,0,0} will be used. @param post_bias A value added to the sum at the end to provide both for rounding control and for allowing for a bias to be encoded into the image format. Typically, this is just zero. @param flags The following flags are allowed: @textblock kvImageNoFlags Default operation kvImageDoNotTile Disable internal multithreading. kvImageGetTempBufferSize return 0, do no work kvImagePrintDiagnosticsToConsole Might print more helpful diagnostic info to the console in the event of an error. @/textblock @return kvImageNoError Success. @return kvImageRoiLargerThanInputBuffer dest->width and height must be less than or equal to the corresponding dimension of src. @return kvImageUnknownFlagsBit A flag not from the above list of flags was passed in. @return If kvImageGetTempBufferSize was passed, 0 is returned and no work is done on the image. C function: vImageMatrixMultiply_ARGBFFFFToPlanarF
func VImageMatrixMultiplyPlanar8 ¶
func VImageMatrixMultiplyPlanar8(srcs *VImageBuffer, dests *VImageBuffer, srcPlanes uint32, destPlanes uint32, matrix *int16, divisor int32, preBias *int16, postBias *int32, flags uint32) int
C function: vImageMatrixMultiply_Planar8
func VImageMatrixMultiplyPlanar16S ¶
func VImageMatrixMultiplyPlanar16S(srcs *VImageBuffer, dests *VImageBuffer, srcPlanes uint32, destPlanes uint32, matrix *int16, divisor int32, preBias *int16, postBias *int32, flags uint32) int
C function: vImageMatrixMultiply_Planar16S
func VImageMatrixMultiplyPlanarF ¶
func VImageMatrixMultiplyPlanarF(srcs *VImageBuffer, dests *VImageBuffer, srcPlanes uint32, destPlanes uint32, matrix *float32, preBias *float32, postBias *float32, flags uint32) int
C function: vImageMatrixMultiply_PlanarF
func VImageMaxARGB8888 ¶
func VImageMaxARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernelHeight uint, kernelWidth uint, flags uint32) int
@function vImageMax_ARGB8888 @abstract Apply a max filter to a ARGB8888 image @discussion This is a special purpose dilate filter for ARGB8888 data, for rectangular kernels with value 0. It is much faster than the normal dilate. <pre> @textblock for each pixel result[i][j] in the image{ int a = 0; int r = 0; int g = 0; int b = 0; for( y = 0; y < kernel_height; y++ ){ for( x = 0; x < kernel_width; x++ ){ a = MAX( a, src[i+y-kernel_height/2]j+x-kernel_width/2[0] ) r = MAX( r, src[i+y-kernel_height/2]j+x-kernel_width/2[1] ) g = MAX( g, src[i+y-kernel_height/2]j+x-kernel_width/2[2] ) b = MAX( b, src[i+y-kernel_height/2]j+x-kernel_width/2[3] ) } } // saturate overflow to representable range result[i][j][0] = (flags & kvImageLeaveAlphaUnchanged) ? src[i][j] : a; result[i][j][1] = r; result[i][j][2] = g; result[i][j][3] = b; } @/textblock </pre> If only part of the max filter of the entire image is desired, use srcOffsetToROI_X/Y to set the positioning of the result tile relative to the src image. If kvImageLeaveAlphaUnchanged is not used, it works for any channel order. If kvImageLeaveAlphaUnchanged is used, then the alpha must be first. Does not work in place, unless the kvImageDoNotTile flag is used, in which case it will probably run more slowly. @param src The input image @param dest A preallocated buffer to contain the result image @param tempBuffer May be NULL. An optional temp buffer in which to store temporary computation. To find the size of the temp buffer, call the function with the desired parameters and pass the kvImageGetTempBufferSize flag. The size of the temp buffer will be returned from the left hand side of the function in place of an error code, and no work will be done on the image data. A temp buffer can provide a speed improvement, if it can be allocated once and reused. This saves a bunch of VM faults on first use of the newly allocated temp buffer. @param srcOffsetToROI_X An offset added to the horizontal position in the src image when calculating the max filter. It allows the max filter to operate in a tiled fashion for tiles that do not start on the left edge of the source image. @param srcOffsetToROI_Y An offset added to the vertical position in the src image when calculating the max filter. It allows the max filter to operate in a tiled fashion for tiles that do not start on the top edge of the source image. @param kernel_height The height of the rectangular kernel. Must be an odd number. @param kernel_width The width of the rectangular kernel. Must be an odd number. @param flags The following flags values are allowed: <pre> @textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading. Useful if, for example, you are doing your own multithreading and just want the filter to run local to the current thread. kvImageDoNotTile will also allow the filter to run in place, though more slowly. kvImageGetTempBufferSize Return 0. Do no work. kvImageLeaveAlphaUnchanged The alpha channel (first byte of pixel in memory) is copied to the destination without modification, instead of having a max filter applied to it. @/textblock </pre> @return The following error codes may result: <pre> @textblock kvImageNoError Success. >=0 If kvImageGetTempBufferSize was among the flags, then no work was done. Instead, the size of the temp buffer needed is returned. kvImageRoiLargerThanInputBuffer dest->width and dest->height must be less than or equal to the corresponding dimensions in the src image kvImageInvalidKernelSize The kernel_height and kernel_width must not be evenly divisible by 2. @/textblock </pre> C function: vImageMax_ARGB8888
func VImageMaxARGBFFFF ¶
func VImageMaxARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernelHeight uint, kernelWidth uint, flags uint32) int
@function vImageMax_ARGBFFFF @abstract Apply a max filter to a ARGBFFFF image @discussion This is a special purpose dilate filter for ARGBFFFF data, for rectangular kernels with value 0. It is much faster than the normal dilate. <pre> @textblock for each pixel result[i][j] in the image{ float a = -INFINITY; float r = -INFINITY; float g = -INFINITY; float b = -INFINITY; for( y = 0; y < kernel_height; y++ ){ for( x = 0; x < kernel_width; x++ ){ a = MAX( a, src[i+y-kernel_height/2]j+x-kernel_width/2[0] ) r = MAX( r, src[i+y-kernel_height/2]j+x-kernel_width/2[1] ) g = MAX( g, src[i+y-kernel_height/2]j+x-kernel_width/2[2] ) b = MAX( b, src[i+y-kernel_height/2]j+x-kernel_width/2[3] ) } } // saturate overflow to representable range result[i][j][0] = (flags & kvImageLeaveAlphaUnchanged) ? src[i][j] : a; result[i][j][1] = r; result[i][j][2] = g; result[i][j][3] = b; } @/textblock </pre> If only part of the max filter of the entire image is desired, use srcOffsetToROI_X/Y to set the positioning of the result tile relative to the src image. If kvImageLeaveAlphaUnchanged is not used, it works for any channel order. If kvImageLeaveAlphaUnchanged is used, then the alpha must be first. Does not work in place, unless the kvImageDoNotTile flag is used, in which case it will probably run more slowly. @param src The input image @param dest A preallocated buffer to contain the result image @param tempBuffer May be NULL. An optional temp buffer in which to store temporary computation. To find the size of the temp buffer, call the function with the desired parameters and pass the kvImageGetTempBufferSize flag. The size of the temp buffer will be returned from the left hand side of the function in place of an error code, and no work will be done on the image data. A temp buffer can provide a speed improvement, if it can be allocated once and reused. This saves a bunch of VM faults on first use of the newly allocated temp buffer. @param srcOffsetToROI_X An offset added to the horizontal position in the src image when calculating the max filter. It allows the max filter to operate in a tiled fashion for tiles that do not start on the left edge of the source image. @param srcOffsetToROI_Y An offset added to the vertical position in the src image when calculating the max filter. It allows the max filter to operate in a tiled fashion for tiles that do not start on the top edge of the source image. @param kernel_height The height of the rectangular kernel. Must be an odd number. @param kernel_width The width of the rectangular kernel. Must be an odd number. @param flags The following flags values are allowed: <pre> @textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading. Useful if, for example, you are doing your own multithreading and just want the filter to run local to the current thread. kvImageDoNotTile will also allow the filter to run in place, though more slowly. kvImageGetTempBufferSize Return 0. Do no work. kvImageLeaveAlphaUnchanged The alpha channel (first byte of pixel in memory) is copied to the destination without modification, instead of having a max filter applied to it. @/textblock </pre> @return The following error codes may result: <pre> @textblock kvImageNoError Success. >=0 If kvImageGetTempBufferSize was among the flags, then no work was done. Instead, the size of the temp buffer needed is returned. kvImageRoiLargerThanInputBuffer dest->width and dest->height must be less than or equal to the corresponding dimensions in the src image kvImageInvalidKernelSize The kernel_height and kernel_width must not be evenly divisible by 2. @/textblock </pre> C function: vImageMax_ARGBFFFF
func VImageMaxPlanar8 ¶
func VImageMaxPlanar8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernelHeight uint, kernelWidth uint, flags uint32) int
@function vImageMax_Planar8 @abstract Apply a max filter to a Planar8 image. @discussion A max filter is a special case dilate filter, in which the filter elements are all 0. It is much faster than the normal dilate. <pre> @textblock for each pixel result[i][j] in the image{ int r = 0; for( y = 0; y < kernel_height; y++ ){ for( x = 0; x < kernel_width; x++ ){ r = MAX( r, src[i+y-kernel_height/2]j+x-kernel_width/2 ) } } // saturate overflow to representable range result[i][j] = r; } @/textblock </pre> If only part of the max filter of the entire image is desired, use srcOffsetToROI_X/Y to set the positioning of the result tile relative to the src image. Does not work in place, unless the kvImageDoNotTile flag is used. @param src The input image @param dest A preallocated buffer to contain the result image @param tempBuffer May be NULL. An optional temp buffer in which to store temporary computation. To find the size of the temp buffer, call the function with the desired parameters and pass the kvImageGetTempBufferSize flag. The size of the temp buffer will be returned from the left hand side of the function in place of an error code, and no work will be done on the image data. A temp buffer can provide a speed improvement, if it can be allocated once and reused. This saves a bunch of VM faults on first use of the newly allocated temp buffer. @param srcOffsetToROI_X An offset added to the horizontal position in the src image when calculating the max filter. It allows the max filter to operate in a tiled fashion for tiles that do not start on the left edge of the source image. @param srcOffsetToROI_Y An offset added to the vertical position in the src image when calculating the max filter. It allows the max filter to operate in a tiled fashion for tiles that do not start on the top edge of the source image. @param kernel_height The height of the rectangular kernel. Must be an odd number. @param kernel_width The width of the rectangular kernel. Must be an odd number. @param flags The following flags values are allowed: <pre> @textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading. Useful if, for example, you are doing your own multithreading and just want the filter to run local to the current thread. It also allows the function to work in place, though more slowly. kvImageGetTempBufferSize Return 0. Do no work. @/textblock </pre> @return The following error codes may result: <pre> @textblock kvImageNoError Success. >=0 If kvImageGetTempBufferSize was among the flags, then no work was done. Instead, the size of the temp buffer needed is returned. kvImageRoiLargerThanInputBuffer dest->width and dest->height must be less than or equal to the corresponding dimensions in the src image kvImageInvalidKernelSize The kernel_height and kernel_width must not be evenly divisible by 2. @/textblock </pre> C function: vImageMax_Planar8
func VImageMaxPlanarF ¶
func VImageMaxPlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernelHeight uint, kernelWidth uint, flags uint32) int
@function vImageMax_PlanarF @abstract Apply a max filter to a PlanarF image. @discussion A max filter is a special case dilate filter, in which the filter elements are all 0. It is much faster than the normal dilate. <pre> @textblock for each pixel result[i][j] in the image{ float r = -INFINITY; for( y = 0; y < kernel_height; y++ ){ for( x = 0; x < kernel_width; x++ ){ r = MAX( r, src[i+y-kernel_height/2]j+x-kernel_width/2 ) } } // saturate overflow to representable range result[i][j] = r; } @/textblock </pre> If only part of the max filter of the entire image is desired, use srcOffsetToROI_X/Y to set the positioning of the result tile relative to the src image. Does not work in place, unless the kvImageDoNotTile flag is used. @param src The input image @param dest A preallocated buffer to contain the result image @param tempBuffer May be NULL. An optional temp buffer in which to store temporary computation. To find the size of the temp buffer, call the function with the desired parameters and pass the kvImageGetTempBufferSize flag. The size of the temp buffer will be returned from the left hand side of the function in place of an error code, and no work will be done on the image data. A temp buffer can provide a speed improvement, if it can be allocated once and reused. This saves a bunch of VM faults on first use of the newly allocated temp buffer. @param srcOffsetToROI_X An offset added to the horizontal position in the src image when calculating the max filter. It allows the max filter to operate in a tiled fashion for tiles that do not start on the left edge of the source image. @param srcOffsetToROI_Y An offset added to the vertical position in the src image when calculating the max filter. It allows the max filter to operate in a tiled fashion for tiles that do not start on the top edge of the source image. @param kernel_height The height of the rectangular kernel. Must be an odd number. @param kernel_width The width of the rectangular kernel. Must be an odd number. @param flags The following flags values are allowed: <pre> @textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading. Useful if, for example, you are doing your own multithreading and just want the filter to run local to the current thread. It also allows the function to work in place, though more slowly. kvImageGetTempBufferSize Return the size of the temp buffer needed. Do no work. @/textblock </pre> @return The following error codes may result: <pre> @textblock kvImageNoError Success. >=0 If kvImageGetTempBufferSize was among the flags, then no work was done. Instead, the size of the temp buffer needed is returned. kvImageRoiLargerThanInputBuffer dest->width and dest->height must be less than or equal to the corresponding dimensions in the src image kvImageInvalidKernelSize The kernel_height and kernel_width must not be evenly divisible by 2. @/textblock </pre> C function: vImageMax_PlanarF
func VImageMinARGB8888 ¶
func VImageMinARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernelHeight uint, kernelWidth uint, flags uint32) int
@function vImageMin_ARGB8888 @abstract Apply a min filter to a ARGB8888 image @discussion This is a special purpose erode filter for ARGB8888 data, for rectangular kernels with value 0. It is much faster than the normal erode. <pre> @textblock for each pixel result[i][j] in the image{ int a = MAX_CHANNEL_VALUE; int r = MAX_CHANNEL_VALUE; int g = MAX_CHANNEL_VALUE; int b = MAX_CHANNEL_VALUE; for( y = 0; y < kernel_height; y++ ){ for( x = 0; x < kernel_width; x++ ){ a = MIN( a, src[i+y-kernel_height/2]j+x-kernel_width/2[0] ) r = MIN( r, src[i+y-kernel_height/2]j+x-kernel_width/2[1] ) g = MIN( g, src[i+y-kernel_height/2]j+x-kernel_width/2[2] ) b = MIN( b, src[i+y-kernel_height/2]j+x-kernel_width/2[3] ) } } // saturate overflow to representable range result[i][j][0] = (flags & kvImageLeaveAlphaUnchanged) ? src[i][j] : a; result[i][j][1] = r; result[i][j][2] = g; result[i][j][3] = b; } @/textblock </pre> If only part of the min filter of the entire image is desired, use srcOffsetToROI_X/Y to set the positioning of the result tile relative to the src image. If kvImageLeaveAlphaUnchanged is not used, it works for any channel order. If kvImageLeaveAlphaUnchanged is used, then the alpha must be first. Does not work in place, unless the kvImageDoNotTile flag is used, in which case it will probably run more slowly. @param src The input image @param dest A preallocated buffer to contain the result image @param tempBuffer May be NULL. An optional temp buffer in which to store temporary computation. To find the size of the temp buffer, call the function with the desired parameters and pass the kvImageGetTempBufferSize flag. The size of the temp buffer will be returned from the left hand side of the function in place of an error code, and no work will be done on the image data. A temp buffer can provide a speed improvement, if it can be allocated once and reused. This saves a bunch of VM faults on first use of the newly allocated temp buffer. @param srcOffsetToROI_X An offset added to the horizontal position in the src image when calculating the min filter. It allows the min filter to operate in a tiled fashion for tiles that do not start on the left edge of the source image. @param srcOffsetToROI_Y An offset added to the vertical position in the src image when calculating the min filter. It allows the min filter to operate in a tiled fashion for tiles that do not start on the top edge of the source image. @param kernel_height The height of the rectangular kernel. Must be an odd number. @param kernel_width The width of the rectangular kernel. Must be an odd number. @param flags The following flags values are allowed: <pre> @textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading. Useful if, for example, you are doing your own multithreading and just want the filter to run local to the current thread. kvImageDoNotTile will also allow the filter to run in place, though more slowly. kvImageGetTempBufferSize Return 0. Do no work. kvImageLeaveAlphaUnchanged The alpha channel (first byte of pixel in memory) is copied to the destination without modification, instead of having a min filter applied to it. @/textblock </pre> @return The following error codes may result: <pre> @textblock kvImageNoError Success. >=0 If kvImageGetTempBufferSize was among the flags, then no work was done. Instead, the size of the temp buffer needed is returned. kvImageRoiLargerThanInputBuffer dest->width and dest->height must be less than or equal to the corresponding dimensions in the src image kvImageInvalidKernelSize The kernel_height and kernel_width must not be evenly divisible by 2. @/textblock </pre> C function: vImageMin_ARGB8888
func VImageMinARGBFFFF ¶
func VImageMinARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernelHeight uint, kernelWidth uint, flags uint32) int
@function vImageMin_ARGBFFFF @abstract Apply a min filter to a ARGBFFFF image @discussion This is a special purpose erode filter for ARGBFFFF data, for rectangular kernels with value 0. It is much faster than the normal erode. <pre> @textblock for each pixel result[i][j] in the image{ float a = INFINITY; float r = INFINITY; float g = INFINITY; float b = INFINITY; for( y = 0; y < kernel_height; y++ ){ for( x = 0; x < kernel_width; x++ ){ a = MIN( a, src[i+y-kernel_height/2]j+x-kernel_width/2[0] ) r = MIN( r, src[i+y-kernel_height/2]j+x-kernel_width/2[1] ) g = MIN( g, src[i+y-kernel_height/2]j+x-kernel_width/2[2] ) b = MIN( b, src[i+y-kernel_height/2]j+x-kernel_width/2[3] ) } } // saturate overflow to representable range result[i][j][0] = (flags & kvImageLeaveAlphaUnchanged) ? src[i][j] : a; result[i][j][1] = r; result[i][j][2] = g; result[i][j][3] = b; } @/textblock </pre> If only part of the min filter of the entire image is desired, use srcOffsetToROI_X/Y to set the positioning of the result tile relative to the src image. If kvImageLeaveAlphaUnchanged is not used, it works for any channel order. If kvImageLeaveAlphaUnchanged is used, then the alpha must be first. Does not work in place, unless the kvImageDoNotTile flag is used, in which case it will probably run more slowly. @param src The input image @param dest A preallocated buffer to contain the result image @param tempBuffer May be NULL. An optional temp buffer in which to store temporary computation. To find the size of the temp buffer, call the function with the desired parameters and pass the kvImageGetTempBufferSize flag. The size of the temp buffer will be returned from the left hand side of the function in place of an error code, and no work will be done on the image data. A temp buffer can provide a speed improvement, if it can be allocated once and reused. This saves a bunch of VM faults on first use of the newly allocated temp buffer. @param srcOffsetToROI_X An offset added to the horizontal position in the src image when calculating the min filter. It allows the min filter to operate in a tiled fashion for tiles that do not start on the left edge of the source image. @param srcOffsetToROI_Y An offset added to the vertical position in the src image when calculating the min filter. It allows the min filter to operate in a tiled fashion for tiles that do not start on the top edge of the source image. @param kernel_height The height of the rectangular kernel. Must be an odd number. @param kernel_width The width of the rectangular kernel. Must be an odd number. @param flags The following flags values are allowed: <pre> @textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading. Useful if, for example, you are doing your own multithreading and just want the filter to run local to the current thread. kvImageDoNotTile will also allow the filter to run in place, though more slowly. kvImageGetTempBufferSize Return 0. Do no work. kvImageLeaveAlphaUnchanged The alpha channel (first byte of pixel in memory) is copied to the destination without modification, instead of having a min filter applied to it. @/textblock </pre> @return The following error codes may result: <pre> @textblock kvImageNoError Success. >=0 If kvImageGetTempBufferSize was among the flags, then no work was done. Instead, the size of the temp buffer needed is returned. kvImageRoiLargerThanInputBuffer dest->width and dest->height must be less than or equal to the corresponding dimensions in the src image kvImageInvalidKernelSize The kernel_height and kernel_width must not be evenly divisible by 2. @/textblock </pre> C function: vImageMin_ARGBFFFF
func VImageMinPlanar8 ¶
func VImageMinPlanar8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernelHeight uint, kernelWidth uint, flags uint32) int
@function vImageMin_Planar8 @abstract Apply a min filter to a Planar8 image. @discussion A min filter is a special case erode filter, in which the filter elements are all 0. It is much faster than the normal erode. <pre> @textblock for each pixel result[i][j] in the image{ int r = MAX_CHANNEL_VALUE; for( y = 0; y < kernel_height; y++ ){ for( x = 0; x < kernel_width; x++ ){ r = MIN( r, src[i+y-kernel_height/2]j+x-kernel_width/2 ) } } // saturate overflow to representable range result[i][j] = r; } @/textblock </pre> If only part of the min filter of the entire image is desired, use srcOffsetToROI_X/Y to set the positioning of the result tile relative to the src image. Does not work in place, unless the kvImageDoNotTile flag is used. @param src The input image @param dest A preallocated buffer to contain the result image @param tempBuffer May be NULL. An optional temp buffer in which to store temporary computation. To find the size of the temp buffer, call the function with the desired parameters and pass the kvImageGetTempBufferSize flag. The size of the temp buffer will be returned from the left hand side of the function in place of an error code, and no work will be done on the image data. A temp buffer can provide a speed improvement, if it can be allocated once and reused. This saves a bunch of VM faults on first use of the newly allocated temp buffer. @param srcOffsetToROI_X An offset added to the horizontal position in the src image when calculating the min filter. It allows the min filter to operate in a tiled fashion for tiles that do not start on the left edge of the source image. @param srcOffsetToROI_Y An offset added to the vertical position in the src image when calculating the min filter. It allows the min filter to operate in a tiled fashion for tiles that do not start on the top edge of the source image. @param kernel_height The height of the rectangular kernel. Must be an odd number. @param kernel_width The width of the rectangular kernel. Must be an odd number. @param flags The following flags values are allowed: <pre> @textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading. Useful if, for example, you are doing your own multithreading and just want the filter to run local to the current thread. It also allows the function to work in place, though more slowly. kvImageGetTempBufferSize Return 0. Do no work. @/textblock </pre> @return The following error codes may result: <pre> @textblock kvImageNoError Success. >=0 If kvImageGetTempBufferSize was among the flags, then no work was done. Instead, the size of the temp buffer needed is returned. kvImageRoiLargerThanInputBuffer dest->width and dest->height must be less than or equal to the corresponding dimensions in the src image kvImageInvalidKernelSize The kernel_height and kernel_width must not be evenly divisible by 2. @/textblock </pre> C function: vImageMin_Planar8
func VImageMinPlanarF ¶
func VImageMinPlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernelHeight uint, kernelWidth uint, flags uint32) int
@function vImageMin_PlanarF @abstract Apply a min filter to a PlanarF image. @discussion A min filter is a special case erode filter, in which the filter elements are all 0. It is much faster than the normal erode. <pre> @textblock for each pixel result[i][j] in the image{ float r = INFINITY; for( y = 0; y < kernel_height; y++ ){ for( x = 0; x < kernel_width; x++ ){ r = MIN( r, src[i+y-kernel_height/2]j+x-kernel_width/2 ) } } // saturate overflow to representable range result[i][j] = r; } @/textblock </pre> If only part of the min filter of the entire image is desired, use srcOffsetToROI_X/Y to set the positioning of the result tile relative to the src image. Does not work in place, unless the kvImageDoNotTile flag is used. @param src The input image @param dest A preallocated buffer to contain the result image @param tempBuffer May be NULL. An optional temp buffer in which to store temporary computation. To find the size of the temp buffer, call the function with the desired parameters and pass the kvImageGetTempBufferSize flag. The size of the temp buffer will be returned from the left hand side of the function in place of an error code, and no work will be done on the image data. A temp buffer can provide a speed improvement, if it can be allocated once and reused. This saves a bunch of VM faults on first use of the newly allocated temp buffer. @param srcOffsetToROI_X An offset added to the horizontal position in the src image when calculating the min filter. It allows the min filter to operate in a tiled fashion for tiles that do not start on the left edge of the source image. @param srcOffsetToROI_Y An offset added to the vertical position in the src image when calculating the min filter. It allows the min filter to operate in a tiled fashion for tiles that do not start on the top edge of the source image. @param kernel_height The height of the rectangular kernel. Must be an odd number. @param kernel_width The width of the rectangular kernel. Must be an odd number. @param flags The following flags values are allowed: <pre> @textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading. Useful if, for example, you are doing your own multithreading and just want the filter to run local to the current thread. It also allows the function to work in place, though more slowly. kvImageGetTempBufferSize Return 0. Do no work. @/textblock </pre> @return The following error codes may result: <pre> @textblock kvImageNoError Success. >=0 If kvImageGetTempBufferSize was among the flags, then no work was done. Instead, the size of the temp buffer needed is returned. kvImageRoiLargerThanInputBuffer dest->width and dest->height must be less than or equal to the corresponding dimensions in the src image kvImageInvalidKernelSize The kernel_height and kernel_width must not be evenly divisible by 2. @/textblock </pre> C function: vImageMin_PlanarF
func VImageMultiDimensionalInterpolatedLookupTablePlanar16Q12 ¶
func VImageMultiDimensionalInterpolatedLookupTablePlanar16Q12(srcs *VImageBuffer, dests *VImageBuffer, tempBuffer unsafe.Pointer, table unsafe.Pointer, method accelerate.VImage_InterpolationMethod, flags uint32) int
C function: vImageMultiDimensionalInterpolatedLookupTable_Planar16Q12
func VImageMultiDimensionalInterpolatedLookupTablePlanarF ¶
func VImageMultiDimensionalInterpolatedLookupTablePlanarF(srcs *VImageBuffer, dests *VImageBuffer, tempBuffer unsafe.Pointer, table unsafe.Pointer, method accelerate.VImage_InterpolationMethod, flags uint32) int
C function: vImageMultiDimensionalInterpolatedLookupTable_PlanarF
func VImageMultidimensionalTableCreate ¶
func VImageMultidimensionalTableCreate(tableData *uint16, numSrcChannels uint32, numDestChannels uint32, tableEntriesPerDimension *uint8, hint accelerate.VImageMDTableUsageHint, flags uint32, err *int) unsafe.Pointer
C function: vImageMultidimensionalTable_Create
func VImageMultidimensionalTableRelease ¶
C function: vImageMultidimensionalTable_Release
func VImageMultidimensionalTableRetain ¶
C function: vImageMultidimensionalTable_Retain
func VImageNewResamplingFilter ¶
C function: vImageNewResamplingFilter
func VImageNewResamplingFilterForFunctionUsingBuffer ¶
func VImageNewResamplingFilterForFunctionUsingBuffer(filter unsafe.Pointer, scale float32, kernelFunc unsafe.Pointer, kernelWidth float32, userData unsafe.Pointer, flags uint32) int
C function: vImageNewResamplingFilterForFunctionUsingBuffer
func VImageOverwriteChannelsARGB8888 ¶
func VImageOverwriteChannelsARGB8888(newSrc *VImageBuffer, origSrc *VImageBuffer, dest *VImageBuffer, copyMask uint8, flags uint32) int
@function vImageOverwriteChannels_ARGB8888 @abstract Overwrites one or more planes of an ARGB8888 image buffer with the provided planar buffer. @discussion For each pixel in src, do the following: @code // Set up a uint32_t mask - 0xFF where the pixels should be conserved // Load and splat the src pixel uint32_t srcPixel = newSrc->data[x]; uint32_t result = origSrc->data[x]; srcPixel |= srcPixel << 8; srcPixel |= srcPixel << 16; // Select for the channels based on the mask srcPixel &= ~mask; result &= mask; // combine the two and store dest->data[x] = srcPixel | result; @endcode origSrc and dest may overlap, if they share the same origin. origSrc should be at least as big as dest origSrc and dest can be the same buffer This function may be used with other channel orderings (e.g. origSrc -> a RGBA8888 buffer) by adjusting the order of the bits in the copyMask. This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data. If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags. @param newSrc A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing planar source pixel that we will overwrite with. @param origSrc A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing ARGB source pixel that we will overwrite into. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param copyMask A mask to copy plane : 0x8 -- alpha, 0x4 -- red, 0x2 --- green, 0x1 --- blue @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageOverwriteChannels_ARGB8888
func VImageOverwriteChannelsARGBFFFF ¶
func VImageOverwriteChannelsARGBFFFF(newSrc *VImageBuffer, origSrc *VImageBuffer, dest *VImageBuffer, copyMask uint8, flags uint32) int
@function vImageOverwriteChannels_ARGBFFFF @abstract Overwrites one or more planes of an ARGBFFFF image buffer with the provided planar buffer. @discussion For each pixel in src, do the following: @code // Set up a uint32_t mask for which channels to use -1U where the pixels should not be conserved uint32_t a = origSrc->data[0] & maskA; uint32_t r = origSrc->data[1] & maskR; uint32_t g = origSrc->data[2] & maskG; uint32_t b = origSrc->data[3] & maskB; uint32_t colorA = newSrc->data[0]; uint32_t colorR = colorA & ~maskR; uint32_t colorG = colorA & ~maskG; uint32_t colorB = colorA & ~maskB; colorA &= ~maskA; dest->data[0] = colorA | a; dest->data[1] = colorR | r; dest->data[2] = colorG | g; dest->data[3] = colorB | b; @endcode origSrc and dest may overlap, if they share the same origin. origSrc should be at least as big as dest origSrc and dest can be the same buffer This function may be used with other channel orderings (e.g. origSrc -> a RGBAFFFF buffer) by adjusting the order of the bits in the copyMask. This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data. If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags. @param newSrc A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing planar source pixel that we will overwrite with. @param origSrc A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing ARGB source pixel that we will overwrite into. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param copyMask A mask to copy plane : 0x8 -- alpha, 0x4 -- red, 0x2 --- green, 0x1 --- blue @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageOverwriteChannels_ARGBFFFF
func VImageOverwriteChannelsWithPixelARGB16U ¶
func VImageOverwriteChannelsWithPixelARGB16U(thePixel *uint16, src *VImageBuffer, dest *VImageBuffer, copyMask uint8, flags uint32) int
@function vImageOverwriteChannelsWithPixel_ARGB16U @abstract Like vImageOverwriteChannelsWithScalar_ARGB16U, with a ARGB input pixel, instead of a planar one. @discussion For each pixel in src, do the following: @code // Set up a uint32_t mask - 0xFFFF where the pixels should be conserved destRow[x] = (srcRow[x] & mask) | the_pixel; @endcode This will work for other channel orderings, such as RGBA16U. You will need to adjust the ordering of bits in copyMask to compensate. This can work in place provided that for each buffer "buf" that overlaps with dest: buf->data must be equal to dest->data and buf->rowBytes >= dest->rowBytes If buf has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags @param the_pixel A pointer to Pixel_ARGB_16U that references ARGB pixel. @param src A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing ARGB source pixel. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing ARGB destination pixels. @param copyMask A mask to copy plane : 0x8 -- alpha, 0x4 -- red, 0x2 --- green, 0x1 --- blue @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. You should use this if you are doing your own threading / tiling. @return kvImageNoError Success @return kvImageInvalidParameter When copyMask > 0x0F @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageOverwriteChannelsWithPixel_ARGB16U
func VImageOverwriteChannelsWithPixelARGB8888 ¶
func VImageOverwriteChannelsWithPixelARGB8888(thePixel *uint8, src *VImageBuffer, dest *VImageBuffer, copyMask uint8, flags uint32) int
@function vImageOverwriteChannelsWithPixel_ARGB8888 @abstract Like vImageOverwriteChannelsWithScalar_ARGB8888, with a ARGB input pixel, instead of a planar one. @discussion For each pixel in src, do the following: @code // Set up a uint32_t mask - 0xFF where the pixels should be conserved destRow[x] = (srcRow[x] & mask) | the_pixel; @endcode This will work for other channel orderings, such as RGBA8888. You will need to adjust the ordering of bits in copyMask to compensate. This can work in place provided that for each buffer "buf" that overlaps with dest: buf->data must be equal to dest->data and buf->rowBytes >= dest->rowBytes If buf has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags @param the_pixel A pointer to Pixel_8888 that references ARGB pixel. @param src A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing ARGB source pixel. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing ARGB destination pixels. @param copyMask A mask to copy plane : 0x8 -- alpha, 0x4 -- red, 0x2 --- green, 0x1 --- blue @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. You should use this if you are doing your own threading / tiling. @return kvImageNoError Success @return kvImageInvalidParameter When copyMask > 0x0F @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageOverwriteChannelsWithPixel_ARGB8888
func VImageOverwriteChannelsWithPixelARGBFFFF ¶
func VImageOverwriteChannelsWithPixelARGBFFFF(thePixel *float32, src *VImageBuffer, dest *VImageBuffer, copyMask uint8, flags uint32) int
@function vImageOverwriteChannelsWithPixel_ARGBFFFF @abstract Like vImageOverwriteChannelsWithScalar_ARGBFFFF, with a ARGB input pixel, instead of a planar one. @discussion For each pixel in src, do the following: @code // Set up a uint32_t mask - 0xFFFFFFFF where the pixels should be conserved destRow[x] = (srcRow[x] & mask) | the_pixel; @endcode This will work for other channel orderings, such as RGBAFFFF. You will need to adjust the ordering of bits in copyMask to compensate. This can work in place provided that for each buffer "buf" that overlaps with dest: buf->data must be equal to dest->data and buf->rowBytes >= dest->rowBytes If buf has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags @param the_pixel A pointer to Pixel_FFFF that references ARGB pixel. @param src A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing ARGB source pixel. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing ARGB destination pixels. @param copyMask A mask to copy plane : 0x8 -- alpha, 0x4 -- red, 0x2 --- green, 0x1 --- blue @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. You should use this if you are doing your own threading / tiling. @return kvImageNoError Success @return kvImageInvalidParameter When copyMask > 0x0F @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageOverwriteChannelsWithPixel_ARGBFFFF
func VImageOverwriteChannelsWithScalarARGB8888 ¶
func VImageOverwriteChannelsWithScalarARGB8888(scalar uint8, src *VImageBuffer, dest *VImageBuffer, copyMask uint8, flags uint32) int
@function vImageOverwriteChannelsWithScalar_ARGB8888 @abstract Overwrites the pixels of one or more planes of an ARGB8888 image buffer with the provided scalar value. @discussion Fill the color channels (as indicated by copyMask) with the scalar value. For each pixel in src: @code Pixel_8888 srcPixel, destPixel; int mask; int i; mask = 0x8; for( i = 0; i < 4; i++ ) { if( copyMask & mask ) destPixel[i] = scalar; else destPixel[i] = srcPixel[i] mask = mask >> 1; } @endcode Bits 0-27 of copyMask must be 0. This function can work in place provided the following are true: src->data must be equal to dest->data and src->rowBytes >= dest->rowBytes If overlapping src has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags @note These functions may be used for images with other channel orderings such as RGBA8888 by adjusting the ordering of the bits in copyMask. @param scalar A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing scalar value that we will overwrite with. @param src A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing ARGB source pixel that we will overwrite into. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param copyMask A mask to copy plane : 0x8 -- alpha, 0x4 -- red, 0x2 --- green, 0x1 --- blue @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. You should use this if you are doing your own threading / tiling. @return kvImageNoError Success @return kvImageInvalidParameter When copyMask > 15 which is invalid. @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. @seealso vImageOverwriteChannelsWithPixel_ARGB8888 C function: vImageOverwriteChannelsWithScalar_ARGB8888
func VImageOverwriteChannelsWithScalarARGBFFFF ¶
func VImageOverwriteChannelsWithScalarARGBFFFF(scalar float32, src *VImageBuffer, dest *VImageBuffer, copyMask uint8, flags uint32) int
@function vImageOverwriteChannelsWithScalar_ARGBFFFF @abstract Overwrites the pixels of one or more planes of an ARGBFFFF image buffer with the provided scalar value. @discussion Fill the color channels (as indicated by copyMask) with the scalar value. For each pixel in src: @code Pixel_FFFF srcPixel, destPixel; int mask; int i; mask = 0x8; for( i = 0; i < 4; i++ ) { if( copyMask & mask ) destPixel[i] = scalar; else destPixel[i] = srcPixel[i] mask = mask >> 1; } @endcode Bits 0-27 of copyMask must be 0. This function can work in place provided the following are true: src->data must be equal to dest->data and src->rowBytes >= dest->rowBytes If overlapping src has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags @note These functions may be used for images with other channel orderings such as RGBAFFFF by adjusting the ordering of the bits in copyMask. @param scalar A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing scalar value that we will overwrite with. @param src A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing ARGB source pixel that we will overwrite into. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param copyMask A mask to copy plane : 0x8 -- alpha, 0x4 -- red, 0x2 --- green, 0x1 --- blue @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. You should use this if you are doing your own threading / tiling. @return kvImageNoError Success @return kvImageInvalidParameter When copyMask > 15 which is invalid. @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. @seealso vImageOverwriteChannelsWithPixel_ARGBFFFF C function: vImageOverwriteChannelsWithScalar_ARGBFFFF
func VImageOverwriteChannelsWithScalarPlanar8 ¶
func VImageOverwriteChannelsWithScalarPlanar8(scalar uint8, dest *VImageBuffer, flags uint32) int
@function vImageOverwriteChannelsWithScalar_Planar8 @abstract Fill the dest buffer with the scalar value. @param scalar A scalar value to fill the destination buffer. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageOverwriteChannelsWithScalar_Planar8
func VImageOverwriteChannelsWithScalarPlanar16F ¶
func VImageOverwriteChannelsWithScalarPlanar16F(scalar uint16, dest *VImageBuffer, flags uint32) int
@function vImageOverwriteChannelsWithScalar_Planar16F @abstract Fill the dest buffer with the scalar value. @param scalar A scalar value to fill the destination buffer. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageOverwriteChannelsWithScalar_Planar16F
func VImageOverwriteChannelsWithScalarPlanar16S ¶
func VImageOverwriteChannelsWithScalarPlanar16S(scalar int16, dest *VImageBuffer, flags uint32) int
@function vImageOverwriteChannelsWithScalar_Planar16S @abstract Fill the dest buffer with the scalar value. @param scalar A scalar value to fill the destination buffer. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageOverwriteChannelsWithScalar_Planar16S
func VImageOverwriteChannelsWithScalarPlanar16U ¶
func VImageOverwriteChannelsWithScalarPlanar16U(scalar uint16, dest *VImageBuffer, flags uint32) int
@function vImageOverwriteChannelsWithScalar_Planar16U @abstract Fill the dest buffer with the scalar value. @param scalar A scalar value to fill the destination buffer. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageOverwriteChannelsWithScalar_Planar16U
func VImageOverwriteChannelsWithScalarPlanarF ¶
func VImageOverwriteChannelsWithScalarPlanarF(scalar float32, dest *VImageBuffer, flags uint32) int
@function vImageOverwriteChannelsWithScalar_PlanarF @abstract Fill the dest buffer with the scalar value. @param scalar A scalar value to fill the destination buffer. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageOverwriteChannelsWithScalar_PlanarF
func VImagePNGDecompressionFilter ¶
func VImagePNGDecompressionFilter(buffer *VImageBuffer, startScanline uint, scanlineCount uint, bitsPerPixel uint32, filterMethodNumber uint32, filterType uint32, flags uint32) int
C function: vImagePNGDecompressionFilter
func VImagePermuteChannelsARGB16F ¶
func VImagePermuteChannelsARGB16F(src *VImageBuffer, dest *VImageBuffer, permuteMap *uint8, flags uint32) int
@function vImagePermuteChannels_ARGB16F @abstract Reorder color channels within the buffer according to the permute map. @discussion For each pixel in src, do the following: @code Pixel_ARGB_16F srcPixel, result; for( int i = 0; i < 4; i++ ) result[i] = srcPixel[ permuteMap[i] ]; @endcode The src buffer must be at least as large as the dest buffer in each dimension. (src.height >= dest.height && src.width >= dest.width) This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data and buf->rowBytes >= dest->rowBytes If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags This function may be used with any 4 channel 16-bit/channel format, such as RGBA16F, BGRA16F or AYUV16F. @param src A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing the source pixels. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param permuteMap The map describing the permutation of the 4 color channels. Each value in the map must be 0,1,2, or 3. A map of 0,1,2,3 is a copy from src->dest while a map of 3,2,1,0 is permutes ARGB -> BGRA. Providing a map value greater than 3 will result in the return of error kvImageInvalidParameter. @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageInvalidParameter When permuteMap > 3, which is invalid. @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImagePermuteChannels_ARGB16F
func VImagePermuteChannelsARGB16U ¶
func VImagePermuteChannelsARGB16U(src *VImageBuffer, dest *VImageBuffer, permuteMap *uint8, flags uint32) int
@function vImagePermuteChannels_ARGB16U @abstract Reorder color channels within the buffer according to the permute map. @discussion For each pixel in src, do the following: @code Pixel_ARGB_16U srcPixel, result; for( int i = 0; i < 4; i++ ) result[i] = srcPixel[ permuteMap[i] ]; @endcode The src buffer must be at least as large as the dest buffer in each dimension. (src.height >= dest.height && src.width >= dest.width) This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data and buf->rowBytes >= dest->rowBytes If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags This function may be used with any 4 channel 16-bit/channel format, such as RGBA16U, BGRA16U or AYUV16U. @param src A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing the source pixels. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param permuteMap The map describing the permutation of the 4 color channels. Each value in the map must be 0,1,2, or 3. A map of 0,1,2,3 is a copy from src->dest while a map of 3,2,1,0 is permutes ARGB -> BGRA. Providing a map value greater than 3 will result in the return of error kvImageInvalidParameter. @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageInvalidParameter When permuteMap > 3, which is invalid. @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImagePermuteChannels_ARGB16U
func VImagePermuteChannelsARGB8888 ¶
func VImagePermuteChannelsARGB8888(src *VImageBuffer, dest *VImageBuffer, permuteMap *uint8, flags uint32) int
@function vImagePermuteChannels_ARGB8888 @abstract Reorder color channels within the buffer according to the permute map. @discussion For each pixel in src, do the following: @code Pixel_8888 srcPixel, result; for( int i = 0; i < 4; i++ ) result[i] = srcPixel[ permuteMap[i] ]; @endcode The src buffer must be at least as large as the dest buffer in each dimension. (src.height >= dest.height && src.width >= dest.width) This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data and buf->rowBytes >= dest->rowBytes If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags This function may be used with any 4 channel 8-bit/channel format, such as RGBA8888, BGRA8888 or AYUV8888. @param src A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing the source pixels. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param permuteMap The map describing the permutation of the 4 color channels. Each value in the map must be 0,1,2, or 3. A map of 0,1,2,3 is a copy from src->dest while a map of 3,2,1,0 is permutes ARGB -> BGRA. Providing a map value greater than 3 will result in the return of error kvImageInvalidParameter. @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageInvalidParameter When permuteMap > 3, which is invalid. @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImagePermuteChannels_ARGB8888
func VImagePermuteChannelsARGBFFFF ¶
func VImagePermuteChannelsARGBFFFF(src *VImageBuffer, dest *VImageBuffer, permuteMap *uint8, flags uint32) int
@function vImagePermuteChannels_ARGBFFFF @abstract Reorder color channels within the buffer according to the permute map. @discussion For each pixel in src, do the following: @code Pixel_FFFF srcPixel, result; for( int i = 0; i < 4; i++ ) result[i] = srcPixel[ permuteMap[i] ]; @endcode The src buffer must be at least as large as the dest buffer in each dimension. (src.height >= dest.height && src.width >= dest.width) This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data and buf->rowBytes >= dest->rowBytes If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags This function may be used with any 4 channel 32-bit/channel format, such as 16S and 16F. @param src A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing the source pixels. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param permuteMap The map describing the permutation of the 4 color channels. Each value in the map must be 0,1,2, or 3. A map of 0,1,2,3 is a copy from src->dest while a map of 3,2,1,0 is permutes ARGB -> BGRA. Providing a map value greater than 3 will result in the return of error kvImageInvalidParameter. @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageInvalidParameter When permuteMap > 3, which is invalid. @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImagePermuteChannels_ARGBFFFF
func VImagePermuteChannelsRGB888 ¶
func VImagePermuteChannelsRGB888(src *VImageBuffer, dest *VImageBuffer, permuteMap *uint8, flags uint32) int
C function: vImagePermuteChannels_RGB888
func VImagePermuteChannelsWithMaskedInsertARGB16U ¶
func VImagePermuteChannelsWithMaskedInsertARGB16U(src *VImageBuffer, dest *VImageBuffer, permuteMap *uint8, copyMask uint8, backgroundColor *uint16, flags uint32) int
@function vImagePermuteChannelsWithMaskedInsert_ARGB16U @discussion This is in principle vImagePermuteChannels_ARGB16U, followed by vImageOverwriteChannelsWithScalar_ARGB16U. The fused operation is provided because it allows you to set different channels to different values (a weakness in vImageOverwriteChannelsWithScalar_ARGB16U) and because neither the Permute or Overwrite functions alone saturate the vector ALU on most architectures, so we think we can get the extra work done in the compound operation for free. For each pixel in src, do the following: @code Pixel_ARGB_16U srcPixel, destPixel; uint8_t mask = 0x8; for( int i = 0; i < 4; i++ ) { result[i] = srcPixel[ permuteMap[i] ]; if( mask & copyMask ) result[i] = backgroundColor[i]; mask = mask >> 1; } @endcode If you intend to just set the entire image to just the backgroundColor, we will detect this case and reroute to vImageBufferFill_ARGB16U. If it isn't obvious, this will of course work with other non-ARGB channel orderings. You'll need to adjust copyMask accordingly. The backgroundColor should be in the output format. This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data and buf->rowBytes >= dest->rowBytes If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags @param src A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing the source pixels. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param permuteMap The map describing the permutation of the 4 color channels. Each value in the map must be 0,1,2, or 3. A map of 0,1,2,3 is a copy from src->dest while a map of 3,2,1,0 is permutes ARGB -> BGRA. Providing a map value greater than 3 will result in the return of error kvImageInvalidParameter. @param copyMask A mask to copy plane : 0x8 -- alpha, 0x4 -- red, 0x2 --- green, 0x1 --- blue @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. \p kvImageGetTempBufferSize Does no work and returns zero, as this function does not use a temp buffer. @return kvImageNoError Success @return kvImageInvalidParameter When permuteMap > 3 which is invalid. @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImagePermuteChannelsWithMaskedInsert_ARGB16U
func VImagePermuteChannelsWithMaskedInsertARGB8888 ¶
func VImagePermuteChannelsWithMaskedInsertARGB8888(src *VImageBuffer, dest *VImageBuffer, permuteMap *uint8, copyMask uint8, backgroundColor *uint8, flags uint32) int
@function vImagePermuteChannelsWithMaskedInsert_ARGB8888 @discussion This is in principle vImagePermuteChannels_ARGB8888, followed by vImageOverwriteChannelsWithScalar_ARGB8888. The fused operation is provided because it allows you to set different channels to different values (a weakness in vImageOverwriteChannelsWithScalar_ARGB8888) and because neither the Permute or Overwrite functions alone saturate the vector ALU on most architectures, so we think we can get the extra work done in the compound operation for free. For each pixel in src, do the following: @code Pixel_8888 srcPixel, destPixel; uint8_t mask = 0x8; for( int i = 0; i < 4; i++ ) { result[i] = srcPixel[ permuteMap[i] ]; if( mask & copyMask ) result[i] = backgroundColor[i]; mask = mask >> 1; } @endcode If you intend to just set the entire image to just the backgroundColor, we will detect this case and reroute to vImageBufferFill_ARGB8888. If it isn't obvious, this will of course work with other non-ARGB channel orderings. You'll need to adjust copyMask accordingly. The backgroundColor should be in the output format. This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data and buf->rowBytes >= dest->rowBytes If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags @param src A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing the source pixels. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param permuteMap The map describing the permutation of the 4 color channels. Each value in the map must be 0,1,2, or 3. A map of 0,1,2,3 is a copy from src->dest while a map of 3,2,1,0 is permutes ARGB -> BGRA. Providing a map value greater than 3 will result in the return of error kvImageInvalidParameter. @param copyMask A mask to copy plane : 0x8 -- alpha, 0x4 -- red, 0x2 --- green, 0x1 --- blue @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. \p kvImageGetTempBufferSize Does no work and returns zero, as this function does not use a temp buffer. @return kvImageNoError Success @return kvImageInvalidParameter When permuteMap > 3 which is invalid. @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImagePermuteChannelsWithMaskedInsert_ARGB8888
func VImagePermuteChannelsWithMaskedInsertARGBFFFF ¶
func VImagePermuteChannelsWithMaskedInsertARGBFFFF(src *VImageBuffer, dest *VImageBuffer, permuteMap *uint8, copyMask uint8, backgroundColor *float32, flags uint32) int
@function vImagePermuteChannelsWithMaskedInsert_ARGBFFFF @discussion This is in principle vImagePermuteChannels_ARGBFFFF, followed by vImageOverwriteChannelsWithScalar_ARGBFFFF. The fused operation is provided because it allows you to set different channels to different values (a weakness in vImageOverwriteChannelsWithScalar_ARGBFFFF) and because neither the Permute or Overwrite functions alone saturate the vector ALU on most architectures, so we think we can get the extra work done in the compound operation for free. For each pixel in src, do the following: @code Pixel_FFFF srcPixel, destPixel; uint8_t mask = 0x8; for( int i = 0; i < 4; i++ ) { result[i] = srcPixel[ permuteMap[i] ]; if( mask & copyMask ) result[i] = backgroundColor[i]; mask = mask >> 1; } @endcode If you intend to just set the entire image to just the backgroundColor, we will detect this case and reroute to vImageBufferFill_ARGBFFFF. If it isn't obvious, this will of course work with other non-ARGB channel orderings. You'll need to adjust copyMask accordingly. The backgroundColor should be in the output format. This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data and buf->rowBytes >= dest->rowBytes If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags @param src A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing the source pixels. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param permuteMap The map describing the permutation of the 4 color channels. Each value in the map must be 0,1,2, or 3. A map of 0,1,2,3 is a copy from src->dest while a map of 3,2,1,0 is permutes ARGB -> BGRA. Providing a map value greater than 3 will result in the return of error kvImageInvalidParameter. @param copyMask A mask to copy plane : 0x8 -- alpha, 0x4 -- red, 0x2 --- green, 0x1 --- blue @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. \p kvImageGetTempBufferSize Does no work and returns zero, as this function does not use a temp buffer. @return kvImageNoError Success @return kvImageInvalidParameter When permuteMap > 3 which is invalid. @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImagePermuteChannelsWithMaskedInsert_ARGBFFFF
func VImagePerspectiveWarpARGB16F ¶
func VImagePerspectiveWarpARGB16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImagePerpsectiveTransform, interpolation int32, backColor *uint16, flags uint32) int
C function: vImagePerspectiveWarp_ARGB16F
func VImagePerspectiveWarpARGB16U ¶
func VImagePerspectiveWarpARGB16U(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImagePerpsectiveTransform, interpolation int32, backColor *uint16, flags uint32) int
C function: vImagePerspectiveWarp_ARGB16U
func VImagePerspectiveWarpARGB8888 ¶
func VImagePerspectiveWarpARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImagePerpsectiveTransform, interpolation int32, backColor *uint8, flags uint32) int
C function: vImagePerspectiveWarp_ARGB8888
func VImagePerspectiveWarpPlanar8 ¶
func VImagePerspectiveWarpPlanar8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImagePerpsectiveTransform, interpolation int32, backColor uint8, flags uint32) int
C function: vImagePerspectiveWarp_Planar8
func VImagePerspectiveWarpPlanar16F ¶
func VImagePerspectiveWarpPlanar16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImagePerpsectiveTransform, interpolation int32, backColor uint16, flags uint32) int
C function: vImagePerspectiveWarp_Planar16F
func VImagePerspectiveWarpPlanar16U ¶
func VImagePerspectiveWarpPlanar16U(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, transform *VImagePerpsectiveTransform, interpolation int32, backColor uint16, flags uint32) int
C function: vImagePerspectiveWarp_Planar16U
func VImagePiecewiseGammaPlanar8 ¶
func VImagePiecewiseGammaPlanar8(src *VImageBuffer, dest *VImageBuffer, exponentialCoeffs *float32, gamma unsafe.Pointer, linearCoeffs *float32, boundary uint8, flags uint32) int
C function: vImagePiecewiseGamma_Planar8
func VImagePiecewiseGammaPlanar8toPlanar16Q12 ¶
func VImagePiecewiseGammaPlanar8toPlanar16Q12(src *VImageBuffer, dest *VImageBuffer, exponentialCoeffs *float32, gamma unsafe.Pointer, linearCoeffs *float32, boundary uint8, flags uint32) int
C function: vImagePiecewiseGamma_Planar8toPlanar16Q12
func VImagePiecewiseGammaPlanar8toPlanarF ¶
func VImagePiecewiseGammaPlanar8toPlanarF(src *VImageBuffer, dest *VImageBuffer, exponentialCoeffs *float32, gamma unsafe.Pointer, linearCoeffs *float32, boundary uint8, flags uint32) int
C function: vImagePiecewiseGamma_Planar8toPlanarF
func VImagePiecewiseGammaPlanar16Q12 ¶
func VImagePiecewiseGammaPlanar16Q12(src *VImageBuffer, dest *VImageBuffer, exponentialCoeffs *float32, gamma unsafe.Pointer, linearCoeffs *float32, boundary int16, flags uint32) int
C function: vImagePiecewiseGamma_Planar16Q12
func VImagePiecewiseGammaPlanar16Q12toPlanar8 ¶
func VImagePiecewiseGammaPlanar16Q12toPlanar8(src *VImageBuffer, dest *VImageBuffer, exponentialCoeffs *float32, gamma unsafe.Pointer, linearCoeffs *float32, boundary int16, flags uint32) int
C function: vImagePiecewiseGamma_Planar16Q12toPlanar8
func VImagePiecewiseGammaPlanarF ¶
func VImagePiecewiseGammaPlanarF(src *VImageBuffer, dest *VImageBuffer, exponentialCoeffs *float32, gamma unsafe.Pointer, linearCoeffs *float32, boundary unsafe.Pointer, flags uint32) int
C function: vImagePiecewiseGamma_PlanarF
func VImagePiecewiseGammaPlanarFtoPlanar8 ¶
func VImagePiecewiseGammaPlanarFtoPlanar8(src *VImageBuffer, dest *VImageBuffer, exponentialCoeffs *float32, gamma unsafe.Pointer, linearCoeffs *float32, boundary unsafe.Pointer, flags uint32) int
C function: vImagePiecewiseGamma_PlanarFtoPlanar8
func VImagePiecewisePolynomialPlanar8toPlanarF ¶
func VImagePiecewisePolynomialPlanar8toPlanarF(src *VImageBuffer, dest *VImageBuffer, coefficients *float32, boundaries *float32, order uint32, log2segments uint32, flags uint32) int
C function: vImagePiecewisePolynomial_Planar8toPlanarF
func VImagePiecewisePolynomialPlanarF ¶
func VImagePiecewisePolynomialPlanarF(src *VImageBuffer, dest *VImageBuffer, coefficients *float32, boundaries *float32, order uint32, log2segments uint32, flags uint32) int
C function: vImagePiecewisePolynomial_PlanarF
func VImagePiecewisePolynomialPlanarFtoPlanar8 ¶
func VImagePiecewisePolynomialPlanarFtoPlanar8(src *VImageBuffer, dest *VImageBuffer, coefficients *float32, boundaries *float32, order uint32, log2segments uint32, flags uint32) int
C function: vImagePiecewisePolynomial_PlanarFtoPlanar8
func VImagePiecewiseRationalPlanarF ¶
func VImagePiecewiseRationalPlanarF(src *VImageBuffer, dest *VImageBuffer, topCoefficients *float32, bottomCoefficients *float32, boundaries *float32, topOrder uint32, bottomOrder uint32, log2segments uint32, flags uint32) int
C function: vImagePiecewiseRational_PlanarF
func VImagePremultipliedAlphaBlendARGB8888 ¶
func VImagePremultipliedAlphaBlendARGB8888(srcTop *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImagePremultipliedAlphaBlend_ARGB8888 @abstract blend two premultiplied ARGB8888 images to produce a premultiplied ARGB8888 result. @discussion For each color channel: <pre>@textblock uint8_t destColor = srcTopColor + ((255 - srcTopAlpha) * srcBottomColor + 127)/255; @/textblock</pre> Similarly, the output alpha channel (the new alpha value for that pixel) can be calculated as: <pre>@textblock uint8_t alpha = srcTopAlpha + ((255 - srcTopAlpha) * srcBottomAlpha + 127)/255; @/textblock</pre> The alpha values are presumed to be normalized over the range [0, 255]. This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags The function will work for all 4 channel 8-bit / channel image formats with alpha first in memory, not just ARGB. @param srcTop The top image @param srcBottom The bottom image @param dest The result image is written here. This buffer must be preallocated before the function is called. @param flags The following flags may be used: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Disable internal multithreading. You might want to do that if you are calling this in the context of your own multithreaded tiling engine. @/textblock </pre> @result The following error codes may occur: <pre>@textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer The height and width of the result must be less than or equal to each of the input buffers. @/textblock</pre> C function: vImagePremultipliedAlphaBlend_ARGB8888
func VImagePremultipliedAlphaBlendARGBFFFF ¶
func VImagePremultipliedAlphaBlendARGBFFFF(srcTop *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImagePremultipliedAlphaBlend_ARGBFFFF @abstract blend two premultiplied ARGBFFFF images to produce a premultiplied ARGBFFFF result. @discussion <pre>@textblock float destColor = srcTopColor + (1.0 - srcTopAlpha) * srcBottomColor; @/textblock</pre> Similarly, the output alpha channel (the new alpha value for that pixel) can be calculated as: <pre>@textblock float alpha = srcTopAlpha + (1.0 - srcTopAlpha) * srcBottomAlpha @/textblock</pre> The alpha values are presumed to be normalized over the range [0.0f, 1.0f]. This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags The function will work for all 4 channel float / channel image formats with alpha first in memory, not just ARGB. @param srcTop The top image @param srcBottom The bottom image @param dest The result image is written here. This buffer must be preallocated before the function is called. @param flags The following flags may be used: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Disable internal multithreading. You might want to do that if you are calling this in the context of your own multithreaded tiling engine. @/textblock </pre> @result The following error codes may occur: <pre>@textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer The height and width of the result must be less than or equal to each of the input buffers. @/textblock</pre> C function: vImagePremultipliedAlphaBlend_ARGBFFFF
func VImagePremultipliedAlphaBlendBGRA8888 ¶
func VImagePremultipliedAlphaBlendBGRA8888(srcTop *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImagePremultipliedAlphaBlend_BGRA8888 @abstract blend two premultiplied BGRA8888 images to produce a premultiplied BGRA8888 result. @discussion For each color channel: <pre>@textblock uint8_t destColor = srcTopColor + ((255 - srcTopAlpha) * srcBottomColor + 127)/255; @/textblock</pre> Similarly, the output alpha channel (the new alpha value for that pixel) can be calculated as: <pre>@textblock uint8_t alpha = srcTopAlpha + ((255 - srcTopAlpha) * srcBottomAlpha + 127)/255; @/textblock</pre> The alpha values are presumed to be normalized over the range [0, 255]. This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags The function will work for all 4 channel 8-bit / channel image formats with alpha last in memory, not just BGRA. Also available as vImagePremultipliedAlphaBlend_RGBA8888(). @param srcTop The top image @param srcBottom The bottom image @param dest The result image is written here. This buffer must be preallocated before the function is called. @param flags The following flags may be used: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Disable internal multithreading. You might want to do that if you are calling this in the context of your own multithreaded tiling engine. @/textblock </pre> @result The following error codes may occur: <pre>@textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer The height and width of the result must be less than or equal to each of the input buffers. @/textblock</pre> C function: vImagePremultipliedAlphaBlend_BGRA8888
func VImagePremultipliedAlphaBlendBGRAFFFF ¶
func VImagePremultipliedAlphaBlendBGRAFFFF(srcTop *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImagePremultipliedAlphaBlend_BGRAFFFF @abstract blend two premultiplied ARGBFFFF images to produce a premultiplied BGRAFFFF result. @discussion <pre>@textblock float destColor = srcTopColor + (1.0 - srcTopAlpha) * srcBottomColor; @/textblock</pre> Similarly, the output alpha channel (the new alpha value for that pixel) can be calculated as: <pre>@textblock float alpha = srcTopAlpha + (1.0 - srcTopAlpha) * srcBottomAlpha @/textblock</pre> The alpha values are presumed to be normalized over the range [0.0f, 1.0f]. This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags The function will work for all 4 channel float / channel image formats with alpha first in memory, not just BGRA. Also available as vImagePremultipliedAlphaBlend_RGBAFFFF. @param srcTop The top image @param srcBottom The bottom image @param dest The result image is written here. This buffer must be preallocated before the function is called. @param flags The following flags may be used: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Disable internal multithreading. You might want to do that if you are calling this in the context of your own multithreaded tiling engine. @/textblock </pre> @result The following error codes may occur: <pre>@textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer The height and width of the result must be less than or equal to each of the input buffers. @/textblock</pre> C function: vImagePremultipliedAlphaBlend_BGRAFFFF
func VImagePremultipliedAlphaBlendDarkenRGBA8888 ¶
func VImagePremultipliedAlphaBlendDarkenRGBA8888(srcTop *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImagePremultipliedAlphaBlendDarken_RGBA8888 @abstract blend two premultiplied RGBA8888 images using the Darken blend mode to produce a premultiplied RGBA8888 result. @discussion For each color channel: <pre>@textblock uint8_t destColor = MIN( topColor + ((255 - srcTopAlpha) * srcBotomColor + 127) / 255, bottomColor + ((255 - srcBottomAlpha) * srcTopColor + 127) / 255); @/textblock</pre> The output alpha channel (the new alpha value for that pixel) can be calculated as: <pre>@textblock uint8_t alpha = srcTopAlpha + ((255 - srcTopAlpha) * srcBottomAlpha + 127)/255; @/textblock</pre> The alpha values are presumed to be normalized over the range [0, 255]. This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags The function will work for all 4 channel 8-bit / channel image formats with alpha last in memory, not just RGBA. This function corresponds to the darken blend mode in feBlend in the SVG standard. http://www.w3.org/TR/SVG/filters.html) @param srcTop The top image @param srcBottom The bottom image @param dest The result image is written here. This buffer must be preallocated before the function is called. @param flags The following flags may be used: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Disable internal multithreading. You might want to do that if you are calling this in the context of your own multithreaded tiling engine. @/textblock </pre> @result The following error codes may occur: <pre>@textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer The height and width of the result must be less than or equal to each of the input buffers. @/textblock</pre> C function: vImagePremultipliedAlphaBlendDarken_RGBA8888
func VImagePremultipliedAlphaBlendLightenRGBA8888 ¶
func VImagePremultipliedAlphaBlendLightenRGBA8888(srcTop *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImagePremultipliedAlphaBlendLighten_RGBA8888 @abstract blend two premultiplied RGBA8888 images using the Lighten blend mode to produce a premultiplied RGBA8888 result. @discussion For each color channel: <pre>@textblock uint8_t destColor = MAX( topColor + ((255 - srcTopAlpha) * srcBotomColor + 127) / 255, bottomColor + ((255 - srcBottomAlpha) * srcTopColor + 127) / 255); @/textblock</pre> The output alpha channel (the new alpha value for that pixel) can be calculated as: <pre>@textblock uint8_t alpha = srcTopAlpha + ((255 - srcTopAlpha) * srcBottomAlpha + 127)/255; @/textblock</pre> The alpha values are presumed to be normalized over the range [0, 255]. This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags The function will work for all 4 channel 8-bit / channel image formats with alpha last in memory, not just RGBA. This function corresponds to the lighten blend mode in feBlend in the SVG standard. http://www.w3.org/TR/SVG/filters.html) @param srcTop The top image @param srcBottom The bottom image @param dest The result image is written here. This buffer must be preallocated before the function is called. @param flags The following flags may be used: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Disable internal multithreading. You might want to do that if you are calling this in the context of your own multithreaded tiling engine. @/textblock </pre> @result The following error codes may occur: <pre>@textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer The height and width of the result must be less than or equal to each of the input buffers. @/textblock</pre> C function: vImagePremultipliedAlphaBlendLighten_RGBA8888
func VImagePremultipliedAlphaBlendMultiplyRGBA8888 ¶
func VImagePremultipliedAlphaBlendMultiplyRGBA8888(srcTop *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImagePremultipliedAlphaBlendMultiply_RGBA8888 @abstract blend two premultiplied RGBA8888 images using the Multiply blend mode to produce a premultiplied RGBA8888 result. @discussion For each color channel: <pre>@textblock uint8_t destColor =((255 - srcTopAlpha) * srcBottomColor + (255 - srcBottomAlpha) * srcTopColor + srcTopColor * srcBottomColor + 127)/255; @/textblock</pre> The output alpha channel (the new alpha value for that pixel) can be calculated as: <pre>@textblock uint8_t alpha = srcTopAlpha + ((255 - srcTopAlpha) * srcBottomAlpha + 127)/255; @/textblock</pre> The alpha values are presumed to be normalized over the range [0, 255]. This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags The function will work for all 4 channel 8-bit / channel image formats with alpha last in memory, not just RGBA. This function corresponds to the multiply blend mode in feBlend in the SVG standard. http://www.w3.org/TR/SVG/filters.html) @param srcTop The top image @param srcBottom The bottom image @param dest The result image is written here. This buffer must be preallocated before the function is called. @param flags The following flags may be used: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Disable internal multithreading. You might want to do that if you are calling this in the context of your own multithreaded tiling engine. @/textblock </pre> @result The following error codes may occur: <pre>@textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer The height and width of the result must be less than or equal to each of the input buffers. @/textblock</pre> C function: vImagePremultipliedAlphaBlendMultiply_RGBA8888
func VImagePremultipliedAlphaBlendPlanar8 ¶
func VImagePremultipliedAlphaBlendPlanar8(srcTop *VImageBuffer, srcTopAlpha *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImagePremultipliedAlphaBlend_Planar8 @abstract blend two premultiplied Planar8 images to produce a premultiplied Planar8 result. @discussion For each color channel: <pre>@textblock uint8_t destColor = srcTopColor + ((255 - srcTopAlpha) * srcBottomColor + 127)/255; @/textblock</pre> Similarly, the output alpha channel (the new alpha value for that pixel) can be calculated as: <pre>@textblock uint8_t alpha = srcTopAlpha + ((255 - srcTopAlpha) * srcBottomAlpha + 127)/255; @/textblock</pre> The alpha values are presumed to be normalized over the range [0, 255]. This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags @param srcTop The top image @param srcTopAlpha The coverage component for the top image (alpha) @param srcBottom The bottom image @param dest The result image is written here. This buffer must be preallocated before the function is called. <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Disable internal multithreading. You might want to do that if you are calling this in the context of your own multithreaded tiling engine. @/textblock </pre> @result The following error codes may occur: <pre>@textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer The height and width of the result must be less than or equal to each of the input buffers. @/textblock</pre> C function: vImagePremultipliedAlphaBlend_Planar8
func VImagePremultipliedAlphaBlendPlanarF ¶
func VImagePremultipliedAlphaBlendPlanarF(srcTop *VImageBuffer, srcTopAlpha *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImagePremultipliedAlphaBlend_PlanarF
func VImagePremultipliedAlphaBlendScreenRGBA8888 ¶
func VImagePremultipliedAlphaBlendScreenRGBA8888(srcTop *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImagePremultipliedAlphaBlendScreen_RGBA8888 @abstract blend two premultiplied RGBA8888 images using the Screen blend mode to produce a premultiplied RGBA8888 result. @discussion For each color channel: <pre>@textblock uint8_t destColor = CLAMP( srcTopColor + srcBottomcolor - (srcTopColor * srcBottomColor + 127)/255, 0, 255); @/textblock</pre> The output alpha channel (the new alpha value for that pixel) can be calculated as: <pre>@textblock uint8_t alpha = srcTopAlpha + ((255 - srcTopAlpha) * srcBottomAlpha + 127)/255; @/textblock</pre> The alpha values are presumed to be normalized over the range [0, 255]. This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags The function will work for all 4 channel 8-bit / channel image formats with alpha last in memory, not just RGBA. This function corresponds to the screen blend mode in feBlend in the SVG standard. http://www.w3.org/TR/SVG/filters.html) @param srcTop The top image @param srcBottom The bottom image @param dest The result image is written here. This buffer must be preallocated before the function is called. @param flags The following flags may be used: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Disable internal multithreading. You might want to do that if you are calling this in the context of your own multithreaded tiling engine. @/textblock </pre> @result The following error codes may occur: <pre>@textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer The height and width of the result must be less than or equal to each of the input buffers. @/textblock</pre> C function: vImagePremultipliedAlphaBlendScreen_RGBA8888
func VImagePremultipliedAlphaBlendWithPermuteARGB8888 ¶
func VImagePremultipliedAlphaBlendWithPermuteARGB8888(srcTop *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, permuteMap *uint8, makeDestAlphaOpaque bool, flags uint32) int
@function vImagePremultipliedAlphaBlendWithPermute_ARGB8888 @abstract Reorder the channels of the top 8-bit 4 channel premultiplied image, blend into a bottom premultiplied ARGB8888 image. @discussion This function does 3 things. <pre>@textblock 1. Changes the order of channels of srcTop according to permuteMap. 2. A premultiplied alpha compositing. 3. Set destA to 0xFF when makeDestAlphaOpaque is true. permuteMap[i] = 0, 1, 2, or 3 to specify how we permute each channel in srcTop. permuteMap[0] tells which channel in srcTop XXXX8888 will be used as A. permuteMap[1] tells which channel in srcTop XXXX8888 will be used as R. permuteMap[2] tells which channel in srcTop XXXX8888 will be used as G. permuteMap[3] tells which channel in srcTop XXXX8888 will be used as B. @/textblock</pre> This permuteMap lets us to cover any channel order for the top and bottom images. For example, <pre>@textblock PremultipliedAlphaBlend(srcTop_ARGB8888, srcBottom_ARGB8888) -> dest_ARGB8888 will be covered by permuteMap[4] = {0, 1, 2, 3} PremultipliedAlphaBlend(srcTop_RGBA8888, srcBottom_ARGB8888) -> dest_ARGB8888 will be covered by permuteMap[4] = {3, 0, 1, 2} PremultipliedAlphaBlend(srcTop_ABGR8888, srcBottom_ARGB8888) -> dest_ARGB8888 will be covered by permuteMap[4] = {0, 3, 2, 1} PremultipliedAlphaBlend(srcTop_BGRA8888, srcBottom_ARGB8888) -> dest_ARGB8888 will be covered by permuteMap[4] = {3, 2, 1, 0} @/textblock</pre> srcBottom will have the same pixel format (ARGB8888) as dest. The per-pixel operation is: <pre>@textblock uint8_t *srcTop, *srcBottom, *dest; uint8_t srcTopA, srcTopR, srcTopG, srcTopB; uint8_t srcBottomA, srcBottomR, srcBottomG, srcBottomB; uint8_t destA, destR, destG, destB; srcTopA = srcTop[ permuteMap[0] ]; srcTopR = srcTop[ permuteMap[1] ]; srcTopG = srcTop[ permuteMap[2] ]; srcTopB = srcTop[ permuteMap[3] ]; srcBottomA = srcBottom[ 0 ]; srcBottomR = srcBottom[ 1 ]; srcBottomG = srcBottom[ 2 ]; srcBottomB = srcBottom[ 3 ]; destR = (srcTopR * 255 + (255 - srcTopA) * srcBottomR + 127) / 255; destG = (srcTopG * 255 + (255 - srcTopA) * srcBottomG + 127) / 255; destB = (srcTopB * 255 + (255 - srcTopA) * srcBottomB + 127) / 255; if(makeDestAlphaOpaque) { dest[0] = 0xFF; dest[1] = destR; dest[2] = destG; dest[3] = destB; } else { destA = (srcTopA * 255 + (255 - srcTopA) * srcBottomA + 127) / 255; dest[0] = destA; dest[1] = destR; dest[2] = destG; dest[3] = destB; } @/textblock</pre> This function can work in place. @param srcTop A pointer to vImage_Buffer that references 8-bit XXXX interleaved source top image. @param srcBottom A pointer to vImage_Buffer that references 8-bit ARGB interleaved source bottom image. @param dest A pointer to vImage_Buffer that references 8-bit ARGB interleaved destination image. @param permuteMap Values that can be used to switch the channel order of the source top image. @param makeDestAlphaOpaque A boolean to set destA into 0xFF when it's true. @param flags The following flags are allowed: <pre>@textblock kvImageGetTempBufferSize Returns 0. Does no work. kvImageDoNotTile Disables internal multithreading, if any. @/textblock</pre> @return The following error codes may be returned: <pre>@textblock kvImageNoError Is returned when there was no error. kvImageRoiLargerThanInputBuffer The destination buffers are larger than the source buffer. kvImageBufferSizeMismatch Is returned when there is a mismatch in width & height of srcTop and srcBottom. kvImageUnknownFlagsBit Is returned when there is a unknown flag. kvImageInvalidParameter Is returned when the values in permuteMap[i] is not one of 0, 1, 2, or 3. @/textblock</pre> C function: vImagePremultipliedAlphaBlendWithPermute_ARGB8888
func VImagePremultipliedAlphaBlendWithPermuteRGBA8888 ¶
func VImagePremultipliedAlphaBlendWithPermuteRGBA8888(srcTop *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, permuteMap *uint8, makeDestAlphaOpaque bool, flags uint32) int
@function vImagePremultipliedAlphaBlendWithPermute_RGBA8888 @abstract Reorder the channels of the top 8-bit 4 channel premultiplied image, blend into a bottom premultiplied RGBA8888 image. @discussion This function does 3 things. <pre>@textblock 1. Changes the order of channels of srcTop according to permuteMap. 2. A premultiplied alpha compositing. 3. Set destA to 0xFF when makeDestAlphaOpaque is true. permuteMap[i] = 0, 1, 2, or 3 to specify how we permute each channel in srcTop. permuteMap[0] tells which channel in srcTop XXXX8888 will be used as A. permuteMap[1] tells which channel in srcTop XXXX8888 will be used as R. permuteMap[2] tells which channel in srcTop XXXX8888 will be used as G. permuteMap[3] tells which channel in srcTop XXXX8888 will be used as B. @/textblock</pre> This permuteMap lets us to cover any channel order for the top and bottom images. For example, <pre>@textblock PremultipliedAlphaBlend(srcTop_RGBA8888, srcBottom_RGBA8888) -> dest_RGBA8888 will be covered by permuteMap[4] = {0, 1, 2, 3} PremultipliedAlphaBlend(srcTop_ARGB8888, srcBottom_RGBA8888) -> dest_RGBA8888 will be covered by permuteMap[4] = {1, 2, 3, 0} PremultipliedAlphaBlend(srcTop_ABGR8888, srcBottom_RGBA8888) -> dest_RGBA8888 will be covered by permuteMap[4] = {3, 2, 1, 0} PremultipliedAlphaBlend(srcTop_BGRA8888, srcBottom_RGBA8888) -> dest_RGBA8888 will be covered by permuteMap[4] = {2, 1, 0, 3} @/textblock</pre> srcBottom will have the same pixel format (RGBA8888) as dest. The per-pixel operation is: <pre>@textblock uint8_t *srcTop, *srcBottom, *dest; uint8_t srcTopA, srcTopR, srcTopG, srcTopB; uint8_t srcBottomA, srcBottomR, srcBottomG, srcBottomB; uint8_t destA, destR, destG, destB; srcTopR = srcTop[ permuteMap[0] ]; srcTopG = srcTop[ permuteMap[1] ]; srcTopB = srcTop[ permuteMap[2] ]; srcTopA = srcTop[ permuteMap[3] ]; srcBottomR = srcBottom[ 0 ]; srcBottomG = srcBottom[ 1 ]; srcBottomB = srcBottom[ 2 ]; srcBottomA = srcBottom[ 3 ]; destR = (srcTopR * 255 + (255 - srcTopA) * srcBottomR + 127) / 255; destG = (srcTopG * 255 + (255 - srcTopA) * srcBottomG + 127) / 255; destB = (srcTopB * 255 + (255 - srcTopA) * srcBottomB + 127) / 255; if(makeDestAlphaOpaque) { dest[0] = 0xFF; dest[1] = destR; dest[2] = destG; dest[3] = destB; } else { destA = (srcTopA * 255 + (255 - srcTopA) * srcBottomA + 127) / 255; dest[0] = destA; dest[1] = destR; dest[2] = destG; dest[3] = destB; } @/textblock</pre> This function can work in place. @param srcTop A pointer to vImage_Buffer that references 8-bit XXXX interleaved source top image. @param srcBottom A pointer to vImage_Buffer that references 8-bit RGBA interleaved source bottom image. @param dest A pointer to vImage_Buffer that references 8-bit RGBA interleaved destination image. @param permuteMap Values that can be used to switch the channel order of the source top image. @param makeDestAlphaOpaque A boolean to set destA into 0xFF when it's true. @param flags The following flags are allowed: <pre>@textblock kvImageGetTempBufferSize Returns 0. Does no work. kvImageDoNotTile Disables internal multithreading, if any. @/textblock</pre> @return The following error codes may be returned: <pre>@textblock kvImageNoError Is returned when there was no error. kvImageRoiLargerThanInputBuffer The destination buffers are larger than the source buffer. kvImageBufferSizeMismatch Is returned when there is a mismatch in width & height of srcTop and srcBottom. kvImageUnknownFlagsBit Is returned when there is a unknown flag. kvImageInvalidParameter Is returned when the values in permuteMap[i] is not one of 0, 1, 2, or 3. @/textblock</pre> C function: vImagePremultipliedAlphaBlendWithPermute_RGBA8888
func VImagePremultipliedConstAlphaBlendARGB8888 ¶
func VImagePremultipliedConstAlphaBlendARGB8888(srcTop *VImageBuffer, constAlpha uint8, srcBottom *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImagePremultipliedConstAlphaBlend_ARGB8888 @abstract Blend two ARGB8888 premultiplied images with an extra image-wide alpha for the top image @discussion This is a premultiplied alpha compositing function using a constant for alpha over the whole image. Color data from both images is presumed to be already premultiplied by its own per-pixel alpha. For calculations involving 8-bit integer data, the calculation is done with an additional rounding step followed by division by 255: <pre>@textblock uint8_t destColor = (srcTopColor * constAlpha * 255 + (255*255 - srcTopAlpha * constAlpha) * srcBottomColor + 127*255) / (255*255); uint8_t destAlpha = (srcTopAlpha * constAlpha * 255 + (255*255 - srcTopAlpha * constAlpha) * srcBottomAlpha + 127*255 ) / (255*255); @/textblock</pre> This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags The function will work for all 4 channel 8-bit / channel image formats with alpha first in memory, not just ARGB. @param srcTop The top image @param constAlpha An extra alpha to apply to the entire top image @param srcBottom The bottom image @param dest A preallocate vImage_Buffer where the result will be written @param flags The following flags are allowed: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading @/textblock</pre> @return The following error codes may be returned: <pre>@textblock kvImageNoError Success kvImageRoiLargerThanInputBuffer The destination buffer height or width is larger than the corresponding dimension in srcTop, srcTopAlpha or srcBottom @/textblock</pre> C function: vImagePremultipliedConstAlphaBlend_ARGB8888
func VImagePremultipliedConstAlphaBlendARGBFFFF ¶
func VImagePremultipliedConstAlphaBlendARGBFFFF(srcTop *VImageBuffer, constAlpha float32, srcBottom *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImagePremultipliedConstAlphaBlend_ARGBFFFF @abstract Blend two ARGBFFFF premultiplied images with an extra image-wide alpha for the top image @discussion This is a premultiplied alpha compositing function using a constant for alpha over the whole image. Color data from both images is presumed to be already premultiplied by its own per-pixel alpha. For calculations involving 8-bit integer data, the calculation is done with an additional rounding step followed by division by 255: <pre>@textblock float destColor = srcTopColor * constAlpha + (1.0 - srcTopAlpha * constAlpha) * srcBottomColor; float alpha = srcTopAlpha * constAlpha + (1.0 - srcTopAlpha * constAlpha) * srcBottomAlpha @/textblock</pre> This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags The function will work for all 4 channel float / channel image formats with alpha first in memory, not just ARGB. @param srcTop The top image @param constAlpha An extra alpha to apply to the entire top image @param srcBottom The bottom image @param dest A preallocate vImage_Buffer where the result will be written @param flags The following flags are allowed: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading @/textblock</pre> @return The following error codes may be returned: <pre>@textblock kvImageNoError Success kvImageRoiLargerThanInputBuffer The destination buffer height or width is larger than the corresponding dimension in srcTop, srcTopAlpha or srcBottom @/textblock</pre> C function: vImagePremultipliedConstAlphaBlend_ARGBFFFF
func VImagePremultipliedConstAlphaBlendPlanar8 ¶
func VImagePremultipliedConstAlphaBlendPlanar8(srcTop *VImageBuffer, constAlpha uint8, srcTopAlpha *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImagePremultipliedConstAlphaBlend_Planar8 @abstract Blend two Planar8 premultiplied images with an extra image-wide alpha for the top image @discussion This is a premultiplied alpha compositing function using a constant for alpha over the whole image. Color data from both images is presumed to be already premultiplied by its own per-pixel alpha. For calculations involving 8-bit integer data, the calculation is done with an additional rounding step followed by division by 255: <pre>@textblock uint8_t destColor = (srcTopColor * constAlpha * 255 + (255*255 - srcTopAlpha * constAlpha) * srcBottomColor + 127*255) / (255*255); uint8_t destAlpha = (srcTopAlpha * constAlpha * 255 + (255*255 - srcTopAlpha * constAlpha) * srcBottomAlpha + 127*255 ) / (255*255); @/textblock</pre> This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags @param srcTop The top image @param constAlpha An extra alpha to apply to the entire top image @param srcTopAlpha The alpha channel for the top image @param srcBottom The bottom image @param dest A preallocate vImage_Buffer where the result will be written @param flags The following flags are allowed: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading @/textblock</pre> @return The following error codes may be returned: <pre>@textblock kvImageNoError Success kvImageRoiLargerThanInputBuffer The destination buffer height or width is larger than the corresponding dimension in srcTop, srcTopAlpha or srcBottom @/textblock</pre> C function: vImagePremultipliedConstAlphaBlend_Planar8
func VImagePremultipliedConstAlphaBlendPlanarF ¶
func VImagePremultipliedConstAlphaBlendPlanarF(srcTop *VImageBuffer, constAlpha float32, srcTopAlpha *VImageBuffer, srcBottom *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImagePremultipliedConstAlphaBlend_PlanarF @abstract Blend two PlanarF premultiplied images with an extra image-wide alpha for the top image @discussion This is a premultiplied alpha compositing function using a constant for alpha over the whole image. Color data from both images is presumed to be already premultiplied by its own per-pixel alpha. <pre>@textblock float destColor = srcTopColor * constAlpha + (1.0 - srcTopAlpha * constAlpha) * srcBottomColor; float alpha = srcTopAlpha * constAlpha + (1.0 - srcTopAlpha * constAlpha) * srcBottomAlpha @/textblock </pre> This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags @param srcTop The top image @param constAlpha An extra alpha to apply to the entire top image @param srcTopAlpha The alpha channel for the top image @param srcBottom The bottom image @param dest A preallocate vImage_Buffer where the result will be written @param flags The following flags are allowed: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading @/textblock</pre> @return The following error codes may be returned: <pre>@textblock kvImageNoError Success kvImageRoiLargerThanInputBuffer The destination buffer height or width is larger than the corresponding dimension in srcTop, srcTopAlpha or srcBottom @/textblock</pre> C function: vImagePremultipliedConstAlphaBlend_PlanarF
func VImagePremultiplyDataARGB16Q12 ¶
func VImagePremultiplyDataARGB16Q12(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImagePremultiplyData_ARGB16Q12 @abstract Multiply a signed 16Q12 fixed-point ARGB color channel by its corresponding alpha @discussion This function multiplies color channels by the alpha channel. For each color in each pixel: <pre>@textblock int16_t destColor = CLAMP((src * alpha + 2048) / 4096, INT16_MIN, INT16_MAX); int16_t destAlpha = alpha; @/textblock </pre> This function can work in place provided the following are true: If src overlaps with dest, src->data must be equal to dest->data If src also has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags (It is not necessary to pass kvImageDoNotTile if src and dest do not overlap.) This function will for other 4 channel 16Q12 / channel image formats with alpha first in memory. It does not have to be ARGB. @param src The color data to multiply with alpha @param dest A preallocated vImage_Buffer where the results are written @param flags The following flags are allowed: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading. This might be useful if you are already multithreading the work in your own tiling engine. @/textblock </pre> @result The following result codes may occur: <pre>@textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer dest->width and dest->height must be less than or equal to corresponding dimensions in src and alpha @/textblock</pre> C function: vImagePremultiplyData_ARGB16Q12
func VImagePremultiplyDataARGB16U ¶
func VImagePremultiplyDataARGB16U(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImagePremultiplyData_ARGB16U @abstract Multiply a unsigned 16-bit ARGB color channel by its corresponding alpha @discussion This function multiplies color channels by the alpha channel. <pre>@textblock For each color channel: uint16_t destColor = (src * alpha + 32767) / 65535; uint16_t destAlpha = alpha; This function can work in place provided the following are true: If src overlaps with dest, src->data must be equal to dest->data If src also has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags (It is not necessary to pass kvImageDoNotTile if src and dest do not overlap.) @/textblock </pre> This function will for all 4 channel uint16_t / channel image formats with alpha first in memory. It does not have to be ARGB. @param src The color data to multiply with alpha @param dest A preallocated vImage_Buffer where the results are written @param flags The following flags are allowed: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading. This might be useful if you are already multithreading the work in your own tiling engine. @/textblock </pre> @result The following result codes may occur: <pre>@textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer dest->width and dest->height must be less than or equal to corresponding dimensions in src and alpha @/textblock</pre> C function: vImagePremultiplyData_ARGB16U
func VImagePremultiplyDataARGB8888 ¶
func VImagePremultiplyDataARGB8888(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImagePremultiplyData_ARGB8888 @abstract Multiply a ARGB8888 color channel by its corresponding alpha @discussion This function multiplies color channels by the alpha channel. <pre>@textblock For each color channel: uint8_t destColor = (src * alpha + 127) / 255; uint8_t destAlpha = alpha; This function can work in place provided the following are true: If src overlaps with dest, src->data must be equal to dest->data If src also has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags (It is not necessary to pass kvImageDoNotTile if src and dest do not overlap.) @/textblock </pre> This function will for all 4 channel 8-bit / channel image formats with alpha first in memory. It does not have to be ARGB. @param src The color data to multiply with alpha @param dest A preallocated vImage_Buffer where the results are written @param flags The following flags are allowed: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading. This might be useful if you are already multithreading the work in your own tiling engine. @/textblock </pre> @result The following result codes may occur: <pre>@textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer dest->width and dest->height must be less than or equal to corresponding dimensions in src and alpha @/textblock</pre> C function: vImagePremultiplyData_ARGB8888
func VImagePremultiplyDataARGBFFFF ¶
func VImagePremultiplyDataARGBFFFF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImagePremultiplyData_ARGBFFFF @abstract Multiply a ARGBFFFF color channel by its corresponding alpha @discussion This function multiplies color channels by the alpha channel. <pre>@textblock For each color channel: float destColor = src * alpha; float destAlpha = alpha; This function can work in place provided the following are true: If src overlaps with dest, src->data must be equal to dest->data If src also has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags (It is not necessary to pass kvImageDoNotTile if src and dest do not overlap.) @/textblock </pre> This function will for all 4 channel float / channel image formats with alpha first in memory. It does not have to be ARGB. @param src The color data to multiply with alpha @param dest A preallocated vImage_Buffer where the results are written @param flags The following flags are allowed: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading. This might be useful if you are already multithreading the work in your own tiling engine. @/textblock </pre> @result The following result codes may occur: <pre>@textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer dest->width and dest->height must be less than or equal to corresponding dimensions in src and alpha @/textblock</pre> C function: vImagePremultiplyData_ARGBFFFF
func VImagePremultiplyDataPlanar8 ¶
func VImagePremultiplyDataPlanar8(src *VImageBuffer, alpha *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImagePremultiplyData_Planar8 @abstract Multiply a Planar8 color channel by its corresponding alpha @discussion This function multiplies color channels by the alpha channel. <pre>@textblock For each color channel: uint8_t destColor = (src * alpha + 127) / 255; This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags @/textblock </pre> @param src The color data to multiply with alpha @param alpha The alpha data to multiply against src @param dest A preallocated vImage_Buffer where the results are written @param flags The following flags are allowed: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading. This might be useful if you are already multithreading the work in your own tiling engine. @/textblock </pre> @result The following result codes may occur: <pre>@textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer dest->width and dest->height must be less than or equal to corresponding dimensions in src and alpha @/textblock</pre> C function: vImagePremultiplyData_Planar8
func VImagePremultiplyDataPlanarF ¶
func VImagePremultiplyDataPlanarF(src *VImageBuffer, alpha *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImagePremultiplyData_PlanarF @abstract Multiply a PlanarF color channel by its corresponding alpha @discussion This function multiplies color channels by the alpha channel. <pre>@textblock For each color channel: float destColor = src * alpha; This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags @/textblock </pre> @param src The color data to multiply with alpha @param alpha The alpha data to multiply against src @param dest A preallocated vImage_Buffer where the results are written @param flags The following flags are allowed: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading. This might be useful if you are already multithreading the work in your own tiling engine. @/textblock </pre> @result The following result codes may occur: <pre>@textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer dest->width and dest->height must be less than or equal to corresponding dimensions in src and alpha @/textblock</pre> C function: vImagePremultiplyData_PlanarF
func VImagePremultiplyDataRGBA16F ¶
func VImagePremultiplyDataRGBA16F(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImagePremultiplyData_RGBA16F @abstract Multiply a RGBA16F color channel by its corresponding alpha @discussion This function multiplies color channels by the alpha channel. <pre>@textblock For each color channel: float destColor = src * alpha; float destAlpha = alpha; This function can work in place provided the following are true: If src overlaps with dest, src->data must be equal to dest->data If src also has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags (It is not necessary to pass kvImageDoNotTile if src and dest do not overlap.) @/textblock </pre> This function will for all 4 channel 16F / channel image formats with alpha first in memory. It does not have to be RGBA. Also available as vImagePremultiplyData_BGRA16F(). @param src The color data to multiply with alpha @param dest A preallocated vImage_Buffer where the results are written @param flags The following flags are allowed: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading. This might be useful if you are already multithreading the work in your own tiling engine. @/textblock </pre> @result The following result codes may occur: <pre>@textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer dest->width and dest->height must be less than or equal to corresponding dimensions in src and alpha @/textblock</pre> C function: vImagePremultiplyData_RGBA16F
func VImagePremultiplyDataRGBA16Q12 ¶
func VImagePremultiplyDataRGBA16Q12(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImagePremultiplyData_RGBA16Q12 @abstract Multiply a signed 16Q12 RGBA color channel by its corresponding alpha @discussion This function multiplies color channels by the alpha channel. For each color in each pixel: <pre>@textblock int16_t destColor = CLAMP((src * alpha + 2048) / 4096, INT16_MIN, INT16_MAX); int16_t destAlpha = alpha; @/textblock </pre> This function can work in place provided the following are true: If src overlaps with dest, src->data must be equal to dest->data If src also has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags (It is not necessary to pass kvImageDoNotTile if src and dest do not overlap.) This function will for all 4 channel 16Q12 / channel image formats with alpha last in memory. It does not have to be RGBA. @param src The color data to multiply with alpha @param dest A preallocated vImage_Buffer where the results are written @param flags The following flags are allowed: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading. This might be useful if you are already multithreading the work in your own tiling engine. @/textblock </pre> @result The following result codes may occur: <pre>@textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer dest->width and dest->height must be less than or equal to corresponding dimensions in src and alpha @/textblock</pre> C function: vImagePremultiplyData_RGBA16Q12
func VImagePremultiplyDataRGBA16U ¶
func VImagePremultiplyDataRGBA16U(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImagePremultiplyData_RGBA16U @abstract Multiply a unsigned 16-bit RGBA color channel by its corresponding alpha @discussion This function multiplies color channels by the alpha channel. <pre>@textblock For each color channel: uint16_t destColor = (src * alpha + 32767) / 65535; uint16_t destAlpha = alpha; This function can work in place provided the following are true: If src overlaps with dest, src->data must be equal to dest->data If src also has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags (It is not necessary to pass kvImageDoNotTile if src and dest do not overlap.) @/textblock </pre> This function will for all 4 channel uint16_t / channel image formats with alpha last in memory. It does not have to be RGBA. Also available as vImagePremultiplyData_BGRA16U(). @param src The color data to multiply with alpha @param dest A preallocated vImage_Buffer where the results are written @param flags The following flags are allowed: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading. This might be useful if you are already multithreading the work in your own tiling engine. @/textblock </pre> @result The following result codes may occur: <pre>@textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer dest->width and dest->height must be less than or equal to corresponding dimensions in src and alpha @/textblock</pre> C function: vImagePremultiplyData_RGBA16U
func VImagePremultiplyDataRGBA8888 ¶
func VImagePremultiplyDataRGBA8888(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImagePremultiplyData_RGBA8888 @abstract Multiply a RGBA8888 color channel by its corresponding alpha @discussion This function multiplies color channels by the alpha channel. <pre>@textblock For each color channel: uint8_t destColor = (src * alpha + 127) / 255; uint8_t destAlpha = alpha; This function can work in place provided the following are true: If src overlaps with dest, src->data must be equal to dest->data If src also has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags (It is not necessary to pass kvImageDoNotTile if src and dest do not overlap.) @/textblock </pre> This function will for all 4 channel 8-bit / channel image formats with alpha last in memory. It does not have to be RGBA. Also available as vImagePremultiplyData_BGRA8888(). @param src The color data to multiply with alpha @param dest A preallocated vImage_Buffer where the results are written @param flags The following flags are allowed: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading. This might be useful if you are already multithreading the work in your own tiling engine. @/textblock </pre> @result The following result codes may occur: <pre>@textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer dest->width and dest->height must be less than or equal to corresponding dimensions in src and alpha @/textblock</pre> C function: vImagePremultiplyData_RGBA8888
func VImagePremultiplyDataRGBAFFFF ¶
func VImagePremultiplyDataRGBAFFFF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImagePremultiplyData_RGBAFFFF @abstract Multiply a RGBAFFFF color channel by its corresponding alpha @discussion This function multiplies color channels by the alpha channel. <pre>@textblock For each color channel: float destColor = src * alpha; float destAlpha = alpha; This function can work in place provided the following are true: If src overlaps with dest, src->data must be equal to dest->data If src also has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags (It is not necessary to pass kvImageDoNotTile if src and dest do not overlap.) @/textblock </pre> This function will for all 4 channel float / channel image formats with alpha first in memory. It does not have to be RGBA. Also available as vImagePremultiplyData_BGRAFFFF(). @param src The color data to multiply with alpha @param dest A preallocated vImage_Buffer where the results are written @param flags The following flags are allowed: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Turn off internal multithreading. This might be useful if you are already multithreading the work in your own tiling engine. @/textblock </pre> @result The following result codes may occur: <pre>@textblock kvImageNoError Success. kvImageRoiLargerThanInputBuffer dest->width and dest->height must be less than or equal to corresponding dimensions in src and alpha @/textblock</pre> C function: vImagePremultiplyData_RGBAFFFF
func VImageRichardsonLucyDeConvolveARGB8888 ¶
func VImageRichardsonLucyDeConvolveARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernel *int16, kernel2 *int16, kernelHeight uint32, kernelWidth uint32, kernelHeight2 uint32, kernelWidth2 uint32, divisor int32, divisor2 int32, backgroundColor *uint8, iterationCount uint32, flags uint32) int
@function vImageRichardsonLucyDeConvolve_ARGB8888 @abstract Perform N iterations of a Lucy-Richardson deconvolution on ARGB8888 data. @discussion This routine iteratively uses the following formula: <pre>@textblock e[i+1] = e[i] x (psf0 * ( e[0] / (psf1 * e[i]) ) ) where: e[0] = the observed image (src parameter) e[n] = the result of the nth iteration psf = point spread function (kernel for call to convolution) x = multiply operator '*' = convolution operator @/textblock </pre> The channels are operated on independently of one another. Consequently, this function will work on any 4-channel interleaved 8-bit per component format (e.g. RGBA, BGRA...), not just ARGB. The work in these functions is currently done internally with floating point precision. If you plan to call this function multiple times (rather than with iterationCount > 1) on 8-bit per channel images, you can save some computation by converting the 8-bit image data to single precision floating-point yourself using something like vImageConvert_Planar8toPlanarF and iterating on the appropriate floating-point Richardson Lucy variant. Convert back, when you are done. Does not work in place. @param src The input image @param dest A preallocated buffer to receive the result image. This may not alias the src image. @param tempBuffer An optional pointer to a region of memory to use as a working area during computation. The size of the tempBuffer is given by calling the function with the same parameters and the kvImageGetTempBufferSize flag, in which case the size is returned instead of an error code from the left hand side. You may pass NULL here, in which case a region of memory of similar size will be allocated by the function and freed before it returns. Temp Buffers are a way of avoiding lost time due to VM faults to initialize newly allocated buffers. If you will be calling this function repeatedly with similar parameters you should use a temp buffer. If the function is called from different threads concurrently, a different temp buffer should be used for each. @param srcOffsetToROI_X An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the left edge of the image. @param srcOffsetToROI_Y An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the top edge of the image. @param kernel A pointer to a 1D array of weights of dimension kernel_height x kernel_width. For example, for a simple 3x3 blur, it might be: <pre>@textblock const int16_t kernel[9] = { 1, 2, 1, 2, 4, 2, 1, 2, 1 }; @/textblock </pre> This is psf0 in the formula given in the discussion. @param kernel2 A pointer to a second 1D array of weights of dimension kernel_height2 x kernel_width2. This is psf1 in the formula given in the discussion. @param kernel_height The height of the 2D table of weights passed in as kernel1. It must be an odd number. @param kernel_width The width of the 2D table of weights passed in as kernel1. It must be an odd number. @param kernel_height2 The height of the 2D table of weights passed in as kernel2. It must be an odd number. @param kernel_width2 The width of the 2D table of weights passed in as kernel2. It must be an odd number. @param divisor The divisor to use to correct for the volume under kernel. @param divisor2 The divisor to use to correct for the volume under kernel2. @param backgroundColor When the kvImageBackgroundColorFill edging mode is active, the backgroundColor parameter provides the background color to be used for missing pixels when the kernel extends off the edge of the image. @param iterationCount The number of Richardson-Lucy iterations to perform on the data before returning. If 0, the src buffer is coped to dest. @param flags The following flags are allowed: <pre>@textblock kvImageCopyInPlace If any pixels covered by the kernel do no not exist, simply copy the corresponding source pixel to the destination. This will result in a ring off unconvolved content at the edges and convolved content in the middle. kvImageBackgroundColorFill Substitute in the provided background color for missing pixels. For a blur filter this will look like the edges of the image have been blurred into a particular color. This is usually appropriate when the color of the surface onto which the image will be drawn is known. You can also use {Alpha = 0, color = 0} as a background color, and let the downstream image compositor blend in the background color. In this case, the result image should be treated as a premultiplied image. kvImageEdgeExtend Substitute in the nearest defined pixel for missing pixels. This is better when the image is drawn into a frame or other context where the background is not expected to contribute to the final content. kvImageTruncateKernel This is similar to kvImageEdgeExtend, except that edge pixels are simply ignored, and the bias and divisor are adjusted accordingly. Because of the complication at the edges, this edging mode can be significantly slower than the others. It can be numerically unstable if the sum over any rectangular subsection of the kernel is zero, which can result in division by zero during the computation. The results for this edging mode are usually quite visually similar to kvImageEdgeExtend. kvImageGetTempBufferSize Instead of calculating the convolution of the image, return the size of the temp buffer needed for this set of parameters. Does not touch the src or dest image. kvImageDoNotTile Disable internal multithreading. kvImageLeaveAlphaUnchanged Operate only on the last 3 channels in memory. Leave the first channel unmodified. @/textblock </pre> The first four flags listed are edging modes. One and only one edging mode must be provided. If no edging mode is provided (e.g. kvImageNoFlags), then an error will be returned. @return One of the following error codes may be returned: <pre>@textblock kvImageNoError Success. >= 0 If kvImageGetTempBufferSize is passed, this is the size of the temp buffer to use with this function and this set of parameters. kvImageInvalidEdgeStyle One and only one of the following flags must be provided: { kvImageCopyInPlace, kvImageBackgroundColorFill, kvImageEdgeExtend, kvImageTruncateKernel } kvImageRoiLargerThanInputBuffer The dest->width and height must be less than or equal to corresponding dimensions of the source buffer. kvImageInvalidOffset_X The destination width + srcOffsetToROI_X > src->width kvImageInvalidOffset_Y The destination height + srcOffsetToROI_Y > src->height kvImageNullPointerArgument kernel may not be NULL kvImageMemoryAllocationError Could not allocate memory to serve as a temp buffer. kvImageInvalidKernelSize The kernel height and width must be odd numbers. @/textblock </pre> C function: vImageRichardsonLucyDeConvolve_ARGB8888
func VImageRichardsonLucyDeConvolveARGBFFFF ¶
func VImageRichardsonLucyDeConvolveARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernel *float32, kernel2 *float32, kernelHeight uint32, kernelWidth uint32, kernelHeight2 uint32, kernelWidth2 uint32, backgroundColor *float32, iterationCount uint32, flags uint32) int
@function vImageRichardsonLucyDeConvolve_ARGBFFFF @abstract Perform N iterations of a Lucy-Richardson deconvolution on ARGBFFFF data @discussion This routine iteratively uses the following formula: <pre>@textblock e[i+1] = e[i] x (psf0 * ( e[0] / (psf1 * e[i]) ) ) where: e[0] = the observed image (src parameter) e[n] = the result of the nth iteration psf = point spread function (kernel for call to convolution) x = multiply operator '*' = convolution operator @/textblock </pre> The channels are operated on independently of one another. Consequently, this function will work on any 4-channel interleaved 8-bit per component format (e.g. RGBA, BGRA...), not just ARGB. Does not work in place. @param src The input image @param dest A preallocated buffer to receive the result image. This may not alias the src image. @param tempBuffer An optional pointer to a region of memory to use as a working area during computation. The size of the tempBuffer is given by calling the function with the same parameters and the kvImageGetTempBufferSize flag, in which case the size is returned instead of an error code from the left hand side. You may pass NULL here, in which case a region of memory of similar size will be allocated by the function and freed before it returns. Temp Buffers are a way of avoiding lost time due to VM faults to initialize newly allocated buffers. If you will be calling this function repeatedly with similar parameters you should use a temp buffer. If the function is called from different threads concurrently, a different temp buffer should be used for each. @param srcOffsetToROI_X An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the left edge of the image. @param srcOffsetToROI_Y An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the top edge of the image. @param kernel A pointer to a 1D array of weights of dimension kernel_height x kernel_width. For example, for a simple 3x3 blur, it might be: <pre>@textblock const float kernel[9] = { 1./16, 2./16, 1./16, 2./16, 4./16, 2./16, 1./16, 2./16, 1./16 }; @/textblock </pre> This is psf0 in the formula given in the discussion. @param kernel2 A pointer to a second 1D array of weights of dimension kernel_height2 x kernel_width2. This is psf1 in the formula given in the discussion. @param kernel_height The height of the 2D table of weights passed in as kernel1. It must be an odd number. @param kernel_width The width of the 2D table of weights passed in as kernel1. It must be an odd number. @param kernel_height2 The height of the 2D table of weights passed in as kernel2. It must be an odd number. @param kernel_width2 The width of the 2D table of weights passed in as kernel2. It must be an odd number. @param backgroundColor When the kvImageBackgroundColorFill edging mode is active, the backgroundColor parameter provides the background color to be used for missing pixels when the kernel extends off the edge of the image. @param iterationCount The number of Richardson-Lucy iterations to perform on the data before returning. If 0, the src buffer is coped to dest. @param flags The following flags are allowed: <pre>@textblock kvImageCopyInPlace If any pixels covered by the kernel do no not exist, simply copy the corresponding source pixel to the destination. This will result in a ring off unconvolved content at the edges and convolved content in the middle. kvImageBackgroundColorFill Substitute in the provided background color for missing pixels. For a blur filter this will look like the edges of the image have been blurred into a particular color. This is usually appropriate when the color of the surface onto which the image will be drawn is known. You can also use {Alpha = 0, color = 0} as a background color, and let the downstream image compositor blend in the background color. In this case, the result image should be treated as a premultiplied image. kvImageEdgeExtend Substitute in the nearest defined pixel for missing pixels. This is better when the image is drawn into a frame or other context where the background is not expected to contribute to the final content. kvImageTruncateKernel This is similar to kvImageEdgeExtend, except that edge pixels are simply ignored, and the bias and divisor are adjusted accordingly. Because of the complication at the edges, this edging mode can be significantly slower than the others. It can be numerically unstable if the sum over any rectangular subsection of the kernel is zero, which can result in division by zero during the computation. The results for this edging mode are usually quite visually similar to kvImageEdgeExtend. kvImageGetTempBufferSize Instead of calculating the convolution of the image, return the size of the temp buffer needed for this set of parameters. Does not touch the src or dest image. kvImageDoNotTile Disable internal multithreading. kvImageLeaveAlphaUnchanged Operate only on the last 3 channels in memory. Leave the first channel unmodified. @/textblock </pre> The first four flags listed are edging modes. One and only one edging mode must be provided. If no edging mode is provided (e.g. kvImageNoFlags), then an error will be returned. @return One of the following error codes may be returned: <pre>@textblock kvImageNoError Success. >= 0 If kvImageGetTempBufferSize is passed, this is the size of the temp buffer to use with this function and this set of parameters. kvImageInvalidEdgeStyle One and only one of the following flags must be provided: { kvImageCopyInPlace, kvImageBackgroundColorFill, kvImageEdgeExtend, kvImageTruncateKernel } kvImageRoiLargerThanInputBuffer The dest->width and height must be less than or equal to corresponding dimensions of the source buffer. kvImageInvalidOffset_X The destination width + srcOffsetToROI_X > src->width kvImageInvalidOffset_Y The destination height + srcOffsetToROI_Y > src->height kvImageNullPointerArgument kernel may not be NULL kvImageMemoryAllocationError Could not allocate memory to serve as a temp buffer. kvImageInvalidKernelSize The kernel height and width must be odd numbers. @/textblock </pre> C function: vImageRichardsonLucyDeConvolve_ARGBFFFF
func VImageRichardsonLucyDeConvolvePlanar8 ¶
func VImageRichardsonLucyDeConvolvePlanar8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernel *int16, kernel2 *int16, kernelHeight uint32, kernelWidth uint32, kernelHeight2 uint32, kernelWidth2 uint32, divisor int32, divisor2 int32, backgroundColor uint8, iterationCount uint32, flags uint32) int
@function vImageRichardsonLucyDeConvolve_Planar8 @abstract Perform N iterations of a Lucy-Richardson deconvolution on Planar8 data @discussion This routine iteratively uses the following formula: <pre>@textblock e[i+1] = e[i] x (psf0 * ( e[0] / (psf1 * e[i]) ) ) where: e[0] = the observed image (src parameter) e[n] = the result of the nth iteration psf = point spread function (kernel for call to convolution) x = multiply operator '*' = convolution operator @/textblock </pre> The work in these functions is currently done internally with floating point precision. If you plan to call this function multiple times (rather than with iterationCount > 1) on 8-bit per channel images, you can save some computation by converting the 8-bit image data to single precision floating-point yourself using something like vImageConvert_Planar8toPlanarF and iterating on the appropriate floating-point Richardson Lucy variant. Convert back, when you are done. Does not work in place. @param src The input image @param dest A preallocated buffer to receive the result image. This may not alias the src image. @param tempBuffer An optional pointer to a region of memory to use as a working area during computation. The size of the tempBuffer is given by calling the function with the same parameters and the kvImageGetTempBufferSize flag, in which case the size is returned instead of an error code from the left hand side. You may pass NULL here, in which case a region of memory of similar size will be allocated by the function and freed before it returns. Temp Buffers are a way of avoiding lost time due to VM faults to initialize newly allocated buffers. If you will be calling this function repeatedly with similar parameters you should use a temp buffer. If the function is called from different threads concurrently, a different temp buffer should be used for each. @param srcOffsetToROI_X An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the left edge of the image. @param srcOffsetToROI_Y An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the top edge of the image. @param kernel A pointer to a 1D array of weights of dimension kernel_height x kernel_width. For example, for a simple 3x3 blur, it might be: <pre>@textblock const int16_t kernel[9] = { 1, 2, 1, 2, 4, 2, 1, 2, 1 }; @/textblock </pre> This is psf0 in the formula given in the discussion. @param kernel2 A pointer to a second 1D array of weights of dimension kernel_height2 x kernel_width2. This is psf1 in the formula given in the discussion. @param kernel_height The height of the 2D table of weights passed in as kernel1. It must be an odd number. @param kernel_width The width of the 2D table of weights passed in as kernel1. It must be an odd number. @param kernel_height2 The height of the 2D table of weights passed in as kernel2. It must be an odd number. @param kernel_width2 The width of the 2D table of weights passed in as kernel2. It must be an odd number. @param divisor The divisor to use to correct for the volume under kernel. @param divisor2 The divisor to use to correct for the volume under kernel2. @param backgroundColor When the kvImageBackgroundColorFill edging mode is active, the backgroundColor parameter provides the background color to be used for missing pixels when the kernel extends off the edge of the image. @param iterationCount The number of Richardson-Lucy iterations to perform on the data before returning. If 0, the src buffer is coped to dest. @param flags The following flags are allowed: <pre>@textblock kvImageCopyInPlace If any pixels covered by the kernel do no not exist, simply copy the corresponding source pixel to the destination. This will result in a ring off unconvolved content at the edges and convolved content in the middle. kvImageBackgroundColorFill Substitute in the provided background color for missing pixels. For a blur filter this will look like the edges of the image have been blurred into a particular color. This is usually appropriate when the color of the surface onto which the image will be drawn is known. You can also use {Alpha = 0, color = 0} as a background color, and let the downstream image compositor blend in the background color. In this case, the result image should be treated as a premultiplied image. kvImageEdgeExtend Substitute in the nearest defined pixel for missing pixels. This is better when the image is drawn into a frame or other context where the background is not expected to contribute to the final content. kvImageTruncateKernel This is similar to kvImageEdgeExtend, except that edge pixels are simply ignored, and the bias and divisor are adjusted accordingly. Because of the complication at the edges, this edging mode can be significantly slower than the others. It can be numerically unstable if the sum over any rectangular subsection of the kernel is zero, which can result in division by zero during the computation. The results for this edging mode are usually quite visually similar to kvImageEdgeExtend. kvImageGetTempBufferSize Instead of calculating the convolution of the image, return the size of the temp buffer needed for this set of parameters. Does not touch the src or dest image. kvImageDoNotTile Disable internal multithreading. @/textblock </pre> The first four flags listed are edging modes. One and only one edging mode must be provided. If no edging mode is provided (e.g. kvImageNoFlags), then an error will be returned. @return One of the following error codes may be returned: <pre>@textblock kvImageNoError Success. >= 0 If kvImageGetTempBufferSize is passed, this is the size of the temp buffer to use with this function and this set of parameters. kvImageInvalidEdgeStyle One and only one of the following flags must be provided: { kvImageCopyInPlace, kvImageBackgroundColorFill, kvImageEdgeExtend, kvImageTruncateKernel } kvImageRoiLargerThanInputBuffer The dest->width and height must be less than or equal to corresponding dimensions of the source buffer. kvImageInvalidOffset_X The destination width + srcOffsetToROI_X > src->width kvImageInvalidOffset_Y The destination height + srcOffsetToROI_Y > src->height kvImageNullPointerArgument kernel may not be NULL kvImageMemoryAllocationError Could not allocate memory to serve as a temp buffer. kvImageInvalidKernelSize The kernel height and width must be odd numbers. @/textblock </pre> C function: vImageRichardsonLucyDeConvolve_Planar8
func VImageRichardsonLucyDeConvolvePlanarF ¶
func VImageRichardsonLucyDeConvolvePlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernel *float32, kernel2 *float32, kernelHeight uint32, kernelWidth uint32, kernelHeight2 uint32, kernelWidth2 uint32, backgroundColor float32, iterationCount uint32, flags uint32) int
@function vImageRichardsonLucyDeConvolve_PlanarF @abstract Perform N iterations of a Lucy-Richardson deconvolution on PlanarF data @discussion This routine iteratively uses the following formula: <pre>@textblock e[i+1] = e[i] x (psf0 * ( e[0] / (psf1 * e[i]) ) ) where: e[0] = the observed image (src parameter) e[n] = the result of the nth iteration psf = point spread function (kernel for call to convolution) x = multiply operator '*' = convolution operator @/textblock </pre> Does not work in place. @param src The input image @param dest A preallocated buffer to receive the result image. This may not alias the src image. @param tempBuffer An optional pointer to a region of memory to use as a working area during computation. The size of the tempBuffer is given by calling the function with the same parameters and the kvImageGetTempBufferSize flag, in which case the size is returned instead of an error code from the left hand side. You may pass NULL here, in which case a region of memory of similar size will be allocated by the function and freed before it returns. Temp Buffers are a way of avoiding lost time due to VM faults to initialize newly allocated buffers. If you will be calling this function repeatedly with similar parameters you should use a temp buffer. If the function is called from different threads concurrently, a different temp buffer should be used for each. @param srcOffsetToROI_X An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the left edge of the image. @param srcOffsetToROI_Y An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the top edge of the image. @param kernel A pointer to a 1D array of weights of dimension kernel_height x kernel_width. For example, for a simple 3x3 blur, it might be: <pre>@textblock const float kernel[9] = { 1./16, 2./16, 1./16, 2./16, 4./16, 2./16, 1./16, 2./16, 1./16 }; @/textblock </pre> This is psf0 in the formula given in the discussion. @param kernel2 A pointer to a second 1D array of weights of dimension kernel_height2 x kernel_width2. This is psf1 in the formula given in the discussion. @param kernel_height The height of the 2D table of weights passed in as kernel1. It must be an odd number. @param kernel_width The width of the 2D table of weights passed in as kernel1. It must be an odd number. @param kernel_height2 The height of the 2D table of weights passed in as kernel2. It must be an odd number. @param kernel_width2 The width of the 2D table of weights passed in as kernel2. It must be an odd number. @param backgroundColor When the kvImageBackgroundColorFill edging mode is active, the backgroundColor parameter provides the background color to be used for missing pixels when the kernel extends off the edge of the image. @param iterationCount The number of Richardson-Lucy iterations to perform on the data before returning. If 0, the src buffer is coped to dest. @param flags The following flags are allowed: <pre>@textblock kvImageCopyInPlace If any pixels covered by the kernel do no not exist, simply copy the corresponding source pixel to the destination. This will result in a ring off unconvolved content at the edges and convolved content in the middle. kvImageBackgroundColorFill Substitute in the provided background color for missing pixels. For a blur filter this will look like the edges of the image have been blurred into a particular color. This is usually appropriate when the color of the surface onto which the image will be drawn is known. You can also use {Alpha = 0, color = 0} as a background color, and let the downstream image compositor blend in the background color. In this case, the result image should be treated as a premultiplied image. kvImageEdgeExtend Substitute in the nearest defined pixel for missing pixels. This is better when the image is drawn into a frame or other context where the background is not expected to contribute to the final content. kvImageTruncateKernel This is similar to kvImageEdgeExtend, except that edge pixels are simply ignored, and the bias and divisor are adjusted accordingly. Because of the complication at the edges, this edging mode can be significantly slower than the others. It can be numerically unstable if the sum over any rectangular subsection of the kernel is zero, which can result in division by zero during the computation. The results for this edging mode are usually quite visually similar to kvImageEdgeExtend. kvImageGetTempBufferSize Instead of calculating the convolution of the image, return the size of the temp buffer needed for this set of parameters. Does not touch the src or dest image. kvImageDoNotTile Disable internal multithreading. @/textblock </pre> The first four flags listed are edging modes. One and only one edging mode must be provided. If no edging mode is provided (e.g. kvImageNoFlags), then an error will be returned. @return One of the following error codes may be returned: <pre>@textblock kvImageNoError Success. >= 0 If kvImageGetTempBufferSize is passed, this is the size of the temp buffer to use with this function and this set of parameters. kvImageInvalidEdgeStyle One and only one of the following flags must be provided: { kvImageCopyInPlace, kvImageBackgroundColorFill, kvImageEdgeExtend, kvImageTruncateKernel } kvImageRoiLargerThanInputBuffer The dest->width and height must be less than or equal to corresponding dimensions of the source buffer. kvImageInvalidOffset_X The destination width + srcOffsetToROI_X > src->width kvImageInvalidOffset_Y The destination height + srcOffsetToROI_Y > src->height kvImageNullPointerArgument kernel may not be NULL kvImageMemoryAllocationError Could not allocate memory to serve as a temp buffer. kvImageInvalidKernelSize The kernel height and width must be odd numbers. @/textblock </pre> C function: vImageRichardsonLucyDeConvolve_PlanarF
func VImageRotate90ARGB16F ¶
func VImageRotate90ARGB16F(src *VImageBuffer, dest *VImageBuffer, rotationConstant uint8, backColor *uint16, flags uint32) int
C function: vImageRotate90_ARGB16F
func VImageRotate90ARGB16S ¶
func VImageRotate90ARGB16S(src *VImageBuffer, dest *VImageBuffer, rotationConstant uint8, backColor *int16, flags uint32) int
C function: vImageRotate90_ARGB16S
func VImageRotate90ARGB16U ¶
func VImageRotate90ARGB16U(src *VImageBuffer, dest *VImageBuffer, rotationConstant uint8, backColor *uint16, flags uint32) int
C function: vImageRotate90_ARGB16U
func VImageRotate90ARGB8888 ¶
func VImageRotate90ARGB8888(src *VImageBuffer, dest *VImageBuffer, rotationConstant uint8, backColor *uint8, flags uint32) int
C function: vImageRotate90_ARGB8888
func VImageRotate90ARGBFFFF ¶
func VImageRotate90ARGBFFFF(src *VImageBuffer, dest *VImageBuffer, rotationConstant uint8, backColor *float32, flags uint32) int
C function: vImageRotate90_ARGBFFFF
func VImageRotate90CbCr16F ¶
func VImageRotate90CbCr16F(src *VImageBuffer, dest *VImageBuffer, rotationConstant uint8, backColor *uint16, flags uint32) int
C function: vImageRotate90_CbCr16F
func VImageRotate90Planar8 ¶
func VImageRotate90Planar8(src *VImageBuffer, dest *VImageBuffer, rotationConstant uint8, backColor uint8, flags uint32) int
C function: vImageRotate90_Planar8
func VImageRotate90Planar16F ¶
func VImageRotate90Planar16F(src *VImageBuffer, dest *VImageBuffer, rotationConstant uint8, backColor uint16, flags uint32) int
C function: vImageRotate90_Planar16F
func VImageRotate90Planar16U ¶
func VImageRotate90Planar16U(src *VImageBuffer, dest *VImageBuffer, rotationConstant uint8, backColor uint16, flags uint32) int
C function: vImageRotate90_Planar16U
func VImageRotate90PlanarF ¶
func VImageRotate90PlanarF(src *VImageBuffer, dest *VImageBuffer, rotationConstant uint8, backColor float32, flags uint32) int
C function: vImageRotate90_PlanarF
func VImageRotateARGB16F ¶
func VImageRotateARGB16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, angleInRadians float32, backColor *uint16, flags uint32) int
C function: vImageRotate_ARGB16F
func VImageRotateARGB16S ¶
func VImageRotateARGB16S(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, angleInRadians float32, backColor *int16, flags uint32) int
C function: vImageRotate_ARGB16S
func VImageRotateARGB16U ¶
func VImageRotateARGB16U(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, angleInRadians float32, backColor *uint16, flags uint32) int
C function: vImageRotate_ARGB16U
func VImageRotateARGB8888 ¶
func VImageRotateARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, angleInRadians float32, backColor *uint8, flags uint32) int
C function: vImageRotate_ARGB8888
func VImageRotateARGBFFFF ¶
func VImageRotateARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, angleInRadians float32, backColor *float32, flags uint32) int
C function: vImageRotate_ARGBFFFF
func VImageRotateCbCr16F ¶
func VImageRotateCbCr16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, angleInRadians float32, backColor *uint16, flags uint32) int
C function: vImageRotate_CbCr16F
func VImageRotatePlanar8 ¶
func VImageRotatePlanar8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, angleInRadians float32, backColor uint8, flags uint32) int
C function: vImageRotate_Planar8
func VImageRotatePlanar16F ¶
func VImageRotatePlanar16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, angleInRadians float32, backColor uint16, flags uint32) int
C function: vImageRotate_Planar16F
func VImageRotatePlanarF ¶
func VImageRotatePlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, angleInRadians float32, backColor float32, flags uint32) int
C function: vImageRotate_PlanarF
func VImageScaleARGB16F ¶
func VImageScaleARGB16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, flags uint32) int
C function: vImageScale_ARGB16F
func VImageScaleARGB16S ¶
func VImageScaleARGB16S(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, flags uint32) int
C function: vImageScale_ARGB16S
func VImageScaleARGB16U ¶
func VImageScaleARGB16U(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, flags uint32) int
C function: vImageScale_ARGB16U
func VImageScaleARGB8888 ¶
func VImageScaleARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, flags uint32) int
C function: vImageScale_ARGB8888
func VImageScaleARGBFFFF ¶
func VImageScaleARGBFFFF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, flags uint32) int
C function: vImageScale_ARGBFFFF
func VImageScaleCbCr8 ¶
func VImageScaleCbCr8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, flags uint32) int
C function: vImageScale_CbCr8
func VImageScaleCbCr16F ¶
func VImageScaleCbCr16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, flags uint32) int
C function: vImageScale_CbCr16F
func VImageScaleCbCr16U ¶
func VImageScaleCbCr16U(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, flags uint32) int
C function: vImageScale_CbCr16U
func VImageScalePlanar8 ¶
func VImageScalePlanar8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, flags uint32) int
C function: vImageScale_Planar8
func VImageScalePlanar16F ¶
func VImageScalePlanar16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, flags uint32) int
C function: vImageScale_Planar16F
func VImageScalePlanar16S ¶
func VImageScalePlanar16S(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, flags uint32) int
C function: vImageScale_Planar16S
func VImageScalePlanar16U ¶
func VImageScalePlanar16U(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, flags uint32) int
C function: vImageScale_Planar16U
func VImageScalePlanarF ¶
func VImageScalePlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, flags uint32) int
C function: vImageScale_PlanarF
func VImageScaleXRGB2101010W ¶
func VImageScaleXRGB2101010W(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, flags uint32) int
C function: vImageScale_XRGB2101010W
func VImageSelectChannelsARGB8888 ¶
func VImageSelectChannelsARGB8888(newSrc *VImageBuffer, origSrc *VImageBuffer, dest *VImageBuffer, copyMask uint8, flags uint32) int
@function vImageSelectChannels_ARGB8888 @abstract Does the same thing as vImageOverwriteChannels_ARGB8888 except that the newSrc buffer is in ARGB8888. @discussion For each pixel in src, do the following: @code // Generate intMask to be 0xff for the channels that we want copy from newSrc to origSrc. uint32_t t = *(uint32_t*)newSrc; uint32_t b = *(uint32_t*)origSrc; t = (t & intMask ) | (b & ~intMask ); (uint32_t*)dest = t; @endcode If the appropriate copyMask bit is set, then the color channel from newSrc is used. Otherwise the color channel from origSrc is used. We note that functions of this kind only exist for interleaved buffers. If you had been using planar data, this would just be a pointer swap. This will work for other channel orderings, such as RGBA8888. You need to adjust the ordering of the bits in copyMask to compensate. This can work in place provided that for each buffer "buf" that overlaps with dest: buf->data must be equal to dest->data and buf->rowBytes >= dest->rowBytes If buf has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags @param newSrc A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing ARGB source pixel that we will overwrite with. @param origSrc A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing ARGB source pixel that we will overwrite into. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param copyMask A mask to copy plane : 0x8 -- alpha, 0x4 -- red, 0x2 --- green, 0x1 --- blue @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. You should use this if you are doing your own threading / tiling. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageSelectChannels_ARGB8888
func VImageSelectChannelsARGBFFFF ¶
func VImageSelectChannelsARGBFFFF(newSrc *VImageBuffer, origSrc *VImageBuffer, dest *VImageBuffer, copyMask uint8, flags uint32) int
@function vImageSelectChannels_ARGBFFFF @abstract Does the same thing as vImageOverwriteChannels_ARGBFFFF except that the newSrc buffer is in ARGBFFFF @discussion For each pixel in src, do the following: @code // Generate intMask to be 0xffffffff for the channels that we want copy from newSrc to origSrc. float t = *(float*)newSrc; float b = *(float*)origSrc; t = (t & intMask ) | (b & ~intMask ); (float*)dest = t; @endcode If the appropriate copyMask bit is set, then the color channel from newSrc is used. Otherwise the color channel from origSrc is used. We note that functions of this kind only exist for interleaved buffers. If you had been using planar data, this would just be a pointer swap. This will work for other channel orderings, such as RGBAFFFF. You need to adjust the ordering of the bits in copyMask to compensate. This can work in place provided that for each buffer "buf" that overlaps with dest: buf->data must be equal to dest->data and buf->rowBytes >= dest->rowBytes If buf has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags @param newSrc A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing ARGB source pixel that we will overwrite with. @param origSrc A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing ARGB source pixel that we will overwrite into. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param copyMask A mask to copy plane : 0x8 -- alpha, 0x4 -- red, 0x2 --- green, 0x1 --- blue @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. You should use this if you are doing your own threading / tiling. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageSelectChannels_ARGBFFFF
func VImageSepConvolveARGB8888 ¶
func VImageSepConvolveARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernelX *float32, kernelXWidth uint32, kernelY *float32, kernelYWidth uint32, bias float32, backgroundColor *uint8, flags uint32) int
C function: vImageSepConvolve_ARGB8888
func VImageSepConvolvePlanar8 ¶
func VImageSepConvolvePlanar8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernelX *float32, kernelXWidth uint32, kernelY *float32, kernelYWidth uint32, bias float32, backgroundColor uint16, flags uint32) int
C function: vImageSepConvolve_Planar8
func VImageSepConvolvePlanar8to16U ¶
func VImageSepConvolvePlanar8to16U(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernelX *float32, kernelXWidth uint32, kernelY *float32, kernelYWidth uint32, scale float32, bias float32, backgroundColor uint8, flags uint32) int
C function: vImageSepConvolve_Planar8to16U
func VImageSepConvolvePlanar16F ¶
func VImageSepConvolvePlanar16F(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernelX *float32, kernelXWidth uint32, kernelY *float32, kernelYWidth uint32, bias float32, backgroundColor uint16, flags uint32) int
C function: vImageSepConvolve_Planar16F
func VImageSepConvolvePlanar16U ¶
func VImageSepConvolvePlanar16U(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernelX *float32, kernelXWidth uint32, kernelY *float32, kernelYWidth uint32, bias float32, backgroundColor uint16, flags uint32) int
C function: vImageSepConvolve_Planar16U
func VImageSepConvolvePlanarF ¶
func VImageSepConvolvePlanarF(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernelX *float32, kernelXWidth uint32, kernelY *float32, kernelYWidth uint32, bias float32, backgroundColor float32, flags uint32) int
C function: vImageSepConvolve_PlanarF
func VImageSymmetricPiecewiseGammaPlanar16Q12 ¶
func VImageSymmetricPiecewiseGammaPlanar16Q12(src *VImageBuffer, dest *VImageBuffer, exponentialCoeffs *float32, gamma unsafe.Pointer, linearCoeffs *float32, boundary int16, flags uint32) int
C function: vImageSymmetricPiecewiseGamma_Planar16Q12
func VImageSymmetricPiecewiseGammaPlanarF ¶
func VImageSymmetricPiecewiseGammaPlanarF(src *VImageBuffer, dest *VImageBuffer, exponentialCoeffs *float32, gamma unsafe.Pointer, linearCoeffs *float32, boundary unsafe.Pointer, flags uint32) int
C function: vImageSymmetricPiecewiseGamma_PlanarF
func VImageSymmetricPiecewisePolynomialPlanarF ¶
func VImageSymmetricPiecewisePolynomialPlanarF(src *VImageBuffer, dest *VImageBuffer, coefficients *float32, boundaries *float32, order uint32, log2segments uint32, flags uint32) int
C function: vImageSymmetricPiecewisePolynomial_PlanarF
func VImageTableLookUpARGB8888 ¶
func VImageTableLookUpARGB8888(src *VImageBuffer, dest *VImageBuffer, alphaTable *uint8, redTable *uint8, greenTable *uint8, blueTable *uint8, flags uint32) int
@function vImageTableLookUp_ARGB8888 @abstract Transforms an ARGB8888 image by substituting pixel values with pixel values provided by four lookup tables. @discussion For each pixel in src, do the following: Use a lookup table to remap 0...255 values in the source image to a different set of 0...255 values in the destination. A different lookup table is used for each channel in the ARGB image. This function can work in place provided the following are true: If src overlaps with dest, src->data must be equal to dest->data and src->rowBytes >= dest->rowBytes If an overlapping src has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags @note This function may be used to do table lookups on other 4 channel 8-bit/channel formats (e.g. RGBA8888) by adjusting the order of the tables passed into the function accordingly. @note Performance Advisory: For 8-bit monochrome -> ARGB8888 or 8-bit indexed -> ARGB8888 conversions, it is likely significantly faster to use vImageLookupTable_Planar8toPlanarF. Use the desired ARGB8888 (32 bits/pixel) pixels in place of the planar 32-bit floats in the lookup table. @param src A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing source pixels. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param alphaTable A table to remap A values. @param redTable A table to remap R values. @param greenTable A table to remap G values. @param blueTable A table to remap B values. @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageTableLookUp_ARGB8888
func VImageTableLookUpPlanar8 ¶
func VImageTableLookUpPlanar8(src *VImageBuffer, dest *VImageBuffer, table *uint8, flags uint32) int
@function vImageTableLookUp_ARGB8888 @abstract Transforms an Planar8 image by substituting pixel values with pixel values provided by four lookup tables. @discussion For each pixel in src, do the following: Use a lookup table to remap 0...255 values in the source image to a different set of 0...255 values in the destination. This function can work in place provided the following are true: If src overlaps with dest, src->data must be equal to dest->data and src->rowBytes >= dest->rowBytes If an overlapping src has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags @param src A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing source pixels. @param dest A pointer to a valid and initialized vImage_Buffer struct, that points to a buffer containing destination pixels. @param table A table to remap the values in src. @param flags \p kvImageNoFlags Default operation \p kvImageDoNotTile Disable internal multithreading. @return kvImageNoError Success @return kvImageRoiLargerThanInputBuffer The height and width of the destination must be less than or equal to the height and width of the src buffer, respectively. C function: vImageTableLookUp_Planar8
func VImageTentConvolveARGB8888 ¶
func VImageTentConvolveARGB8888(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernelHeight uint32, kernelWidth uint32, backgroundColor *uint8, flags uint32) int
@function vImageTentConvolve_ARGB8888 @abstract Special purpose tent convolution on a 4-channel interleaved, 8-bit per channel image. @discussion This filter applies a tent filter to a 4-channel interleaved, 8-bit per channel imagee. A tent filter uses a much faster algorithm than a standard convolution, and may be a good solution for real time application of large blur radii against images. For each pixel: <pre>@textblock for each pixel[y][x] in image{ int sumA = 0; int sumR = 0; int sumG = 0; int sumB = 0; int divisor = 0; // Calculate weighted average over kernel area for each kernel_element[i][j] in kernel{ sumA += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2][x+j+srcOffsetToROI_X- kernel_width/2][0]; sumR += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2][x+j+srcOffsetToROI_X- kernel_width/2][1]; sumG += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2][x+j+srcOffsetToROI_X- kernel_width/2][2]; sumB += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2][x+j+srcOffsetToROI_X- kernel_width/2][3]; divisor += kernel_element[i][j]; } // Correct for the scaling introduced by multiplying by the weights table sumA = (sumA + divisor/2) / divisor; sumR = (sumR + divisor/2) / divisor; sumG = (sumG + divisor/2) / divisor; sumB = (sumB + divisor/2) / divisor; // write out result result[y][x][0] = CLAMP(sumA, 0, 255); result[y][x][1] = CLAMP(sumR, 0, 255); result[y][x][2] = CLAMP(sumG, 0, 255); result[y][x][3] = CLAMP(sumB, 0, 255); } @/textblock </pre> This filter does not work in place. This filter will work without modification for other byte orders such as RGBA, BGRA, AGBR, CMYK, etc. The image should be non-premultiplied to avoid odd results in non-opaque regions. @param src The input image @param dest A pointer to a preallocated vImage_Buffer to receive the result image. This may not alias the src image. @param tempBuffer An optional pointer to a region of memory to use as a working area during computation. The size of the tempBuffer is given by calling the function with the same parameters and the kvImageGetTempBufferSize flag, in which case the size is returned instead of an error code from the left hand side. You may pass NULL here, in which case a region of memory of similar size will be allocated by the function and freed before it returns. Temp Buffers are a way of avoiding lost time due to VM faults to initialize newly allocated buffers. If you will be calling this function repeatedly with similar parameters you should use a temp buffer. If the function is called from different threads concurrently, a different temp buffer should be used for each. @param srcOffsetToROI_X An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the left edge of the image. @param srcOffsetToROI_Y An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the top edge of the image. @param kernel_height The height of the 2D table of weights passed in as kernel. It must be an odd number. @param kernel_width The width of the 2D table of weights passed in as kernel. It must be an odd number. @param backgroundColor When the kvImageBackgroundColorFill edging mode is active, the backgroundColor parameter provides the background color to be used for missing pixels when the kernel extends off the edge of the image. @param flags The following flags are allowed: <pre>@textblock kvImageCopyInPlace If any pixels covered by the kernel do no not exist, simply copy the corresponding source pixel to the destination. This will result in a ring off unconvolved content at the edges and convolved content in the middle. kvImageBackgroundColorFill Substitute in the provided background color for missing pixels. For a blur filter this will look like the edges of the image have been blurred into a particular color. This is usually appropriate when the color of the surface onto which the image will be drawn is known. You can also use {Alpha = 0, color = 0} as a background color, and let the downstream image compositor blend in the background color. In this case, the result image should be treated as a premultiplied image. kvImageEdgeExtend Substitute in the nearest defined pixel for missing pixels. This is better when the image is drawn into a frame or other context where the background is not expected to contribute to the final content. kvImageTruncateKernel This is similar to kvImageEdgeExtend, except that edge pixels are simply ignored, and the bias and divisor are adjusted accordingly. Because of the complication at the edges, this edging mode can be significantly slower than the others. It can be numerically unstable if the sum over any rectangular subsection of the kernel is zero, which can result in division by zero during the computation. The results for this edging mode are usually quite visually similar to kvImageEdgeExtend. kvImageGetTempBufferSize Instead of calculating the convolution of the image, return the size of the temp buffer needed for this set of parameters. Does not touch the src or dest image. kvImageLeaveAlphaUnchanged Apply the convolution to the last three channels in memory, only. kvImageDoNotTile Disable internal multithreading. @/textblock </pre> The first four flags listed are edging modes. One and only one edging mode must be provided. If no edging mode is provided (e.g. kvImageNoFlags), then an error will be returned. @return One of the following error codes may be returned: <pre>@textblock kvImageNoError Success. >= 0 If kvImageGetTempBufferSize is passed, this is the size of the temp buffer to use with this function and this set of parameters. kvImageInvalidEdgeStyle One and only one of the following flags must be provided: { kvImageCopyInPlace, kvImageBackgroundColorFill, kvImageEdgeExtend, kvImageTruncateKernel } kvImageRoiLargerThanInputBuffer The dest->width and height must be less than or equal to corresponding dimensions of the source buffer. kvImageInvalidOffset_X The destination width + srcOffsetToROI_X > src->width kvImageInvalidOffset_Y The destination height + srcOffsetToROI_Y > src->height kvImageMemoryAllocationError Could not allocate memory to serve as a temp buffer. kvImageInvalidKernelSize The kernel height and width must be odd numbers. @/textblock </pre> C function: vImageTentConvolve_ARGB8888
func VImageTentConvolvePlanar8 ¶
func VImageTentConvolvePlanar8(src *VImageBuffer, dest *VImageBuffer, tempBuffer unsafe.Pointer, srcOffsetToROIX uint, srcOffsetToROIY uint, kernelHeight uint32, kernelWidth uint32, backgroundColor uint8, flags uint32) int
@function vImageTentConvolve_Planar8 @abstract Special purpose tent convolution on a Planar8 image. @discussion This filter applies a tent filter to a Planar8 image. A tent filter uses a much faster algorithm than a standard convolution, and may be a good solution for real time application of large blur radii against images. For each pixel: <pre>@textblock for each pixel[y][x] in image{ int sum = 0; int divisor = 0; // Calculate weighted average over kernel area for each kernel_element[i][j] in kernel{ sum += kernel_element[i][j] * pixel[y+i+srcOffsetToROI_Y-kernel_height/2] [x+j+srcOffsetToROI_X- kernel_width/2]; divisor += kernel_element[i][j]; } // Correct for the scaling introduced by multiplying by the weights table sum = (sum + divisor/2) / divisor; // write out result result[y][x] = CLAMP(sum, 0, 255); } @/textblock </pre> This filter does not work in place. @param src The input image @param dest A pointer to a preallocated vImage_Buffer to receive the result image. This may not alias the src image. @param tempBuffer An optional pointer to a region of memory to use as a working area during computation. The size of the tempBuffer is given by calling the function with the same parameters and the kvImageGetTempBufferSize flag, in which case the size is returned instead of an error code from the left hand side. You may pass NULL here, in which case a region of memory of similar size will be allocated by the function and freed before it returns. Temp Buffers are a way of avoiding lost time due to VM faults to initialize newly allocated buffers. If you will be calling this function repeatedly with similar parameters you should use a temp buffer. If the function is called from different threads concurrently, a different temp buffer should be used for each. @param srcOffsetToROI_X An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the left edge of the image. @param srcOffsetToROI_Y An offset used in tiling to shift the position of the destination image relative to the src image. Typically this is 0. Non-Zero values are needed when the destination tile is not aligned with the top edge of the image. @param kernel_height The height of the 2D table of weights passed in as kernel. It must be an odd number. @param kernel_width The width of the 2D table of weights passed in as kernel. It must be an odd number. @param backgroundColor When the kvImageBackgroundColorFill edging mode is active, the backgroundColor parameter provides the background color to be used for missing pixels when the kernel extends off the edge of the image. @param flags The following flags are allowed: <pre>@textblock kvImageCopyInPlace If any pixels covered by the kernel do no not exist, simply copy the corresponding source pixel to the destination. This will result in a ring off unconvolved content at the edges and convolved content in the middle. kvImageBackgroundColorFill Substitute in the provided background color for missing pixels. For a blur filter this will look like the edges of the image have been blurred into a particular color. This is usually appropriate when the color of the surface onto which the image will be drawn is known. You can also use {Alpha = 0, color = 0} as a background color, and let the downstream image compositor blend in the background color. In this case, the result image should be treated as a premultiplied image. kvImageEdgeExtend Substitute in the nearest defined pixel for missing pixels. This is better when the image is drawn into a frame or other context where the background is not expected to contribute to the final content. kvImageTruncateKernel This is similar to kvImageEdgeExtend, except that edge pixels are simply ignored, and the bias and divisor are adjusted accordingly. Because of the complication at the edges, this edging mode can be significantly slower than the others. It can be numerically unstable if the sum over any rectangular subsection of the kernel is zero, which can result in division by zero during the computation. The results for this edging mode are usually quite visually similar to kvImageEdgeExtend. kvImageGetTempBufferSize Instead of calculating the convolution of the image, return the size of the temp buffer needed for this set of parameters. Does not touch the src or dest image. kvImageDoNotTile Disable internal multithreading. @/textblock </pre> The first four flags listed are edging modes. One and only one edging mode must be provided. If no edging mode is provided (e.g. kvImageNoFlags), then an error will be returned. @return One of the following error codes may be returned: <pre>@textblock kvImageNoError Success. >= 0 If kvImageGetTempBufferSize is passed, this is the size of the temp buffer to use with this function and this set of parameters. kvImageInvalidEdgeStyle One and only one of the following flags must be provided: { kvImageCopyInPlace, kvImageBackgroundColorFill, kvImageEdgeExtend, kvImageTruncateKernel } kvImageRoiLargerThanInputBuffer The dest->width and height must be less than or equal to corresponding dimensions of the source buffer. kvImageInvalidOffset_X The destination width + srcOffsetToROI_X > src->width kvImageInvalidOffset_Y The destination height + srcOffsetToROI_Y > src->height kvImageMemoryAllocationError Could not allocate memory to serve as a temp buffer. kvImageInvalidKernelSize The kernel height and width must be odd numbers. kvImageInvalidKernelSize The kernel height and width must be odd numbers. @/textblock </pre> C function: vImageTentConvolve_Planar8
func VImageUnpremultiplyDataARGB16Q12 ¶
func VImageUnpremultiplyDataARGB16Q12(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageUnpremultiplyData_ARGB16Q12 @abstract Divide the alpha channel from the color channels in a ARGB16Q12 image @discussion This function divides color channels by the alpha channel. For each color channel: <pre>@textblock int16_t destColor = ( MIN(src_color, alpha) * 4096 + alpha/2) / alpha; int16_t destAlpha = alpha; @/textblock </pre> ...which is the nearest unpremultiplied result, with clamping to ensure no modulo overflow in cases where srcColor > srcAlpha. In the division by zero case, the returned color value is 0. The positioning of only the alpha channel is important for interleaved formats for these functions. This function will work with other channel orders that have alpha first. This function can work in place provided the following are true: src->data must be equal to dest->data src->rowBytes must be equal to dest->rowBytes @param src The input inmage @param dest A preallocated planar8 destination buffer into which the result will be written.' @param flags The following flags are allowed: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Disable internal multithreading. @/textblock </pre> @result The following error codes may be returned: <pre>@textblock kvImageNoError Success kvImageRoiLargerThanInputBuffer dest->height or width is larger than the corresponding src or alpha dimension @/textblock </pre> C function: vImageUnpremultiplyData_ARGB16Q12
func VImageUnpremultiplyDataARGB16U ¶
func VImageUnpremultiplyDataARGB16U(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageUnpremultiplyData_ARGB16U @abstract Divide the alpha channel from the color channels in a ARGB16U image @discussion This function divides color channels by the alpha channel. For each color channel: <pre>@textblock uint16_t destColor = ( MIN(src_color, alpha) * 65535 + alpha/2) / alpha; uint16_t destAlpha = alpha; @/textblock </pre> ...which is the nearest unpremultiplied result, with clamping to ensure no modulo overflow in cases where srcColor > srcAlpha. In the division by zero case, the returned color value is 0. The positioning of only the alpha channel is important for interleaved formats for these functions. This function will work with other channel orders that have alpha first. This function can work in place provided the following are true: src->data must be equal to dest->data src->rowBytes must be equal to dest->rowBytes @param src The input inmage @param dest A preallocated planar8 destination buffer into which the result will be written.' @param flags The following flags are allowed: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Disable internal multithreading. @/textblock </pre> @result The following error codes may be returned: <pre>@textblock kvImageNoError Success kvImageRoiLargerThanInputBuffer dest->height or width is larger than the corresponding src or alpha dimension @/textblock </pre> C function: vImageUnpremultiplyData_ARGB16U
func VImageUnpremultiplyDataARGB8888 ¶
func VImageUnpremultiplyDataARGB8888(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageUnpremultiplyData_ARGB8888 @abstract Divide the alpha channel from the color channels in a ARGB8888 image @discussion This function divides color channels by the alpha channel. For each color channel: <pre>@textblock uint8_t destColor = ( MIN(src_color, alpha) * 255 + alpha/2) / alpha; uint8_t destAlpha = alpha; @/textblock </pre> ...which is the nearest unpremultiplied result, with clamping to ensure no modulo overflow in cases where srcColor > srcAlpha. In the division by zero case, the returned color value is 0. The positioning of only the alpha channel is important for interleaved formats for these functions. This function will work with other channel orders that have alpha first. This function can work in place provided the following are true: src->data must be equal to dest->data src->rowBytes must be equal to dest->rowBytes @param src The input inmage @param dest A preallocated planar8 destination buffer into which the result will be written.' @param flags The following flags are allowed: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Disable internal multithreading. @/textblock </pre> @result The following error codes may be returned: <pre>@textblock kvImageNoError Success kvImageRoiLargerThanInputBuffer dest->height or width is larger than the corresponding src or alpha dimension @/textblock </pre> C function: vImageUnpremultiplyData_ARGB8888
func VImageUnpremultiplyDataARGBFFFF ¶
func VImageUnpremultiplyDataARGBFFFF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageUnpremultiplyData_ARGBFFFF @abstract Divide the alpha channel from the color channels in a ARGBFFFF image @discussion This function divides color channels by the alpha channel. For each color channel: <pre>@textblock float destColor = destColor / alpha; float destAlpha = alpha; @/textblock </pre> The positioning of only the alpha channel is important for interleaved formats for these functions. This function will work with other channel orders that have alpha first. This function can work in place provided the following are true: src->data must be equal to dest->data src->rowBytes must be equal to dest->rowBytes @param src The input inmage @param dest A preallocated planar8 destination buffer into which the result will be written.' @param flags The following flags are allowed: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Disable internal multithreading. @/textblock </pre> @result The following error codes may be returned: <pre>@textblock kvImageNoError Success kvImageRoiLargerThanInputBuffer dest->height or width is larger than the corresponding src or alpha dimension @/textblock </pre> C function: vImageUnpremultiplyData_ARGBFFFF
func VImageUnpremultiplyDataPlanar8 ¶
func VImageUnpremultiplyDataPlanar8(src *VImageBuffer, alpha *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageUnpremultiplyData_Planar8 @abstract Divide alpha from a premultiplied Planar8 images @discussion This function divides color channels by the alpha channel. For each color channel: <pre>@textblock uint8_t destColor = ( MIN(src_color, alpha) * 255 + alpha/2) / alpha; @/textblock </pre> ...which is the nearest unpremultiplied result, with clamping to ensure no modulo overflow in cases where srcColor > srcAlpha. In the division by zero case, the returned color value is 0. This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data. If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags @param src The planar8 input color channel @param alpha The planar8 input alpha channel @param dest A preallocated planar8 destination buffer into which the result will be written.' @param flags The following flags are allowed: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Disable internal multithreading. @/textblock </pre> @result The following error codes may be returned: <pre>@textblock kvImageNoError Success kvImageRoiLargerThanInputBuffer dest->height or width is larger than the corresponding src or alpha dimension @/textblock </pre> C function: vImageUnpremultiplyData_Planar8
func VImageUnpremultiplyDataPlanarF ¶
func VImageUnpremultiplyDataPlanarF(src *VImageBuffer, alpha *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageUnpremultiplyData_PlanarF @abstract Divide alpha from a premultiplied PlanarF images @discussion This function divides color channels by the alpha channel. For each color channel: <pre>@textblock float destColor = destColor / alpha; // according to current rounding mode @/textblock </pre> This function can work in place provided the following are true: For each buffer "buf" that overlaps with dest, buf->data must be equal to dest->data. If an overlapping buffer has a different rowBytes from dest, kvImageDoNotTile must be also passed in the flags @param src The planarF input color channel @param alpha The planarF input alpha channel @param dest A preallocated planar8 destination buffer into which the result will be written.' @param flags The following flags are allowed: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Disable internal multithreading. @/textblock </pre> @result The following error codes may be returned: <pre>@textblock kvImageNoError Success kvImageRoiLargerThanInputBuffer dest->height or width is larger than the corresponding src or alpha dimension @/textblock </pre> C function: vImageUnpremultiplyData_PlanarF
func VImageUnpremultiplyDataRGBA16F ¶
func VImageUnpremultiplyDataRGBA16F(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageUnpremultiplyData_RGBA16F @abstract Divide the alpha channel from the color channels in a RGBA16F image @discussion This function divides color channels by the alpha channel. For each color channel: <pre>@textblock float destColor = destColor / alpha; float destAlpha = alpha; @/textblock </pre> The positioning of only the alpha channel is important for interleaved formats for these functions. This function will work with other channel orders that have alpha last. It is also available as vImageUnpremultiplyData_BGRA16F(). This function can work in place provided the following are true: src->data must be equal to dest->data src->rowBytes must be equal to dest->rowBytes @param src The input image @param dest A preallocated 16F destination buffer into which the result will be written. @param flags The following flags are allowed: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Disable internal multithreading. @/textblock </pre> @result The following error codes may be returned: <pre>@textblock kvImageNoError Success kvImageRoiLargerThanInputBuffer dest->height or width is larger than the corresponding src or alpha dimension @/textblock </pre> C function: vImageUnpremultiplyData_RGBA16F
func VImageUnpremultiplyDataRGBA16Q12 ¶
func VImageUnpremultiplyDataRGBA16Q12(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageUnpremultiplyData_RGBA16Q12 @abstract Divide the alpha channel from the color channels in a RGBA16Q12 image @discussion This function divides color channels by the alpha channel. For each color channel: <pre>@textblock int16_t destColor = ( MIN(src_color, alpha) * 4096 + alpha/2) / alpha; int16_t destAlpha = alpha; @/textblock </pre> ...which is the nearest unpremultiplied result, with clamping to ensure no modulo overflow in cases where srcColor > srcAlpha. In the division by zero case, the returned color value is 0. The positioning of only the alpha channel is important for interleaved formats for these functions. This function will work with other channel orders that have alpha last. This function can work in place provided the following are true: src->data must be equal to dest->data src->rowBytes must be equal to dest->rowBytes @param src The input inmage @param dest A preallocated planar8 destination buffer into which the result will be written.' @param flags The following flags are allowed: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Disable internal multithreading. @/textblock </pre> @result The following error codes may be returned: <pre>@textblock kvImageNoError Success kvImageRoiLargerThanInputBuffer dest->height or width is larger than the corresponding src or alpha dimension @/textblock </pre> C function: vImageUnpremultiplyData_RGBA16Q12
func VImageUnpremultiplyDataRGBA16U ¶
func VImageUnpremultiplyDataRGBA16U(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageUnpremultiplyData_RGBA16U @abstract Divide the alpha channel from the color channels in a RGBA16U image @discussion This function divides color channels by the alpha channel. For each color channel: <pre>@textblock uint16_t destColor = ( MIN(src_color, alpha) * 65535 + alpha/2) / alpha; uint16_t destAlpha = alpha; @/textblock </pre> ...which is the nearest unpremultiplied result, with clamping to ensure no modulo overflow in cases where srcColor > srcAlpha. In the division by zero case, the returned color value is 0. The positioning of only the alpha channel is important for interleaved formats for these functions. This function will work with other channel orders that have alpha last. The function is also available as vImageUnpremultiplyData_BGRA16U. This function can work in place provided the following are true: src->data must be equal to dest->data src->rowBytes must be equal to dest->rowBytes @param src The input inmage @param dest A preallocated planar8 destination buffer into which the result will be written.' @param flags The following flags are allowed: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Disable internal multithreading. @/textblock </pre> @result The following error codes may be returned: <pre>@textblock kvImageNoError Success kvImageRoiLargerThanInputBuffer dest->height or width is larger than the corresponding src or alpha dimension @/textblock </pre> C function: vImageUnpremultiplyData_RGBA16U
func VImageUnpremultiplyDataRGBA8888 ¶
func VImageUnpremultiplyDataRGBA8888(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageUnpremultiplyData_RGBA8888 @abstract Divide the alpha channel from the color channels in a RGBA8888 image @discussion This function divides color channels by the alpha channel. For each color channel: <pre>@textblock uint8_t destColor = ( MIN(src_color, alpha) * 255 + alpha/2) / alpha; uint8_t destAlpha = alpha; @/textblock </pre> ...which is the nearest unpremultiplied result, with clamping to ensure no modulo overflow in cases where srcColor > srcAlpha. In the division by zero case, the returned color value is 0. The positioning of only the alpha channel is important for interleaved formats for these functions. This function will work with other channel orders that have alpha last. The function is also available as vImageUnpremultiplyData_BGRA8888. This function can work in place provided the following are true: src->data must be equal to dest->data src->rowBytes must be equal to dest->rowBytes @param src The input inmage @param dest A preallocated planar8 destination buffer into which the result will be written.' @param flags The following flags are allowed: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Disable internal multithreading. @/textblock </pre> @result The following error codes may be returned: <pre>@textblock kvImageNoError Success kvImageRoiLargerThanInputBuffer dest->height or width is larger than the corresponding src or alpha dimension @/textblock </pre> C function: vImageUnpremultiplyData_RGBA8888
func VImageUnpremultiplyDataRGBAFFFF ¶
func VImageUnpremultiplyDataRGBAFFFF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
@function vImageUnpremultiplyData_RGBAFFFF @abstract Divide the alpha channel from the color channels in a RGBAFFFF image @discussion This function divides color channels by the alpha channel. For each color channel: <pre>@textblock float destColor = destColor / alpha; float destAlpha = alpha; @/textblock </pre> The positioning of only the alpha channel is important for interleaved formats for these functions. This function will work with other channel orders that have alpha last. It is also available as vImageUnpremultiplyData_BGRAFFFF(). This function can work in place provided the following are true: src->data must be equal to dest->data src->rowBytes must be equal to dest->rowBytes @param src The input inmage @param dest A preallocated planar8 destination buffer into which the result will be written.' @param flags The following flags are allowed: <pre>@textblock kvImageNoFlags Default operation kvImageDoNotTile Disable internal multithreading. @/textblock </pre> @result The following error codes may be returned: <pre>@textblock kvImageNoError Success kvImageRoiLargerThanInputBuffer dest->height or width is larger than the corresponding src or alpha dimension @/textblock </pre> C function: vImageUnpremultiplyData_RGBAFFFF
func VImageVerticalReflectARGB16F ¶
func VImageVerticalReflectARGB16F(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageVerticalReflect_ARGB16F
func VImageVerticalReflectARGB16S ¶
func VImageVerticalReflectARGB16S(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageVerticalReflect_ARGB16S
func VImageVerticalReflectARGB16U ¶
func VImageVerticalReflectARGB16U(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageVerticalReflect_ARGB16U
func VImageVerticalReflectARGB8888 ¶
func VImageVerticalReflectARGB8888(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageVerticalReflect_ARGB8888
func VImageVerticalReflectARGBFFFF ¶
func VImageVerticalReflectARGBFFFF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageVerticalReflect_ARGBFFFF
func VImageVerticalReflectCbCr16F ¶
func VImageVerticalReflectCbCr16F(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageVerticalReflect_CbCr16F
func VImageVerticalReflectPlanar8 ¶
func VImageVerticalReflectPlanar8(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageVerticalReflect_Planar8
func VImageVerticalReflectPlanar16F ¶
func VImageVerticalReflectPlanar16F(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageVerticalReflect_Planar16F
func VImageVerticalReflectPlanar16U ¶
func VImageVerticalReflectPlanar16U(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageVerticalReflect_Planar16U
func VImageVerticalReflectPlanarF ¶
func VImageVerticalReflectPlanarF(src *VImageBuffer, dest *VImageBuffer, flags uint32) int
C function: vImageVerticalReflect_PlanarF
func VImageVerticalShearARGB16F ¶
func VImageVerticalShearARGB16F(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, yTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor *uint16, flags uint32) int
C function: vImageVerticalShear_ARGB16F
func VImageVerticalShearARGB16S ¶
func VImageVerticalShearARGB16S(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, yTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor *int16, flags uint32) int
C function: vImageVerticalShear_ARGB16S
func VImageVerticalShearARGB16U ¶
func VImageVerticalShearARGB16U(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, yTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor *uint16, flags uint32) int
C function: vImageVerticalShear_ARGB16U
func VImageVerticalShearARGB8888 ¶
func VImageVerticalShearARGB8888(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, yTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor *uint8, flags uint32) int
C function: vImageVerticalShear_ARGB8888
func VImageVerticalShearARGBFFFF ¶
func VImageVerticalShearARGBFFFF(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, yTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor *float32, flags uint32) int
C function: vImageVerticalShear_ARGBFFFF
func VImageVerticalShearCbCr8 ¶
func VImageVerticalShearCbCr8(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, yTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor *uint8, flags uint32) int
C function: vImageVerticalShear_CbCr8
func VImageVerticalShearCbCr16F ¶
func VImageVerticalShearCbCr16F(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, yTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor *uint16, flags uint32) int
C function: vImageVerticalShear_CbCr16F
func VImageVerticalShearCbCr16S ¶
func VImageVerticalShearCbCr16S(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, yTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor *int16, flags uint32) int
C function: vImageVerticalShear_CbCr16S
func VImageVerticalShearCbCr16U ¶
func VImageVerticalShearCbCr16U(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, yTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor *uint16, flags uint32) int
C function: vImageVerticalShear_CbCr16U
func VImageVerticalShearDARGB16F ¶
func VImageVerticalShearDARGB16F(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, yTranslate float64, shearSlope float64, filter unsafe.Pointer, backColor *uint16, flags uint32) int
C function: vImageVerticalShearD_ARGB16F
func VImageVerticalShearDARGB16S ¶
func VImageVerticalShearDARGB16S(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, yTranslate float64, shearSlope float64, filter unsafe.Pointer, backColor *int16, flags uint32) int
C function: vImageVerticalShearD_ARGB16S
func VImageVerticalShearDARGB16U ¶
func VImageVerticalShearDARGB16U(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, yTranslate float64, shearSlope float64, filter unsafe.Pointer, backColor *uint16, flags uint32) int
C function: vImageVerticalShearD_ARGB16U
func VImageVerticalShearDARGB8888 ¶
func VImageVerticalShearDARGB8888(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, yTranslate float64, shearSlope float64, filter unsafe.Pointer, backColor *uint8, flags uint32) int
C function: vImageVerticalShearD_ARGB8888
func VImageVerticalShearDARGBFFFF ¶
func VImageVerticalShearDARGBFFFF(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, yTranslate float64, shearSlope float64, filter unsafe.Pointer, backColor *float32, flags uint32) int
C function: vImageVerticalShearD_ARGBFFFF
func VImageVerticalShearDCbCr16F ¶
func VImageVerticalShearDCbCr16F(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, yTranslate float64, shearSlope float64, filter unsafe.Pointer, backColor *uint16, flags uint32) int
C function: vImageVerticalShearD_CbCr16F
func VImageVerticalShearDCbCr16S ¶
func VImageVerticalShearDCbCr16S(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, yTranslate float64, shearSlope float64, filter unsafe.Pointer, backColor *int16, flags uint32) int
C function: vImageVerticalShearD_CbCr16S
func VImageVerticalShearDCbCr16U ¶
func VImageVerticalShearDCbCr16U(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, yTranslate float64, shearSlope float64, filter unsafe.Pointer, backColor *uint16, flags uint32) int
C function: vImageVerticalShearD_CbCr16U
func VImageVerticalShearDPlanar8 ¶
func VImageVerticalShearDPlanar8(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, yTranslate float64, shearSlope float64, filter unsafe.Pointer, backColor uint8, flags uint32) int
C function: vImageVerticalShearD_Planar8
func VImageVerticalShearDPlanar16F ¶
func VImageVerticalShearDPlanar16F(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, yTranslate float64, shearSlope float64, filter unsafe.Pointer, backColor uint16, flags uint32) int
C function: vImageVerticalShearD_Planar16F
func VImageVerticalShearDPlanarF ¶
func VImageVerticalShearDPlanarF(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, yTranslate float64, shearSlope float64, filter unsafe.Pointer, backColor float32, flags uint32) int
C function: vImageVerticalShearD_PlanarF
func VImageVerticalShearPlanar8 ¶
func VImageVerticalShearPlanar8(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, yTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor uint8, flags uint32) int
C function: vImageVerticalShear_Planar8
func VImageVerticalShearPlanar16F ¶
func VImageVerticalShearPlanar16F(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, yTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor uint16, flags uint32) int
C function: vImageVerticalShear_Planar16F
func VImageVerticalShearPlanar16S ¶
func VImageVerticalShearPlanar16S(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, yTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor int16, flags uint32) int
C function: vImageVerticalShear_Planar16S
func VImageVerticalShearPlanar16U ¶
func VImageVerticalShearPlanar16U(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, yTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor uint16, flags uint32) int
C function: vImageVerticalShear_Planar16U
func VImageVerticalShearPlanarF ¶
func VImageVerticalShearPlanarF(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, yTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor float32, flags uint32) int
C function: vImageVerticalShear_PlanarF
func VImageVerticalShearXRGB2101010W ¶
func VImageVerticalShearXRGB2101010W(src *VImageBuffer, dest *VImageBuffer, srcOffsetToROIX uint, srcOffsetToROIY uint, yTranslate float32, shearSlope float32, filter unsafe.Pointer, backColor uint32, flags uint32) int
C function: vImageVerticalShear_XRGB2101010W
Types ¶
type Acl_entry_id_t ¶
type Acl_entry_id_t int64
const ( ACL_FIRST_ENTRY Acl_entry_id_t = 0 ACL_NEXT_ENTRY Acl_entry_id_t = -1 ACL_LAST_ENTRY Acl_entry_id_t = -2 )
func (Acl_entry_id_t) String ¶
func (e Acl_entry_id_t) String() string
type Acl_flag_t ¶
type Acl_flag_t int64
const ( ACL_FLAG_DEFER_INHERIT Acl_flag_t = 1 ACL_FLAG_NO_INHERIT Acl_flag_t = 131072 ACL_ENTRY_INHERITED Acl_flag_t = 16 ACL_ENTRY_FILE_INHERIT Acl_flag_t = 32 ACL_ENTRY_DIRECTORY_INHERIT Acl_flag_t = 64 ACL_ENTRY_LIMIT_INHERIT Acl_flag_t = 128 ACL_ENTRY_ONLY_INHERIT Acl_flag_t = 256 )
func (Acl_flag_t) String ¶
func (e Acl_flag_t) String() string
type Acl_perm_t ¶
type Acl_perm_t int64
const ( ACL_READ_DATA Acl_perm_t = 2 ACL_LIST_DIRECTORY Acl_perm_t = 2 ACL_WRITE_DATA Acl_perm_t = 4 ACL_ADD_FILE Acl_perm_t = 4 ACL_EXECUTE Acl_perm_t = 8 ACL_SEARCH Acl_perm_t = 8 ACL_DELETE Acl_perm_t = 16 ACL_APPEND_DATA Acl_perm_t = 32 ACL_ADD_SUBDIRECTORY Acl_perm_t = 32 ACL_DELETE_CHILD Acl_perm_t = 64 ACL_READ_ATTRIBUTES Acl_perm_t = 128 ACL_WRITE_ATTRIBUTES Acl_perm_t = 256 ACL_READ_EXTATTRIBUTES Acl_perm_t = 512 ACL_WRITE_EXTATTRIBUTES Acl_perm_t = 1024 ACL_READ_SECURITY Acl_perm_t = 2048 ACL_WRITE_SECURITY Acl_perm_t = 4096 ACL_CHANGE_OWNER Acl_perm_t = 8192 ACL_SYNCHRONIZE Acl_perm_t = 1048576 )
func (Acl_perm_t) String ¶
func (e Acl_perm_t) String() string
type Acl_type_t ¶
type Acl_type_t int64
const ( ACL_TYPE_EXTENDED Acl_type_t = 256 ACL_TYPE_ACCESS Acl_type_t = 0 ACL_TYPE_DEFAULT Acl_type_t = 1 ACL_TYPE_AFS Acl_type_t = 2 ACL_TYPE_CODA Acl_type_t = 3 ACL_TYPE_NTFS Acl_type_t = 4 ACL_TYPE_NWFS Acl_type_t = 5 )
func (Acl_type_t) String ¶
func (e Acl_type_t) String() string
type Dispatch_autorelease_frequency_t ¶
type Dispatch_autorelease_frequency_t uint64
const ( DISPATCH_AUTORELEASE_FREQUENCY_INHERIT Dispatch_autorelease_frequency_t = 0 DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM Dispatch_autorelease_frequency_t = 1 DISPATCH_AUTORELEASE_FREQUENCY_NEVER Dispatch_autorelease_frequency_t = 2 )
func (Dispatch_autorelease_frequency_t) String ¶
func (e Dispatch_autorelease_frequency_t) String() string
type Dispatch_block_flags_t ¶
type Dispatch_block_flags_t uint64
const ( DISPATCH_BLOCK_BARRIER Dispatch_block_flags_t = 1 DISPATCH_BLOCK_DETACHED Dispatch_block_flags_t = 2 DISPATCH_BLOCK_ASSIGN_CURRENT Dispatch_block_flags_t = 4 DISPATCH_BLOCK_NO_QOS_CLASS Dispatch_block_flags_t = 8 DISPATCH_BLOCK_INHERIT_QOS_CLASS Dispatch_block_flags_t = 16 DISPATCH_BLOCK_ENFORCE_QOS_CLASS Dispatch_block_flags_t = 32 )
func (Dispatch_block_flags_t) String ¶
func (e Dispatch_block_flags_t) String() string
type Filesec_property_t ¶
type Filesec_property_t int64
const ( FILESEC_OWNER Filesec_property_t = 1 FILESEC_GROUP Filesec_property_t = 2 FILESEC_UUID Filesec_property_t = 3 FILESEC_MODE Filesec_property_t = 4 FILESEC_ACL Filesec_property_t = 5 FILESEC_GRPUUID Filesec_property_t = 6 FILESEC_ACL_RAW Filesec_property_t = 100 FILESEC_ACL_ALLOCSIZE Filesec_property_t = 101 )
func (Filesec_property_t) String ¶
func (e Filesec_property_t) String() string
type Ipc_info_object_type_t ¶
type Ipc_info_object_type_t int64
const ( IPC_OTYPE_NONE Ipc_info_object_type_t = 0 IPC_OTYPE_THREAD_CONTROL Ipc_info_object_type_t = 1 IPC_OTYPE_TASK_CONTROL Ipc_info_object_type_t = 2 IPC_OTYPE_HOST Ipc_info_object_type_t = 3 IPC_OTYPE_HOST_PRIV Ipc_info_object_type_t = 4 IPC_OTYPE_PROCESSOR Ipc_info_object_type_t = 5 IPC_OTYPE_PROCESSOR_SET Ipc_info_object_type_t = 6 IPC_OTYPE_PROCESSOR_SET_NAME Ipc_info_object_type_t = 7 IPC_OTYPE_TIMER Ipc_info_object_type_t = 8 IPC_OTYPE_PORT_SUBST_ONCE Ipc_info_object_type_t = 9 IPC_OTYPE_MIG Ipc_info_object_type_t = 10 IPC_OTYPE_MEMORY_OBJECT Ipc_info_object_type_t = 11 IPC_OTYPE_XMM_PAGER Ipc_info_object_type_t = 12 IPC_OTYPE_XMM_KERNEL Ipc_info_object_type_t = 13 IPC_OTYPE_XMM_REPLY Ipc_info_object_type_t = 14 IPC_OTYPE_UND_REPLY Ipc_info_object_type_t = 15 IPC_OTYPE_HOST_NOTIFY Ipc_info_object_type_t = 16 IPC_OTYPE_HOST_SECURITY Ipc_info_object_type_t = 17 IPC_OTYPE_LEDGER Ipc_info_object_type_t = 18 IPC_OTYPE_MAIN_DEVICE Ipc_info_object_type_t = 19 IPC_OTYPE_TASK_NAME Ipc_info_object_type_t = 20 IPC_OTYPE_SUBSYSTEM Ipc_info_object_type_t = 21 IPC_OTYPE_IO_DONE_QUEUE Ipc_info_object_type_t = 22 IPC_OTYPE_SEMAPHORE Ipc_info_object_type_t = 23 IPC_OTYPE_LOCK_SET Ipc_info_object_type_t = 24 IPC_OTYPE_CLOCK Ipc_info_object_type_t = 25 IPC_OTYPE_CLOCK_CTRL Ipc_info_object_type_t = 26 IPC_OTYPE_IOKIT_IDENT Ipc_info_object_type_t = 27 IPC_OTYPE_NAMED_ENTRY Ipc_info_object_type_t = 28 IPC_OTYPE_IOKIT_CONNECT Ipc_info_object_type_t = 29 IPC_OTYPE_IOKIT_OBJECT Ipc_info_object_type_t = 30 IPC_OTYPE_UPL Ipc_info_object_type_t = 31 IPC_OTYPE_MEM_OBJ_CONTROL Ipc_info_object_type_t = 32 IPC_OTYPE_AU_SESSIONPORT Ipc_info_object_type_t = 33 IPC_OTYPE_FILEPORT Ipc_info_object_type_t = 34 IPC_OTYPE_LABELH Ipc_info_object_type_t = 35 IPC_OTYPE_TASK_RESUME Ipc_info_object_type_t = 36 IPC_OTYPE_VOUCHER Ipc_info_object_type_t = 37 IPC_OTYPE_VOUCHER_ATTR_CONTROL Ipc_info_object_type_t = 38 IPC_OTYPE_WORK_INTERVAL Ipc_info_object_type_t = 39 IPC_OTYPE_UX_HANDLER Ipc_info_object_type_t = 40 IPC_OTYPE_UEXT_OBJECT Ipc_info_object_type_t = 41 IPC_OTYPE_ARCADE_REG Ipc_info_object_type_t = 42 IPC_OTYPE_EVENTLINK Ipc_info_object_type_t = 43 IPC_OTYPE_TASK_INSPECT Ipc_info_object_type_t = 44 IPC_OTYPE_TASK_READ Ipc_info_object_type_t = 45 IPC_OTYPE_THREAD_INSPECT Ipc_info_object_type_t = 46 IPC_OTYPE_THREAD_READ Ipc_info_object_type_t = 47 IPC_OTYPE_SUID_CRED Ipc_info_object_type_t = 48 IPC_OTYPE_HYPERVISOR Ipc_info_object_type_t = 49 IPC_OTYPE_TASK_ID_TOKEN Ipc_info_object_type_t = 50 IPC_OTYPE_TASK_FATAL Ipc_info_object_type_t = 51 IPC_OTYPE_KCDATA Ipc_info_object_type_t = 52 IPC_OTYPE_EXCLAVES_RESOURCE Ipc_info_object_type_t = 53 IPC_OTYPE_THREAD_RESUME Ipc_info_object_type_t = 54 IPC_OTYPE_UNKNOWN Ipc_info_object_type_t = 4294967295 )
func (Ipc_info_object_type_t) String ¶
func (e Ipc_info_object_type_t) String() string
type Launch_data_type_t ¶
type Launch_data_type_t int64
const ( LAUNCH_DATA_DICTIONARY Launch_data_type_t = 1 LAUNCH_DATA_ARRAY Launch_data_type_t = 2 LAUNCH_DATA_FD Launch_data_type_t = 3 LAUNCH_DATA_INTEGER Launch_data_type_t = 4 LAUNCH_DATA_REAL Launch_data_type_t = 5 LAUNCH_DATA_BOOL Launch_data_type_t = 6 LAUNCH_DATA_STRING Launch_data_type_t = 7 LAUNCH_DATA_OPAQUE Launch_data_type_t = 8 LAUNCH_DATA_ERRNO Launch_data_type_t = 9 LAUNCH_DATA_MACHPORT Launch_data_type_t = 10 )
func (Launch_data_type_t) String ¶
func (e Launch_data_type_t) String() string
type MDLabelDomain ¶
type MDLabelDomain int64
@typedef MDLabelDomain @abstract These constants are used to specify a domain to MDLabelCreate().
const ( KMDLabelUserDomain MDLabelDomain = 0 KMDLabelLocalDomain MDLabelDomain = 1 )
func (MDLabelDomain) String ¶
func (e MDLabelDomain) String() string
type MDQueryOptionFlags ¶
type MDQueryOptionFlags int64
const ( KMDQuerySynchronous MDQueryOptionFlags = 1 KMDQueryWantsUpdates MDQueryOptionFlags = 4 KMDQueryAllowFSTranslation MDQueryOptionFlags = 8 )
func (MDQueryOptionFlags) String ¶
func (e MDQueryOptionFlags) String() string
type MDQuerySortOptionFlags ¶
type MDQuerySortOptionFlags int64
@enum MDQuerySortOptionFlags @constant kMDQueryReverseSortOrderFlag Sort the attribute in reverse order.
const (
KMDQueryReverseSortOrderFlag MDQuerySortOptionFlags = 1
)
func (MDQuerySortOptionFlags) String ¶
func (e MDQuerySortOptionFlags) String() string
type Mach_vm_range_flags_t ¶
type Mach_vm_range_flags_t int64
const (
MACH_VM_RANGE_NONE Mach_vm_range_flags_t = 0
)
func (Mach_vm_range_flags_t) String ¶
func (e Mach_vm_range_flags_t) String() string
type Mach_vm_range_flavor_t ¶
type Mach_vm_range_flavor_t int64
const ( MACH_VM_RANGE_FLAVOR_INVALID Mach_vm_range_flavor_t = 0 MACH_VM_RANGE_FLAVOR_V1 Mach_vm_range_flavor_t = 1 )
func (Mach_vm_range_flavor_t) String ¶
func (e Mach_vm_range_flavor_t) String() string
type Mach_vm_range_tag_t ¶
type Mach_vm_range_tag_t int64
const ( MACH_VM_RANGE_DEFAULT Mach_vm_range_tag_t = 0 MACH_VM_RANGE_DATA Mach_vm_range_tag_t = 1 MACH_VM_RANGE_FIXED Mach_vm_range_tag_t = 2 )
func (Mach_vm_range_tag_t) String ¶
func (e Mach_vm_range_tag_t) String() string
type Mpo_flags_t ¶
type Mpo_flags_t int64
const ( MPO_PORT Mpo_flags_t = 0 MPO_SERVICE_PORT Mpo_flags_t = 1024 MPO_CONNECTION_PORT Mpo_flags_t = 2048 MPO_REPLY_PORT Mpo_flags_t = 4096 MPO_WEAK_REPLY_PORT Mpo_flags_t = 16384 MPO_NOTIFICATION_PORT Mpo_flags_t = 17408 MPO_EXCEPTION_PORT Mpo_flags_t = 32768 MPO_CONNECTION_PORT_WITH_PORT_ARRAY Mpo_flags_t = 65536 )
func (Mpo_flags_t) String ¶
func (e Mpo_flags_t) String() string
type NXMouseButton ¶
type NXMouseButton int64
const ( NX_OneButton NXMouseButton = 0 NX_LeftButton NXMouseButton = 1 NX_RightButton NXMouseButton = 2 )
func (NXMouseButton) String ¶
func (e NXMouseButton) String() string
type Os_clockid_t ¶
type Os_clockid_t int64
const (
OS_CLOCK_MACH_ABSOLUTE_TIME Os_clockid_t = 32
)
func (Os_clockid_t) String ¶
func (e Os_clockid_t) String() string
type PMPageToPaperMappingType ¶
type PMPageToPaperMappingType int64
const ( KPMPageToPaperMappingNone PMPageToPaperMappingType = 1 KPMPageToPaperMappingScaleToFit PMPageToPaperMappingType = 2 )
func (PMPageToPaperMappingType) String ¶
func (e PMPageToPaperMappingType) String() string
type Ptrauth_key ¶
type Ptrauth_key int64
const ( Ptrauth_key_none Ptrauth_key = -1 Ptrauth_key_asia Ptrauth_key = 0 Ptrauth_key_asib Ptrauth_key = 1 Ptrauth_key_asda Ptrauth_key = 2 Ptrauth_key_asdb Ptrauth_key = 3 Ptrauth_key_process_independent_code Ptrauth_key = 0 Ptrauth_key_process_dependent_code Ptrauth_key = 1 Ptrauth_key_process_independent_data Ptrauth_key = 2 Ptrauth_key_process_dependent_data Ptrauth_key = 3 Ptrauth_key_return_address Ptrauth_key = 1 Ptrauth_key_frame_pointer Ptrauth_key = 3 Ptrauth_key_function_pointer Ptrauth_key = 0 Ptrauth_key_block_function Ptrauth_key = 0 Ptrauth_key_cxx_vtable_pointer Ptrauth_key = 2 Ptrauth_key_method_list_pointer Ptrauth_key = 2 Ptrauth_key_objc_isa_pointer Ptrauth_key = 2 Ptrauth_key_objc_super_pointer Ptrauth_key = 2 Ptrauth_key_objc_sel_pointer Ptrauth_key = 3 Ptrauth_key_objc_class_ro_pointer Ptrauth_key = 2 Ptrauth_key_block_descriptor_pointer Ptrauth_key = 2 Ptrauth_key_init_fini_pointer Ptrauth_key = 0 )
func (Ptrauth_key) String ¶
func (e Ptrauth_key) String() string
type Qos_class_t ¶
type Qos_class_t uint32
const ( QOS_CLASS_USER_INTERACTIVE Qos_class_t = 33 QOS_CLASS_USER_INITIATED Qos_class_t = 25 QOS_CLASS_DEFAULT Qos_class_t = 21 QOS_CLASS_UTILITY Qos_class_t = 17 QOS_CLASS_BACKGROUND Qos_class_t = 9 QOS_CLASS_UNSPECIFIED Qos_class_t = 0 )
func (Qos_class_t) String ¶
func (e Qos_class_t) String() string
type VImageARGBToYpCbCr ¶
type VImageARGBToYpCbCr struct {
Opaque [128]uint8
}
@typedef vImage_ARGBToYpCbCr @abstract An opaque representation of a 3x3 converson matrix for converting RGB signals to Y'CbCr. It is used to do the actual conversions. Please attempt to reuse these rather than making new ones each time. @discussion The representation also includes the range of the input and output pixels from the matrix and clamping information. @seealso vImage_ARGBToYpCbCr, which is the inverse matrix C struct: vImage_ARGBToYpCbCr
type VImageARGBToYpCbCrMatrix ¶
type VImageARGBToYpCbCrMatrix struct {
R_Yp float32
G_Yp float32
B_Yp float32
R_Cb float32
G_Cb float32
B_Cb_R_Cr float32
G_Cr float32
B_Cr float32
}
C struct: vImage_ARGBToYpCbCrMatrix
func KvImage_ARGBToYpCbCrMatrix_ITU_R_601_4 ¶
func KvImage_ARGBToYpCbCrMatrix_ITU_R_601_4() *VImageARGBToYpCbCrMatrix
@const kvImage_ARGBToYpCbCrMatrix_ITU_R_601_4 @abstract RGB->Y'CbCr conversion matrix for ITU-Recommendation BT.601-4
func KvImage_ARGBToYpCbCrMatrix_ITU_R_709_2 ¶
func KvImage_ARGBToYpCbCrMatrix_ITU_R_709_2() *VImageARGBToYpCbCrMatrix
@const kvImage_ARGBToYpCbCrMatrix_ITU_R_709_2 @abstract RGB->Y'CbCr conversion matrix for ITU-Recommendation BT.709-2
type VImageARGBType ¶
type VImageARGBType int64
@typedef vImageARGBType @abstract An encoding of an image format type to be used with RGB <-> Y'CbCr conversions in vImage/Conversions.h @discussion These formats enumerate different vImage ARGB pixel formats.
const ( KvImageARGB8888 VImageARGBType = 0 KvImageARGB16U VImageARGBType = 1 KvImageARGB16Q12 VImageARGBType = 2 )
func (VImageARGBType) String ¶
func (e VImageARGBType) String() string
type VImageAffineTransform ¶
C struct: vImage_AffineTransform
type VImageAffineTransformDouble ¶
type VImageAffineTransformDouble struct {
A float64
B float64
C float64
D float64
Tx float64
Ty float64
}
C struct: vImage_AffineTransform_Double
type VImageBuffer ¶
C struct: vImage_Buffer
type VImageCGImageFormat ¶
type VImageCGImageFormat struct {
BitsPerComponent uint32
BitsPerPixel uint32
ColorSpace unsafe.Pointer
BitmapInfo coregraphics.CGBitmapInfo
Version uint32
Decode *float64
RenderingIntent coregraphics.CGColorRenderingIntent
}
@struct vImage_CGImageFormat @abstract A pixel format @discussion A vImage_CGImageFormat describes the ordering of the color channels, how many there are, the size and type of the data in the color channels and whether the data is premultiplied by alpha or not. This format mirrors the image format descriptors used by CoreGraphics to create things like CGImageRef and CGBitmapContextRef. This vImage_CGImageFormat: <pre>@textblock vImage_CGImageFormat format = { .bitsPerComponent = 8, .bitsPerPixel = 32, .colorSpace = CGColorSpaceCreateDeviceRGB(), // don't forget to release this! .bitmapInfo = kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Little, .version = 0, // must be 0 .decode = NULL, .renderingIntent = kCGRenderingIntentDefault }; @/textblock</pre> codes for a little endian ARGB8888 pixel, or what is called in the rest of vImage, BGRA8888. Note: for 16- and 32-bits per component formats (int16_t, uint16_t, half-float, float) most vImage image filters assume the data is in host-endian format. (The APIs in this header do not.) Host-endian is little endian for Intel and ARM, big endian for PowerPC. If the data is not in host-endian format, then you may use vImagePermuteChannels_ARGB8888 or vImageByteSwap_Planar16U to swap the image data byte ordering. Some examples: <pre>@textblock ARGB8888 -> {8, 32, NULL, alpha first, 0, NULL, kCGRenderingIntentDefault} alpha first = { kCGImageAlphaFirst, kCGImageAlphaPremultipliedFirst, kCGImageAlphaNoneSkipFirst } RGBA8888 -> {8, 32, NULL, alpha last, 0, NULL, kCGRenderingIntentDefault} alpha last = { kCGImageAlphaLast, kCGImageAlphaPremultipliedLast, kCGImageAlphaNoneSkipLast } BGRA8888 -> {8, 32, NULL, alpha first | kCGBitmapByteOrder32Little, 0, NULL, kCGRenderingIntentDefault} RGB888 -> {8, 24, NULL, kCGImageAlphaNone | kCGBitmapByteOrderDefault, 0, NULL, kCGRenderingIntentDefault} RGB565 -> {5, 16, NULL, kCGImageAlphaNone | kCGBitmapByteOrder16Little, 0, NULL, kCGRenderingIntentDefault} ARGB1555 -> {5, 16, NULL, alpha first | kCGBitmapByteOrder16Little, 0, NULL, kCGRenderingIntentDefault} RGBA16F -> {16, 64, NULL, alpha last | kCGBitmapFloatComponents | kCGBitmapByteOrder16Little, 0, NULL, kCGRenderingIntentDefault } CMYK8888 -> {8, 32, CGColorSpaceCreateDeviceCMYK(), kCGImageAlphaNone, 0, NULL, kCGRenderingIntentDefault } ARGBFFFF premultiplied -> {32, 128, NULL, kCGImageAlphaPremultipliedFirst | kCGBitmapFloatComponents | kCGBitmapByteOrder32Little, 0, NULL, kCGRenderingIntentDefault } ARGBFFFF not-premultiplied -> {32, 128, NULL, kCGImageAlphaFirst | kCGBitmapFloatComponents | kCGBitmapByteOrder32Little, 0, NULL, kCGRenderingIntentDefault } ARGBFFFF, alpha = 1 -> {32, 128, NULL, kCGImageAlphaNoneSkipFirst | kCGBitmapFloatComponents | kCGBitmapByteOrder32Little, 0, NULL, kCGRenderingIntentDefault } @/textblock</pre> Note that some of these formats, particularly RGB565 and 16F formats are supported by vImage but not necessarily CoreGraphics. They will be converted to a higher precision format as necessary by vImage in vImageCreateCGImageFromBuffer(). By C rules, uninitialized struct parameters are set to zero. The last three parameters are usually zero, so can usually be omitted. <pre>@textblock vImage_CGImageFormat srgb888 = (vImage_CGImageFormat){ .bitsPerComponent = 8, .bitsPerPixel = 24, .colorSpace = NULL, .bitmapInfo = kCGImageAlphaNone | kCGBitmapByteOrderDefault }; @/textblock</pre> To understand how these various parameters relate to one another, we can look at the process of converting from one vImage_CGImageFormat format to another: 1) transform endianness of src format given by bitmapInfo to host endian (except 8 bitPerComponent content) 2) remove decode array transformation, and up convert to a higher range format as necessary to preserve precision / range 3) convert src colorspace to reference XYZ colorspace (may cause upconvert to preserve range / precision) 4) convert XYZ to destination colorspace + rendering intent 5) convert to destination precision (given by bitsPerComponent) 6) deal with any alpha changes (given by bitmapInfo) or flattening that needs to occur 7) Apply any channel reordering requested, if it didn't happen at an earlier step. (As indicated by src and dest bitmapInfo) 8) Apply destination decode array 9) Apply endianness transform given by dest bitmapInfo Clearly, for most common transformations not all steps need to occur and multiple steps can be collapsed into a compound operation. @field bitsPerComponent The number of bits needed to represent one channel of data in one pixel. For ARGB8888, this would be 8. Expected values: {1, 2, 4, 5, 8, 10, 12, 16, 32} @field bitsPerPixel The number of bits needed to represent one pixel. For ARGB8888, this would be 32. It is possible that bitsPerPixel > bitsPerComponent * number of components, but in practice this is rare. The number of color components is given by the colorspace and the number of alpha components (0 or 1) is given by by the bitmapInfo. @field colorSpace A description of how the pixel data in the image is positioned relative to a reference XYZ color space. See CoreGraphics/CGColorSpace.h. Pass NULL as a shorthand for sRGB. The vImage_CGImageFormat is not capable of managing the memory held by the colorSpace. If you created the colorspace, you must be sure to release it before all references to it disappear from scope. @field bitmapInfo The CGBitmapInfo describing the color channels. See CoreGraphics/CGImage.h. ARGB8888 is kCGImageAlphaFirst | kCGBitmapByteOrderDefault BGRA8888 is kCGImageAlphaFirst | kCGBitmapByteOrder32Little @field version The struct is versioned for future expansion. Pass 0 here. @field decode Prior to transformations caused by the colorspace, color channels are subject to a linear transformation. This allows for a different range than the typical [0,1.0]. NULL indicates default behavior of [0,1.0] range, and is what you should use if you don't understand this parameter. See description of CGImageCreate() for a discussion of decode arrays. See also Decode Arrays section of Chapter 4.8 of the PDF specification. The vImage_CGImageFormat is not capable of managing the memory held by the decode array. If you created a decode array on the heap, you must be sure to release it before all references to it disappear from scope. @field renderingIntent See CGColorSpace.h. kCGRenderingIntentDefault is typical here. By convention, rendering intent changes that are not accompanied by a colorspace change are ignored. C struct: vImage_CGImageFormat
type VImageCVImageFormat ¶
type VImageCVImageFormat struct{}
C struct: vImageCVImageFormat VImageCVImageFormat is an opaque type.
type VImageChannelDescription ¶
C struct: vImageChannelDescription
func VImageCVImageFormatGetChannelDescription ¶
func VImageCVImageFormatGetChannelDescription(format unsafe.Pointer, type_ uint32) *VImageChannelDescription
@function vImageCVImageFormat_GetChannelDescription @abstract Get the channel description for a particular channel type @discussion The channel description gives information about the range of values and clamping for a image color channel. @param format The vImageCVImageFormatRef that the channel description is for. @parma type The type of the channel that you wish information about. Example: kvImageBufferTypeCode_Luminance @return A const pointer to a vImageChannelDescription struct. The data in the structure may not be modified and belongs to the vImageCVImageFormatRef. It is destroyed when the vImageCVImageFormatRef is destroyed. @seealso vImageChannelDescription C function: vImageCVImageFormat_GetChannelDescription
type VImageConverter ¶
type VImageConverter struct{}
C struct: vImageConverter VImageConverter is an opaque type.
type VImageMDTableUsageHint ¶
type VImageMDTableUsageHint int64
const ( KvImageMDTableHint_16Q12 VImageMDTableUsageHint = 1 KvImageMDTableHint_Float VImageMDTableUsageHint = 2 )
func (VImageMDTableUsageHint) String ¶
func (e VImageMDTableUsageHint) String() string
type VImageMultidimensionalTableData ¶
type VImageMultidimensionalTableData struct{}
C struct: vImage_MultidimensionalTableData VImageMultidimensionalTableData is an opaque type.
type VImagePerpsectiveTransform ¶
type VImagePerpsectiveTransform struct {
A float32
B float32
C float32
D float32
Tx float32
Ty float32
Vx float32
Vy float32
V float32
}
@typedef vImage_PerpsectiveTransform @abstract Coefficients defining the 3x3 perspective (projective) transform matrix @field a top left cell in 3x3 transform matrix @field b top middle cell in 3x3 transform matrix @field c middle left cell in 3x3 transform matrix @field d middle right cell in 3x3 transform matrix @field tx The x-coordinate translation @field ty The y-coordinate translation @field vx The x-component of the projective vector @field vy The y-component of the projective vector @field v The homogeneous scale factor C struct: vImage_PerpsectiveTransform
type VImageRGBPrimaries ¶
type VImageRGBPrimaries struct {
Red_x float32
Green_x float32
Blue_x float32
White_x float32
Red_y float32
Green_y float32
Blue_y float32
White_y float32
}
C struct: vImageRGBPrimaries
type VImageTransferFunction ¶
type VImageTransferFunction struct {
C0 float64
C1 float64
C2 float64
C3 float64
Gamma float64
Cutoff float64
C4 float64
C5 float64
}
C struct: vImageTransferFunction
type VImageWhitePoint ¶
C struct: vImageWhitePoint
type VImageYpCbCrPixelRange ¶
type VImageYpCbCrPixelRange struct {
Yp_bias int32
CbCr_bias int32
YpRangeMax int32
CbCrRangeMax int32
YpMax int32
YpMin int32
CbCrMax int32
CbCrMin int32
}
@typedef vImage_YpCbCrPixelRange @abstract Range and clamping information for Y'CbCr pixel formats @discussion Y'CbCr formats frequently don't use the entire representable range available to them to represent image data. While a "full range" video format does use the entire range, a "video range" format often leaves the extrema unused, except perhaps to represent values outside of the standard Y'=[0,1] CbCr = [-0.5, 0.5] range. For example, a 8-bit video range format typically uses the range [16,235] for Y' and [16, 240] for Cb and Cr. Some examples: @textblock (vImage_YpCbCrPixelRange){ 16, 128, 235, 240, 255, 0, 255, 1 } // video range 8-bit, unclamped (vImage_YpCbCrPixelRange){ 16, 128, 235, 240, 235, 16, 240, 16 } // video range 8-bit, clamped to video range (vImage_YpCbCrPixelRange){ 0, 128, 255, 255, 255, 1, 255, 0 } // full range 8-bit, clamped to full range @/textblock The bias will be the prebias for YUV -> RGB and postbias for RGB -> YUV. @field Yp_bias The encoding for Y' = 0.0 for this video format (varies by bitdepth) @field CbCr_bias The encoding for {Cb,Cr} = 0.0 for this video format. This is usually the MIDDLE of the range of CbCr, not the low end. @field YpRangeMax The encoding for Y' = 1.0 for this video format. For video range, this is typically less than the maximum representable value. @field CbCrRangeMax The encoding for {Cb,Cr} = 0.5 for this video format. This is usually near the high end of the encodable range (e.g. 0xf0), if not the maximum encodable value (e.g. 0xff) @field YpMax The encoding for the maximum allowed Y' value. All values larger than this will be clamped to this value. @field YpMin The encoding of the minimum allowed Y' value. All values less than this will be clamped to this value. @field CbCrMax The encoding of the maximum allowed {Cb, Cr} value. All chroma values greater than this value will be clamped to this value. @field CbCrMin The encoding of the minimum allowed {Cb, Cr} value. All chroma values less than this value will be clamped to this value. @seealso vImageChannelDescription C struct: vImage_YpCbCrPixelRange
type VImageYpCbCrToARGB ¶
type VImageYpCbCrToARGB struct {
Opaque [128]uint8
}
C struct: vImage_YpCbCrToARGB
type VImageYpCbCrToARGBMatrix ¶
type VImageYpCbCrToARGBMatrix struct {
Yp float32
Cr_R float32
Cr_G float32
Cb_G float32
Cb_B float32
}
C struct: vImage_YpCbCrToARGBMatrix
func KvImage_YpCbCrToARGBMatrix_ITU_R_601_4 ¶
func KvImage_YpCbCrToARGBMatrix_ITU_R_601_4() *VImageYpCbCrToARGBMatrix
@const kvImage_YpCbCrToARGBMatrix_ITU_R_601_4 @abstract Y'CbCr->RGB conversion matrix for ITU-Recommendation BT.601-4
func KvImage_YpCbCrToARGBMatrix_ITU_R_709_2 ¶
func KvImage_YpCbCrToARGBMatrix_ITU_R_709_2() *VImageYpCbCrToARGBMatrix
@const kvImage_YpCbCrToARGBMatrix_ITU_R_709_2 @abstract Y'CbCr->RGB conversion matrix for ITU-Recommendation BT.709-2
type VImageYpCbCrType ¶
type VImageYpCbCrType int64
@typedef vImageYpCbCrType @abstract An encoding of an image format type to be used with RGB <-> Y'CbCr conversions in vImage/Conversions.h @discussion These formats enumerate different vImage/CoreVideo Y'CbCr pixel formats. @seealso CVPixelBuffer OSTypes in CVPixelBuffer.h
const ( KvImage422CbYpCrYp8 VImageYpCbCrType = 0 KvImage422YpCbYpCr8 VImageYpCbCrType = 1 KvImage422CbYpCrYp8_AA8 VImageYpCbCrType = 2 KvImage420Yp8_Cb8_Cr8 VImageYpCbCrType = 3 KvImage420Yp8_CbCr8 VImageYpCbCrType = 4 KvImage444AYpCbCr8 VImageYpCbCrType = 5 KvImage444CrYpCb8 VImageYpCbCrType = 6 KvImage444CbYpCrA8 VImageYpCbCrType = 7 KvImage444CrYpCb10 VImageYpCbCrType = 8 KvImage422CrYpCbYpCbYpCbYpCrYpCrYp10 VImageYpCbCrType = 9 KvImage422CbYpCrYp16 VImageYpCbCrType = 13 KvImage444AYpCbCr16 VImageYpCbCrType = 14 )
func (VImageYpCbCrType) String ¶
func (e VImageYpCbCrType) String() string
type VImage_InterpolationMethod ¶
type VImage_InterpolationMethod int64
const ( KvImageNoInterpolation VImage_InterpolationMethod = 0 KvImageFullInterpolation VImage_InterpolationMethod = 1 KvImageHalfInterpolation VImage_InterpolationMethod = 2 )
func (VImage_InterpolationMethod) String ¶
func (e VImage_InterpolationMethod) String() string
type Virtual_memory_guard_exception_code_t ¶
type Virtual_memory_guard_exception_code_t int64
const ( KGUARD_EXC_DEALLOC_GAP Virtual_memory_guard_exception_code_t = 1 KGUARD_EXC_RECLAIM_COPYIO_FAILURE Virtual_memory_guard_exception_code_t = 2 KGUARD_EXC_RECLAIM_INDEX_FAILURE Virtual_memory_guard_exception_code_t = 4 KGUARD_EXC_RECLAIM_DEALLOCATE_FAILURE Virtual_memory_guard_exception_code_t = 8 KGUARD_EXC_RECLAIM_ACCOUNTING_FAILURE Virtual_memory_guard_exception_code_t = 9 KGUARD_EXC_SEC_IOPL_ON_EXEC_PAGE Virtual_memory_guard_exception_code_t = 10 KGUARD_EXC_SEC_EXEC_ON_IOPL_PAGE Virtual_memory_guard_exception_code_t = 11 KGUARD_EXC_SEC_UPL_WRITE_ON_EXEC_REGION Virtual_memory_guard_exception_code_t = 12 KGUARD_EXC_LARGE_ALLOCATION_TELEMETRY Virtual_memory_guard_exception_code_t = 13 KGUARD_EXC_SEC_ACCESS_FAULT Virtual_memory_guard_exception_code_t = 98 KGUARD_EXC_SEC_ASYNC_ACCESS_FAULT Virtual_memory_guard_exception_code_t = 99 KGUARD_EXC_SEC_COPY_DENIED Virtual_memory_guard_exception_code_t = 100 KGUARD_EXC_SEC_SHARING_DENIED Virtual_memory_guard_exception_code_t = 101 KGUARD_EXC_MTE_SYNC_FAULT Virtual_memory_guard_exception_code_t = 200 KGUARD_EXC_MTE_ASYNC_USER_FAULT Virtual_memory_guard_exception_code_t = 201 KGUARD_EXC_MTE_ASYNC_KERN_FAULT Virtual_memory_guard_exception_code_t = 202 KGUARD_EXC_GUARD_OBJECT_ASYNC_USER_FAULT Virtual_memory_guard_exception_code_t = 203 KGUARD_EXC_GUARD_OBJECT_ASYNC_KERN_FAULT Virtual_memory_guard_exception_code_t = 204 )
func (Virtual_memory_guard_exception_code_t) String ¶
func (e Virtual_memory_guard_exception_code_t) String() string
type Xpc_listener_create_flags_t ¶
type Xpc_listener_create_flags_t int64
const ( XPC_LISTENER_CREATE_NONE Xpc_listener_create_flags_t = 0 XPC_LISTENER_CREATE_INACTIVE Xpc_listener_create_flags_t = 1 XPC_LISTENER_CREATE_FORCE_MACH Xpc_listener_create_flags_t = 2 XPC_LISTENER_CREATE_FORCE_XPCSERVICE Xpc_listener_create_flags_t = 4 )
func (Xpc_listener_create_flags_t) String ¶
func (e Xpc_listener_create_flags_t) String() string
type Xpc_session_create_flags_t ¶
type Xpc_session_create_flags_t int64
const ( XPC_SESSION_CREATE_NONE Xpc_session_create_flags_t = 0 XPC_SESSION_CREATE_INACTIVE Xpc_session_create_flags_t = 1 XPC_SESSION_CREATE_MACH_PRIVILEGED Xpc_session_create_flags_t = 2 )
func (Xpc_session_create_flags_t) String ¶
func (e Xpc_session_create_flags_t) String() string