gocvsimd

package
v0.0.0-...-8cf4257 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2017 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const Resolution = 256

Variables

This section is empty.

Functions

func Align

func Align(size, align int) int

Align gets aligned size. [in] size - an original size. [in] align - a required alignment. return an aligned size.

func Alignment

func Alignment() int

Alignment gets alignment required for the most productive work of the Simd Library. a required alignment.

func Allocate

func Allocate(size, align int) unsafe.Pointer

Allocate allocates an aligned memory block. The memory allocated by this function is must be deleted by function Free [in] size - a size of memory block. [in] align - a required alignment of memory block. return a pointer to allocated memory.

func AsRGBA

func AsRGBA(src image.Image) *image.RGBA

AsRGBA returns an RGBA copy of the supplied image.

func ChannelCount

func ChannelCount(f Format) int

func Free

func Free(ptr unsafe.Pointer)

Free frees aligned memory block. This function frees a memory allocated by function Allocate. [in] ptr - a pointer to the memory to be deleted.

func PixelSize

func PixelSize(f Format) int

func PrintBytes

func PrintBytes(str string, p unsafe.Pointer, len uintptr)

func SimdSetup

func SimdSetup(f Format) (View, View)

func SimdSse2AbsDifferenceSum

func SimdSse2AbsDifferenceSum(a, b View) uint64

SimdSse2AbsDifferenceSum gets sum of absolute difference of two gray 8-bit images. Both images must have the same width and height.

func SimdSse2AbsDifferenceSumMasked

func SimdSse2AbsDifferenceSumMasked(a, b, mask View, index uint64) uint64

SimdSse2AbsDifferenceSumMasked gets sum of absolute difference of two gray 8-bit images based on gray 8-bit mask. Gets the absolute difference sum for all points when mask[i] == index. Both images and mask must have the same width and height.

func SimdSse2AbsDifferenceSums3x3

func SimdSse2AbsDifferenceSums3x3(current, background View) [9]uint64

SimdSse2AbsDifferenceSums3x3 gets 9 sums of absolute difference of two gray 8-bit images with various relative shifts in neighborhood 3x3. Both images must have the same width and height. The image height and width must be equal or greater 3. The sums are calculated with central part (indent width = 1) of the current image and with part of the background image with corresponding shift. The shifts are lain in the range [-1, 1] for axis x and y.

func SimdSse2AbsDifferenceSums3x3Masked

func SimdSse2AbsDifferenceSums3x3Masked(current, background, mask View, index uint64) [9]uint64

SimdSse2AbsDifferenceSums3x3Masked gets 9 sums of absolute difference of two gray 8-bit images with various relative shifts in neighborhood 3x3 based on gray 8-bit mask. Gets the absolute difference sums for all points when mask[i] == index. Both images and mask must have the same width and height. The image height and width must be equal or greater 3. The sums are calculated with central part (indent width = 1) of the current image and with part of the background image with the corresponding shift. The shifts are lain in the range [-1, 1] for axis x and y.

func SimdSse2AbsGradientSaturatedSum

func SimdSse2AbsGradientSaturatedSum(src, dst View)

SimdSse2AbsGradientSaturatedSum puts to destination 8-bit gray image saturated sum of absolute gradient for every point of source 8-bit gray image. Both images must have the same width and height.

For border pixels:
	dst[x, y] = 0;
For other pixels:
	dx = abs(src[x + 1, y] - src[x - 1, y]);
	dy = abs(src[x, y + 1] - src[x, y - 1]);
	dst[x, y] = min(dx + dy, 255);

func SimdSse2AbsSecondDerivativeHistogram

func SimdSse2AbsSecondDerivativeHistogram(src View, step, indent uint64, histo View)

func SimdSse2AddFeatureDifference

func SimdSse2AddFeatureDifference(value, lo, hi View, weight uint64, difference View)

SimdSse2AddFeatureDifference adds feature difference to common difference in sum. All images must have the same width, height and format (8-bit gray).

For every point:
	excess = max(lo[i] - value[i], 0) + max(value[i] - hi[i], 0);
	difference[i] += (weight * excess*excess) >> 16;

This function is used for difference estimation in algorithm of motion detection.

func SimdSse2AlphaBlending

func SimdSse2AlphaBlending(src, alpha, dst View)

SimdSse2AlphaBlending performs alpha blending operation. All images must have the same width and height. Source and destination images must have the same format (8 bit per channel, for example GRAY8, BGR24 or BGRA32). Alpha must be 8-bit gray image.

For every point:
	dst[i] = (src[i]*alpha[i] + dst[i]*(255 - alpha[i]))/255;

This function is used for image drawing.

func SimdSse2AveragingBinarization

func SimdSse2AveragingBinarization(src View, value uint64, neighborhood uint64, threshold, positive, negative uint64, dst View, compareType uint64)

SimdSse2AveragingBinarization performs averaging binarization of 8-bit gray image. All images must have 8-bit gray format and must have the same width and height.

For every point:
	sum = 0; area = 0;
	for(dy = -neighborhood; dy <= neighborhood; ++dy)
	{
		for(dx = -neighborhood; dx <= neighborhood; ++dx)
		{
			if(x + dx >= 0 && x + dx < width && y + dy >= 0 && y + dy < height)
			{
				area++;
				if(compare(src[x + dx, x + dy], value))
					sum++;
			}
		}
	}
	dst[x, y] = sum*255 > area*threshold ? positive : negative;

where compare(a, b) depends from compareType (see ::SimdCompareType).

func SimdSse2BackgroundAdjustRange

func SimdSse2BackgroundAdjustRange(loCount, loValue, hiCount, hiValue View, threshold uint64)

SimdSse2BackgroundAdjustRange performs adjustment of background range. All images must have the same width, height and format (8-bit gray).

Adjusts background range for every point:
    loValue[i] -= (loCount[i] > threshold && loValue[i] > 0) ? 1 : 0;
    loValue[i] += (loCount[i] < threshold && loValue[i] < 255) ? 1 : 0;
    loCount[i] = 0;
    hiValue[i] += (hiCount[i] > threshold && hiValue[i] < 255) ? 1 : 0;
    hiValue[i] -= (hiCount[i] < threshold && hiValue[i] > 0) ? 1 : 0;
    hiCount[i] = 0;

This function is used for background updating in motion detection algorithm.

func SimdSse2BackgroundAdjustRangeMasked

func SimdSse2BackgroundAdjustRangeMasked(loCount, loValue, hiCount, hiValue View, threshold uint64, mask View)

SimdSse2BackgroundAdjustRangeMasked performs adjustment of background range with using adjust range mask. All images must have the same width, height and format (8-bit gray).

Adjusts background range for every point:
    if(mask[i])
    {
        loValue[i] -= (loCount[i] > threshold && loValue[i] > 0) ? 1 : 0;
        loValue[i] += (loCount[i] < threshold && loValue[i] < 255) ? 1 : 0;
        loCount[i] = 0;
        hiValue[i] += (hiCount[i] > threshold && hiValue[i] < 255) ? 1 : 0;
        hiValue[i] -= (hiCount[i] < threshold && hiValue[i] > 0) ? 1 : 0;
        hiCount[i] = 0;
    }

This function is used for background updating in motion detection algorithm.

func SimdSse2BackgroundGrowRangeFast

func SimdSse2BackgroundGrowRangeFast(value, lo, hi View)

SimdSse2BackgroundGrowRangeFast performs background update (initial grow, fast mode). All images must have the same width, height and format (8-bit gray).

For every point:
    lo[i] = value[i] < lo[i] ? value[i] : lo[i];
    hi[i] = value[i] > hi[i] ? value[i] : hi[i];

This function is used for background updating in motion detection algorithm.

func SimdSse2BackgroundGrowRangeSlow

func SimdSse2BackgroundGrowRangeSlow(value, lo, hi View)

SimdSse2BackgroundGrowRangeSlow performs background update (initial grow, slow mode). All images must have the same width, height and format (8-bit gray).

For every point:
	lo[i] -= value[i] < lo[i] ? 1 : 0;
	hi[i] += value[i] > hi[i] ? 1 : 0;

This function is used for background updating in motion detection algorithm.

func SimdSse2BackgroundIncrementCount

func SimdSse2BackgroundIncrementCount(value, lo, hi, loCount, hiCount View)

SimdSse2BackgroundIncrementCount performs collection of background statistic. All images must have the same width, height and format (8-bit gray).

Updates background statistic counters for every point:
    loCount[i] += (value[i] < loValue[i] && loCount[i] < 255) ? 1 : 0;
    hiCount[i] += (value[i] > hiValue[i] && hiCount[i] < 255) ? 1 : 0;

This function is used for background updating in motion detection algorithm.

func SimdSse2BackgroundInitMask

func SimdSse2BackgroundInitMask(src View, index, value uint64, dst View)

SimdSse2BackgroundInitMask creates background update mask. All images must have the same width, height and format (8-bit gray).

For every point:
    if(mask[i] == index)
    dst[i] = value;

This function is used for background updating in motion detection algorithm.

func SimdSse2BackgroundShiftRange

func SimdSse2BackgroundShiftRange(value, lo, hi View)

SimdSse2BackgroundShiftRange shifts background range. All images must have the same width, height and format (8-bit gray).

For every point:
	if (value[i] > hi[i])
	{
		lo[i] = min(lo[i] + value[i] - hi[i], 255);
		hi[i] = value[i];
	}
	if (lo[i] > value[i])
	{
		lo[i] = value[i];
		hi[i] = max(hi[i] - lo[i] + value[i], 0);
	}

This function is used for fast background updating in motion detection algorithm.

func SimdSse2BackgroundShiftRangeMasked

func SimdSse2BackgroundShiftRangeMasked(value, lo, hi, mask View)

SimdSse2BackgroundShiftRangeMasked shifts background range with using shift range mask. All images must have the same width, height and format (8-bit gray).

For every point:
	if(mask[i])
	{
		if (value[i] > hi[i])
		{
			lo[i] = min(lo[i] + value[i] - hi[i], 255);
			hi[i] = value[i];
		}
		if (lo[i] > value[i])
		{
			lo[i] = value[i];
			hi[i] = max(hi[i] - lo[i] + value[i], 0);
		}
	}

This function is used for fast background updating in motion detection algorithm.

func SimdSse2Bgr48pToBgra32

func SimdSse2Bgr48pToBgra32(blue, green, red, bgra View, alpha uint64)

SimdSse2Bgr48pToBgra32 converts 48-bit planar BGR image to 32-bit BGRA image. All images must have the same width and height.

func SimdSse2BgraToGray

func SimdSse2BgraToGray(bgra, gray View)

SimdSse2BgraToGray converts 32-bit BGRA image to 8-bit gray image. All images must have the same width and height.

func SimdSse2BgraToYuv420p

func SimdSse2BgraToYuv420p(bgra, y, u, v View)

SimdSse2BgraToYuv420p converts 32-bit BGRA image to YUV420P.

The input BGRA and output Y images must have the same width and height.

The input U and V images must have the same width and height (half size relative to Y component).

func SimdSse2BgraToYuv422p

func SimdSse2BgraToYuv422p(bgra, y, u, v View)

SimdSse2BgraToYuv422p converts 32-bit BGRA image to YUV422P.

The input BGRA and output Y images must have the same width and height.

The input U and V images must have the same width and height (their width is equal to half width of Y component).

func SimdSse2BgraToYuv444p

func SimdSse2BgraToYuv444p(bgra, y, u, v View)

SimdSse2BgraToYuv444p converts 32-bit BGRA image to YUV444P. The input BGRA and output Y, U and V images must have the same width and height.

func SimdSse2Binarization

func SimdSse2Binarization(src View, value, positive, negative uint64, dst View, compareType uint64)

SimdSse2Binarization performs binarization of 8-bit gray image. All images must have 8-bit gray format and must have the same width and height.

For every point:
	dst[i] = compare(src[i], value) ? positive : negative;

where compare(a, b) depends from compareType (see ::SimdCompareType).

func SimdSse2ConditionalCount16i

func SimdSse2ConditionalCount16i(src View, value uint64, compareType uint64) uint32

SimdSse2ConditionalCount16i calculates the number of points satisfying certain condition for 16-bit signed integer image.

For every point:
	if(compare(src[i], value))
	count++;

where compare(a, b) depends from compareType (see ::SimdCompareType).

func SimdSse2ConditionalCount8u

func SimdSse2ConditionalCount8u(src View, value uint64, compareType uint64) uint32

SimdSse2ConditionalCount8u calculates number of points satisfying certain condition for 8-bit gray image.

For every point:
	if(compare(src[i], value))
	count++;

where compare(a, b) depends from compareType (see ::SimdCompareType).

func SimdSse2ConditionalFill

func SimdSse2ConditionalFill(src View, threshold uint64, compareType uint64, value uint64, dst View)

SimdSse2ConditionalFill fills pixels of 8-bit gray image by given value if corresponding pixels of input 8-bit gray image satisfy certain condition. All images must have the same width and height.

For every point:
	if(compare(src[i], threshold))
	dst[i] = value;

where compare(a, b) depends from compareType (see ::SimdCompareType).

func SimdSse2ConditionalSquareGradientSum

func SimdSse2ConditionalSquareGradientSum(src, mask View, value uint64, compareType uint64) uint64

SimdSse2ConditionalSquareGradientSum calculates sum of squared gradient of image points when mask points satisfying certain condition. All images must have 8-bit gray format and must have the same width and height. The image height and width must be equal or greater 3.

For every point except border:
	if(compare(mask[x, y], value))
	{
		dx = src[x + 1, y] - src[x - 1, y];
		dy = src[x, y + 1] - src[x, y - 1];
		sum += dx*dx + dy*dy;
	}

where compare(a, b) depends from compareType (see ::SimdCompareType).

func SimdSse2ConditionalSquareSum

func SimdSse2ConditionalSquareSum(src, mask View, value uint64, compareType uint64) uint64

SimdSse2ConditionalSquareSum calculates sum of squared image points when mask points satisfying certain condition. All images must have 8-bit gray format and must have the same width and height.

For every point:
	if(compare(mask[i], value))
	sum += src[i]*src[i];

where compare(a, b) depends from compareType (see ::SimdCompareType).

func SimdSse2ConditionalSum

func SimdSse2ConditionalSum(src, mask View, value uint64, compareType uint64) uint64

SimdSse2ConditionalSum calculates sum of image points when mask points satisfying certain condition. All images must have 8-bit gray format and must have the same width and height.

For every point:
	if(compare(mask[i], value))
	sum += src[i];

where compare(a, b) depends from compareType (see ::SimdCompareType).

func SimdSse2ContourAnchors

func SimdSse2ContourAnchors(src View, step uint64, threshold uint64, dst View)

func SimdSse2DeinterleaveUv

func SimdSse2DeinterleaveUv(uv, u, v View)

SimdSse2DeinterleaveUv deinterleaves 16-bit UV interleaved image into separated 8-bit U and V planar images. All images must have the same width and height. This function used for NV12 to YUV420P conversion.

func SimdSse2EstimateAlphaIndexX

func SimdSse2EstimateAlphaIndexX(srcSize, dstSize uint64, indexes, alphas unsafe.Pointer)

func SimdSse2FillBgr

func SimdSse2FillBgr(dst View, blue, green, red int)

SimdSse2FillBgr fills pixels data of 24-bit BGR image by given color(blue, green, red).

func SimdSse2FillBgra

func SimdSse2FillBgra(dst View, blue, green, red, alpha int)

SimdSse2FillBgra fills pixels data of 32-bit BGRA image by given color(blue, green, red, alpha).

func SimdSse2GaussianBlur3x3

func SimdSse2GaussianBlur3x3(src, dst View)

SimdSse2GaussianBlur3x3 performs Gaussian blur filtration with window 3x3.

For every point:
	dst[x, y] = (src[x-1, y-1] + 2*src[x, y-1] + src[x+1, y-1] +
	2*(src[x-1, y] + 2*src[x, y] + src[x+1, y]) +
	src[x-1, y+1] + 2*src[x, y+1] + src[x+1, y+1] + 8) / 16;

All images must have the same width, height and format (8-bit gray, 16-bit UV, 24-bit BGR or 32-bit BGRA).

func SimdSse2GrayToBgra

func SimdSse2GrayToBgra(gray, bgra View)

SimdSse2GrayToBgra converts 8-bit gray image to 32-bit BGRA image. All images must have the same width and height.

func SimdSse2HistogramConditional

func SimdSse2HistogramConditional(src, mask View, value uint64, compareType uint64, histo View)

func SimdSse2HistogramMasked

func SimdSse2HistogramMasked(src, mask View, index uint64) []uint32

func SimdSse2Int16ToGray

func SimdSse2Int16ToGray(src, dst View)

SimdSse2Int16ToGray converts 16-bit signed integer image to 8-bit gray image with saturation. All images must have the same width and height.

func SimdSse2Laplace

func SimdSse2Laplace(src, dst View)

SimdSse2Laplace calculates Laplace's filter. All images must have the same width and height. Input image must has 8-bit gray format, output image must has 16-bit integer format.

func SimdSse2MeanFilter3x3

func SimdSse2MeanFilter3x3(src, dst View)

SimdSse2MeanFilter3x3 performs an averaging with window 3x3.

For every point:
	dst[x, y] = (src[x-1, y-1] + src[x, y-1] + src[x+1, y-1] +
		src[x-1, y] + src[x, y] + src[x+1, y] +
		src[x-1, y+1] + src[x, y+1] + src[x+1, y+1] + 4) / 9;

All images must have the same width, height and format (8-bit gray, 16-bit UV, 24-bit BGR or 32-bit BGRA).

func SimdSse2MedianFilterRhomb3x3

func SimdSse2MedianFilterRhomb3x3(src, dst View)

SimdSse2MedianFilterRhomb3x3 performs median filtration of input image (filter window is a rhomb 3x3). All images must have the same width, height and format (8-bit gray, 16-bit UV, 24-bit BGR or 32-bit BGRA).

func SimdSse2MedianFilterRhomb5x5

func SimdSse2MedianFilterRhomb5x5(src, dst View)

SimdSse2MedianFilterRhomb5x5 performs median filtration of input image (filter window is a rhomb 5x5). All images must have the same width, height and format (8-bit gray, 16-bit UV, 24-bit BGR or 32-bit BGRA).

func SimdSse2MedianFilterSquare3x3

func SimdSse2MedianFilterSquare3x3(src, dst View)

SimdSse2MedianFilterSquare3x3 performs median filtration of input image (filter window is a square 3x3). All images must have the same width, height and format (8-bit gray, 16-bit UV, 24-bit BGR or 32-bit BGRA).

func SimdSse2MedianFilterSquare5x5

func SimdSse2MedianFilterSquare5x5(src, dst View)

SimdSse2MedianFilterSquare5x5 performs median filtration of input image (filter window is a square 5x5). All images must have the same width, height and format (8-bit gray, 16-bit UV, 24-bit BGR or 32-bit BGRA).

func SimdSse2OperationBinary16i

func SimdSse2OperationBinary16i(a, b, dst View, _type uint64)

SimdSse2OperationBinary16i performs given operation between two images. All images must have the same width, height and ::SimdPixelFormatInt16 pixel format.

func SimdSse2OperationBinary8u

func SimdSse2OperationBinary8u(a, b, dst View, _type uint64)

SimdSse2OperationBinary8u performs given operation between two images. All images must have the same width, height and format (8-bit gray, 16-bit UV (UV plane of NV12 pixel format), 24-bit BGR or 32-bit BGRA).

func SimdSse2ReduceGray2x2

func SimdSse2ReduceGray2x2(src, dst View)

func SimdSse2ReduceGray3x3

func SimdSse2ReduceGray3x3(src, dst View, compensation int)

func SimdSse2ReduceGray4x4

func SimdSse2ReduceGray4x4(src, dst View)

func SimdSse2Reorder16bit

func SimdSse2Reorder16bit(src View, size uint64, dst View)

func SimdSse2Reorder32bit

func SimdSse2Reorder32bit(src View, size uint64, dst View)

func SimdSse2Reorder64bit

func SimdSse2Reorder64bit(src View, size uint64, dst View)

func SimdSse2ResizeBilinear

func SimdSse2ResizeBilinear(src, dst View)

func SimdSse2SegmentationChangeIndex

func SimdSse2SegmentationChangeIndex(mask View, oldIndex, newIndex uint64)

SimdSse2SegmentationChangeIndex changes certain index in mask. Mask must has 8-bit gray pixel format.

For every point:
	if(mask[i] == oldIndex)
	mask[i] = newIndex;

func SimdSse2SegmentationFillSingleHoles

func SimdSse2SegmentationFillSingleHoles(mask View, index uint64)

SimdSse2SegmentationFillSingleHoles fills single holes in mask. Mask must has 8-bit gray pixel format.

func SimdSse2SegmentationPropagate2x2

func SimdSse2SegmentationPropagate2x2(parent, child, difference View, currentIndex, invalidIndex, emptyIndex, differenceThreshold uint64)

SimdSse2SegmentationPropagate2x2 propagates mask index from parent (upper) to child (lower) level of mask pyramid with using 2x2 scan window. For parent and child image the following must be true: parentWidth = (childWidth + 1)/2, parentHeight = (childHeight + 1)/2. All images must have 8-bit gray pixel format. Size of different image is equal to the child image.

func SimdSse2ShiftBilinear

func SimdSse2ShiftBilinear(src, bkg View, dst View)

func SimdSse2SobelDx

func SimdSse2SobelDx(src, dst View)

SimdSse2SobelDx calculates Sobel's filter along x axis. All images must have the same width and height. Input image must has 8-bit gray format, output image must has 16-bit integer format.

For every point:
	n dst[x, y] = (src[x+1,y-1] + 2*src[x+1, y] + src[x+1, y+1]) - (src[x-1,y-1] + 2*src[x-1, y] + src[x-1, y+1]).

func SimdSse2SobelDy

func SimdSse2SobelDy(src, dst View)

SimdSse2SobelDy calculates Sobel's filter along y axis. All images must have the same width and height. Input image must has 8-bit gray format, output image must have a 16-bit integer format.

For every point:
	dst[x, y] = (src[x-1,y+1] + 2*src[x, y+1] + src[x+1, y+1]) - (src[x-1,y-1] + 2*src[x, y-1] + src[x+1, y-1]);

func SimdSse2SquaredDifferenceSum

func SimdSse2SquaredDifferenceSum(a, b View) uint64

SimdSse2SquaredDifferenceSum calculates sum of squared differences for two 8-bit gray images. All images must have the same width and height.

For every point:
	sum += (a[i] - b[i])*(a[i] - b[i]);

func SimdSse2SquaredDifferenceSumMasked

func SimdSse2SquaredDifferenceSumMasked(a, b, mask View, index uint64) uint64

SimdSse2SquaredDifferenceSumMasked calculates sum of squared differences for two images with using mask. All images must have the same width, height and format (8-bit gray).

For every point:
	if(mask[i] == index)
		sum += (a[i] - b[i])*(a[i] - b[i]);

func SimdSse2StretchGray2x2

func SimdSse2StretchGray2x2(src, dst View)

SimdSse2StretchGray2x2 stretches input 8-bit gray image in two times.

func SimdSse2TextureBoostedSaturatedGradient

func SimdSse2TextureBoostedSaturatedGradient(src View, saturation, boost uint64, dx, dy View)

SimdSse2TextureBoostedSaturatedGradient calculates boosted saturated gradients for given input image. All images must have the same width, height and format (8-bit gray).

For border pixels:
	dx[x, y] = 0;
	dy[x, y] = 0;
For other pixels:
	dx[x, y] = (saturation + max(-saturation, min(saturation, (src[x + 1, y] - src[x - 1, y]))))*boost;
	dy[x, y] = (saturation + max(-saturation, min(saturation, (src[x, y + 1] - src[x, y - 1]))))*boost;

func SimdSse2TextureBoostedUv

func SimdSse2TextureBoostedUv(src View, boost uint64, dst View)

SimdSse2TextureBoostedUv calculates boosted colorized texture feature of input image (actual for U and V components of YUV format). All images must have the same width, height and format (8-bit gray).

For every pixel:
	lo = 128 - (128/boost);
	hi = 255 - lo;
	dst[x, y] = max(lo, min(hi, src[i]))*boost;

func SimdSse2TextureGetDifferenceSum

func SimdSse2TextureGetDifferenceSum(src, lo, hi View) int64

SimdSse2TextureGetDifferenceSum calculates difference between current image and background. All images must have the same width, height and format (8-bit gray).

For every pixel:
	sum += current - average(lo[i], hi[i]);

func SimdSse2TexturePerformCompensation

func SimdSse2TexturePerformCompensation(src View, shift int, dst View)

SimdSse2TexturePerformCompensation performs brightness compensation of input image. All images must have the same width, height and format (8-bit gray).

For every pixel:
	dst[i] = max(0, min(255, src[i] + shift));

func SimdSse2VectorProduct

func SimdSse2VectorProduct(vertical, horizontal, dst View)

SimdSse2VectorProduct calculates result 8-bit gray image as product of two vectors.

For all points:
	dst[x, y] = horizontal[x]*vertical[y]/255;

func SimdSse2Yuv420pToBgra

func SimdSse2Yuv420pToBgra(y, u, v, bgra View, alpha uint64)

SimdSse2Yuv420pToBgra converts YUV420P image to 32-bit BGRA image.

The input Y and output BGRA images must have the same width and height.
The input U and V images must have the same width and height (half size relative to Y component).

func SimdSse2Yuv422pToBgra

func SimdSse2Yuv422pToBgra(y, u, v, bgra View, alpha uint64)

SimdSse2Yuv422pToBgra converts YUV422P image to 32-bit BGRA image.

The input Y and output BGRA images must have the same width and height.
The input U and V images must have the same width and height (their width is equal to half width of Y component).

func SimdSse2Yuv444pToBgra

func SimdSse2Yuv444pToBgra(y, u, v, bgra View, alpha uint64)

SimdSse2Yuv444pToBgra converts YUV444P image to 32-bit BGRA image.

The input Y, U, V and output BGRA images must have the same width and height.

Types

type Format

type Format uint8
const (
	NONE Format = iota
	GRAY8
	UV16
	BGR24
	BGRA32
	INT16
	INT32
	INT64
	FLOAT
	DOUBLE
	BAYERGRBG
	BAYERGBRG
	BAYERRGGB
	BAYERBGGR
	HSV24
	HSL24
)

type Operation

type Operation uint64
const (
	BINARY_AVERAGE Operation = iota
	BINARY_AND
	BINARY_OR
	BINARY_MAXIMUM
	BINARY_MINIMUM
	BINARY_SATURATED_SUBTRACTION
	BINARY_SATURATED_ADDITION
)

type View

type View struct {
	// contains filtered or unexported fields
}

func LoadImage

func LoadImage(name string) (View, error)

func (*View) GetData

func (v *View) GetData() unsafe.Pointer

func (*View) GetDataLen

func (v *View) GetDataLen() int

func (*View) GetFormat

func (v *View) GetFormat() Format

func (*View) GetHeight

func (v *View) GetHeight() int

func (*View) GetStride

func (v *View) GetStride() int

func (*View) GetWidth

func (v *View) GetWidth() int

func (*View) Load

func (v *View) Load(path string) error

Load --

func (*View) LoadPixels

func (v *View) LoadPixels(img image.Image)

LoadImage loads a go Image object into the view

func (*View) Recreate

func (v *View) Recreate(w, h int, f Format)

Recreate --

func (*View) RecreateWithStride

func (v *View) RecreateWithStride(w, h, s int, f Format)

Recreate --

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL