#
#
#
class JpgFingerprint:

	def __init__(self):
		self.markers_a = []
		self.markers_img = []
		self.markers_meta = []
		self.markers_h = {}
		

	def addImgMetadata(self, mhex, mpos, mlen, mstr):
		marker = JpgMarker(mhex, mpos, mlen, mstr)
		self.markers_a.append(marker)
		self.markers_meta.append(marker)


	def addImgData(self, mhex, mpos, mlen, mstr):
		marker = JpgMarker(mhex, mpos, mlen, mstr)
		self.markers_a.append(marker)
		self.markers_img.append(marker)

	def printImgMarkers(self):
		pass


	def printMDMarkers(self):
		pass

  #
	def __repr__(self):
		str = ""
		total = 0
		for marker in self.markers_a:
			str += repr(marker) + "\n"
			total += marker.marker_size
		str += "[TOT ] bytes=={}".format(total)
		str += "\n"
		return str


#
class JpgMarker:
	"""
	Marker Data Type
	"""
	def __init__(self, mhex, fpos, mlen, mstr):
		self.marker_hex = mhex
		self.marker_hexstr  = self.marker_hex.to_bytes(2, 'big').hex()
		self.marker_filepos = fpos
		self.marker_size    = mlen
		self.marker_cat     = mstr


	def __repr__(self):
		return "[{}] {} {}-len {}-fpos".format(self.marker_cat, self.marker_hexstr, self.marker_size, self.marker_filepos)



