Documentation
¶
Index ¶
- Constants
- Variables
- func FancyUpscale(yuv *image.YCbCr) *image.RGBA
- func FlattenPixels(pixels [][]float64, x int, y int) []float64
- func MultHi(v int32, coeff int32) int32
- func P_ImagingConvertRGB2YCbCr(r, g, b, a uint8) (y, cb, cr, al uint8)
- func P_ImagingConvertYCbCr2RGB(y, cb, cr, a uint8) (r, g, b, al uint8)
- func Resize(img image.Image, w, h int, gray *image.Gray) *image.Gray
- func ToGray(img image.Image, pix []uint8) *image.Gray
- func UpsampleRgbaLinePair(topY []uint8, bottomY []uint8, topU []uint8, topV []uint8, bottomU []uint8, ...)
- func VP8Clip8(v int32) uint8
- func VP8YUVToB(y uint8, u uint8) uint8
- func VP8YUVToG(y uint8, u uint8, v uint8) uint8
- func VP8YUVToR(y uint8, v uint8) uint8
- func VP8YuvToArgb(y uint8, u uint8, v uint8) (argb [4]uint8)
- func VP8YuvToBgr(y uint8, u uint8, v uint8) (bgr [3]uint8)
- func VP8YuvToBgra(y uint8, u uint8, v uint8) (bgra [4]uint8)
- func VP8YuvToRgb(y uint8, u uint8, v uint8) (rgb [3]uint8)
- func VP8YuvToRgb565(y uint8, u uint8, v uint8) (rgb [2]uint8)
- func VP8YuvToRgba(y uint8, u uint8, v uint8) (rgba [4]uint8)
- func VP8YuvToRgba4444(y uint8, u uint8, v uint8) (argb [2]uint8)
- type ExtImageHash
- type ImageHash
- func AverageHash(img image.Image) (*ImageHash, error)
- func DifferenceHash(img image.Image) (*ImageHash, error)
- func ImageHashFromString(s string) (*ImageHash, error)deprecated
- func LoadImageHash(b io.Reader) (*ImageHash, error)
- func NewImageHash(hash uint64, kind Kind) *ImageHash
- func PerceptionHash(img image.Image) (*ImageHash, error)
- type Kind
- type P_YCbCr
- type P_YCbCr_color
- type WebPUpsampleLinePairFunc
- type YCbCr
- type YCbCr_color
Constants ¶
const ( YUV_FIX = 16 // fixed-point precision for RGB->YUV YUV_HALF = 1 << (YUV_FIX - 1) YUV_FIX2 = 6 // fixed-point precision for YUV->RGB YUV_MASK2 = (256 << YUV_FIX2) - 1 )
const SCALE = 6
Variables ¶
var ( Y_R [256]int16 = [256]int16{}/* 256 elements not displayed */ Y_G [256]int16 = [256]int16{}/* 256 elements not displayed */ Y_B [256]int16 = [256]int16{}/* 256 elements not displayed */ Cb_R [256]int16 = [256]int16{}/* 256 elements not displayed */ Cb_G [256]int16 = [256]int16{}/* 256 elements not displayed */ Cb_B [256]int16 = [256]int16{}/* 256 elements not displayed */ Cr_R = Cb_B Cr_G [256]int16 = [256]int16{}/* 256 elements not displayed */ Cr_B [256]int16 = [256]int16{}/* 256 elements not displayed */ R_Cr [256]int16 = [256]int16{}/* 256 elements not displayed */ G_Cb [256]int16 = [256]int16{}/* 256 elements not displayed */ G_Cr [256]int16 = [256]int16{}/* 256 elements not displayed */ B_Cb [256]int16 = [256]int16{}/* 256 elements not displayed */ )
var P_YCbCrModel color.Model = color.ModelFunc(p_yCbCrModel)
YCbCrModel is the Model for Y'CbCr colors.
var YCbCrModel color.Model = color.ModelFunc(yCbCrModel)
YCbCrModel is the Model for Y'CbCr colors.
Functions ¶
func FlattenPixels ¶
FlattenPixels function flattens 2d array into 1d array.
func UpsampleRgbaLinePair ¶
Types ¶
type ExtImageHash ¶
type ExtImageHash struct {
// contains filtered or unexported fields
}
ExtImageHash is a struct of big hash computation.
func ExtImageHashFromString
deprecated
func ExtImageHashFromString(s string) (*ExtImageHash, error)
ExtImageHashFromString returns a big hash from a hex representation
Deprecated: Use goimagehash.LoadExtImageHash instead.
func ExtPerceptionHash ¶
func ExtPerceptionHash(img image.Image, hash_size, freq int) (*ExtImageHash, error)
ExtPerceptionHash function returns phash of which the size can be set larger than uint64 Some variable name refer to https://github.com/JohannesBuchner/imagehash/blob/master/imagehash/__init__.py Support 64bits phash (width=8, height=8) and 256bits phash (width=16, height=16) Important: width * height should be a power of 2
func LoadExtImageHash ¶
func LoadExtImageHash(b io.Reader) (*ExtImageHash, error)
LoadExtImageHash method loads a ExtImageHash from io.Reader.
func NewExtImageHash ¶
func NewExtImageHash(hash []uint64, kind Kind, bits int) *ExtImageHash
NewExtImageHash function creates a new big hash
func (*ExtImageHash) Distance ¶
func (h *ExtImageHash) Distance(other *ExtImageHash) (int, error)
Distance method returns a distance between two big hashes
func (*ExtImageHash) Dump ¶
func (h *ExtImageHash) Dump(w io.Writer) error
Dump method writes a binary serialization into w io.Writer.
func (*ExtImageHash) GetHash ¶
func (h *ExtImageHash) GetHash() []uint64
GetHash method returns a big hash value
func (*ExtImageHash) GetKind ¶
func (h *ExtImageHash) GetKind() Kind
GetKind method returns a kind of big hash
func (*ExtImageHash) String ¶
func (h *ExtImageHash) String() string
String returns a hex representation of big hash
type ImageHash ¶
type ImageHash struct {
// contains filtered or unexported fields
}
ImageHash is a struct of hash computation.
func AverageHash ¶
AverageHash function returns a hash computation of average hash. Implementation follows http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html
func DifferenceHash ¶
DifferenceHash function returns a hash computation of difference hash. Implementation follows http://www.hackerfactor.com/blog/?/archives/529-Kind-of-Like-That.html
func ImageHashFromString
deprecated
func LoadImageHash ¶
LoadImageHash method loads a ImageHash from io.Reader.
func NewImageHash ¶
NewImageHash function creates a new image hash.
func PerceptionHash ¶
PerceptionHash function returns a hash computation of phash. Implementation follows http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html
type Kind ¶
type Kind int
Kind describes the kinds of hash.
func (*Kind) MarshalJSON ¶
func (*Kind) UnmarshalJSON ¶
type P_YCbCr ¶
func (*P_YCbCr) ColorModel ¶
func (*P_YCbCr) YCbCrAt ¶
func (p *P_YCbCr) YCbCrAt(x, y int) P_YCbCr_color
type P_YCbCr_color ¶
type YCbCr ¶
func (*YCbCr) ColorModel ¶
func (*YCbCr) YCbCrAt ¶
func (p *YCbCr) YCbCrAt(x, y int) YCbCr_color