Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidHash = errors.New("invalid hash")
)
Functions ¶
func DecodeImage ¶
DecodeImage returns the image associated with a binary hash using the default decoding configuration.
func DecodeImageWithCfg ¶
func DecodeImageWithCfg(hashData []byte, cfg DecodingCfg) (image.Image, error)
DecodeImageWithCfg returns the image associated with a binary hash.
func EncodeImage ¶
EncodeImage returns the binary hash of an image.
Types ¶
type DecodingCfg ¶
type DecodingCfg struct {
BaseSize int // the base image size (default: 32px)
SaturationBoost float64 // the factor applied to increase image saturation (default: 1.25)
}
DecodingCfg contains the parameters used for image decoding. Decoding will use default values for uninitialized members.
type Hash ¶
type Hash struct {
LDC float64
PDC float64
QDC float64
LScale float64
HasAlpha bool
Lx int
Ly int
LCount int
PScale float64
QScale float64
IsLandscape bool
ADC float64 // if HasAlpha
AScale float64 // if HasAlpha
LAC []float64
PAC []float64
QAC []float64
AAC []float64 // if HasAlpha
}
Hash represents the set of data stored in an image hash.
func (*Hash) Decode ¶
func (h *Hash) Decode(data []byte, cfg *DecodingCfg) error
Decode extract data from the binary representation of a hash.
Click to show internal directories.
Click to hide internal directories.