Skip to content

Commit 051669b

Browse files
committed
add: exr_enums을 추가하다*
- image data type - line order type - compression type
1 parent 94cdda1 commit 051669b

File tree

5 files changed

+61
-0
lines changed

5 files changed

+61
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# from .exr_enum_base import *
2+
from .exr_compression_type import *
3+
from .exr_image_data_type import *
4+
from .exr_line_order_type import *
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
"""
2+
ref : https://openexr.com/en/latest/OpenEXRFileLayout.html?highlight=xsampling#predefined-attribute-types
3+
"""
4+
from typing import Any
5+
from openexr_python.exr_enums.exr_enum_base import EXREnumBase
6+
7+
8+
class EXRCompressionType(EXREnumBase):
9+
Compression_NO = 0
10+
Compression_RLE = 1
11+
Compression_ZIPS = 2
12+
Compression_ZIP = 3
13+
Compression_PIZ = 4
14+
Compression_PXR24 = 5
15+
Compression_B44 = 6
16+
Compression_B44A = 7
17+
18+
@classmethod
19+
def parse_raw2pyobj(cls, raw_compression: Any):
20+
return EXRCompressionType(value=raw_compression.v)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from enum import Enum
2+
from typing import Any, Type
3+
from abc import *
4+
5+
6+
class EXREnumBase(Enum, metaclass=ABCMeta):
7+
pass
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"""
2+
ref : https://openexr.com/en/latest/OpenEXRFileLayout.html?highlight=xsampling#predefined-attribute-types
3+
"""
4+
from openexr_python.exr_enums.exr_enum_base import EXREnumBase
5+
from typing import Any
6+
7+
8+
class EXRImageDataType(EXREnumBase):
9+
UINT32 = 0
10+
FLOAT16 = 1
11+
FLOAT32 = 2
12+
13+
@classmethod
14+
def parse_raw2pyobj(cls, raw_channel_info: Any):
15+
return EXRImageDataType(value=raw_channel_info.type.v)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"""
2+
ref : https://openexr.com/en/latest/OpenEXRFileLayout.html?highlight=xsampling#predefined-attribute-types
3+
"""
4+
from openexr_python.exr_enums.exr_enum_base import EXREnumBase
5+
from typing import Any
6+
7+
8+
class EXRLineOrderType(EXREnumBase):
9+
Increasing_Y = 0
10+
Decreasing_Y = 1
11+
Random_Y = 2
12+
13+
@classmethod
14+
def parse_raw2pyobj(cls, raw_line_order: Any):
15+
return EXRLineOrderType(value=raw_line_order.v)

0 commit comments

Comments
 (0)