You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
692 B
25 lines
692 B
package com.sothr.imagetools.hash
|
|
|
|
import grizzled.slf4j.Logging
|
|
|
|
class ImageHash(val ahash: Long,
|
|
val dhash: Long,
|
|
val phash: Long,
|
|
val fileHash: String) extends Serializable with Logging {
|
|
|
|
def cloneHashes: ImageHash = {
|
|
new ImageHash(ahash, dhash, phash, fileHash)
|
|
}
|
|
|
|
override def hashCode(): Int = {
|
|
var result = 365
|
|
result = 41 * result + (this.ahash ^ (this.ahash >>> 32)).toInt
|
|
result = 37 * result + (this.dhash ^ (this.dhash >>> 32)).toInt
|
|
result = 2 * result + (this.phash ^ (this.phash >>> 32)).toInt
|
|
result
|
|
}
|
|
|
|
override def toString: String = {
|
|
s"fileHash: $fileHash ahash: $ahash dhash: $dhash phash: $phash"
|
|
}
|
|
}
|