# tag; required; values
#
# works as whitelist
# * tag: any tag number in TIFF
# * required: mandatory | optional | depends( $tag.$value ) 
# * values: range($start, $end) | logical_or( $a, …) | only($a) |any

# This defines a sample config for baseline tiffs
# Remember, because it works as whitelist for each required tag we need an
# entry here

# Required Baseline Tags
# 254   00fe    NewSubfileType  A general indication of the kind of data contained in this subfile.
### could be part of baseline TIFF, but value could only be 0, because whether
### another image is contained (bit 0), nor is it a multipage TIFF (bit 2), nor
### it is a transparency mask (bit 3), because baseline does not allow multiple
### IFDs
254; optional; logical_or(0, 2)

# 256	0100	ImageWidth	The number of columns in the image, i.e., the number of pixels per row.
256; mandatory; any

# 257	0101	ImageLength	The number of rows of pixels in the image.
257; mandatory; any

# 258	0102	BitsPerSample	Number of bits per component.
### black/white
### grayscale
258; depends(262.0); logical_or(1,4,8)
258; depends(262.1); logical_or(1,4,8)
### colormap
258; depends(320.any); logical_or(4,8)
### RGB
258; depends(262.2); logical_or(ntupel(8,8,8),ntupel(16,16,16))

# 259	0103	Compression	Compression scheme used on the image data 
### (1 means no compression, 2 CCIT Group 3, 32773 PackBits)
### black/white (BitsPerSample is optional for b/w)
259; depends(262.0); logical_or(1,2,32773)
259; depends(262.1); logical_or(1,2,32773)
### grayscale (BitsPerSample must exist)
259; depends(258.4); logical_or(1,32773)
259; depends(258.8); logical_or(1,32773)
### colormap
259; depends(262.3); logical_or(1,32773)
### RGB
259; depends(262.2); logical_or(1,32773)


# 262	0106	PhotometricInterpretation	The color space of the image data.
### 2 means RGB, 0 and 1 means bilevel or grayscale, 0 is unusual, 3 colormap
262; mandatory; logical_or(0,1,2)
# TODO: needs checks in code
262; depends(320.any); only(3)

# 273	0111	StripOffsets	For each strip, the byte offset of that strip.
273; mandatory; any

# 274   0112    Orientation     The orientation of the image with respect to the rows and columns
274; optional; only(1)

# 277	0115	SamplesPerPixel	The number of components per pixel.
### if RGB then 3 else 1
277; depends(262.2); only(3)
277; depends(262.3); only(1)
277; depends(262.1); only(1)
277; depends(262.0); only(1)

# 278	0116	RowsPerStrip	The number of rows per strip.
278; mandatory; any

# 279	0117	StripByteCounts	For each strip, the number of bytes in the strip after compression.
279; mandatory; any

# 282	011A	XResolution	The number of pixels per ResolutionUnit in the ImageWidth direction.
282; mandatory; any

# 283	011B	YResolution	The number of pixels per ResolutionUnit in the ImageLength direction.
283; mandatory; any

# 284   011C    PlanarConfiguration     If 2 then Bitplanes used, if 1 chunks used, only for RGB relevant
### for baseline only value 1 allowed and only if SamplesPerPixel = 3
### for samplesperpixel == 1, the value is irrelevant
284; optdepends(277.3); only(1)
284; optdepends(277.1); range(1,2)


# 296	0128	ResolutionUnit	The unit of measurement for XResolution and YResolution.
### (2 means inch)
296; optional; logical_or(1,2,3)

# 320 ColorMap, only for paletted
320; optional; any

