HDRHeader   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 6
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __init__() 0 5 1
1
import math
2
import struct
3
import re
4
from operator import itemgetter
5
from ed2d import files
6
7
#Flags and constants
8
RGBE_VALID_PROGRAMTYPE = 0x01
9
RGBE_VALID_GAMMA = 0x02
10
RGBE_VALID_EXPOSURE = 0x04
11
12
RGBE_RETURN_SUCESS = 0
13
RGBE_RETURN_FAILURE = 1
14
15
RGBE_DATA_RED = 0
16
RGBE_DATA_GREEN = 1
17
RGBE_DATA_BLUE = 2
18
RGBE_DATA_SIZE = 3
19
20
class HDRHeader(object):
21
	def __init__(self):
22
		self.valid = None
23
		self.programType = None
24
		self.gamma = 1.0
25
		self.exposure = 1.0
26
27
def rgbe2float(rgbe):
28
	f = 0.0
29
	red = green = blue = 0.0
30
31
	if rgbe[3] is not None:
32
		f = math.ldexp(1.0, rgbe[3] - (128 + 8))
33
		red = rgbe[0] * f
34
		green = rgbe[1] * f
35
		blue = rgbe[2] * f
36
	else:
37
		red = green = blue = 0.0
38
39
	return red, green, blue
40
41
# Return header, width, height
42
def RGBE_ReadHeader(FILE):
43
	pass
44
45
# Return Data
46
def RGBE_ReadPixels(FILE, numpixels):
47
	pass
48
49
# Return Data
50
def RGBE_ReadPixels_RLE(FILE, scanline_width, num_scanlines):
51
	pass