This repository was archived by the owner on Nov 12, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathuse_c.py
More file actions
69 lines (46 loc) · 1.46 KB
/
use_c.py
File metadata and controls
69 lines (46 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#gcc -fPIC -shared -o
from src.src_py.graphics_rendering import color_line,surf_to_1d
from src.src_py.grop import gamma_correction,invert_rgb,blending_mul
from pygame import surfarray,image
from time import perf_counter
from src.src_py.data_management import DM
from src.src_py.kernel.opt_surfarray import Surfarray
a = Surfarray((15,15))
b = Surfarray((16,16))
x, y = -5, 5
w, h = 10,10
"""
Pseudo code:
if x < 0
x = x+w
w = w+abs(x)
"""
import cv2 as ocv
# Test Envoirment
A = Surfarray().load_from_file('data\\img\\stone.png')
B = Surfarray().load_from_file('data\\img\\stone_with_window.png')
# 1. fill without args [COMP FILL]
#!A.fill((255,255,255,255))
#A.fill((255,255,255))
#A.array
#A.blit(B,(0,0))
#A.blit(B,(-64,-64))
#A.blit(B,(64,64))
#A.blit(B,(-16,16))
#A.blit(B,(16,-16))
A.array
# NO UINT8 --> UINT64 CONVERSION IN THIS PART
#A.resize((64,64))
#180 87 2 83
C = A.resize((256,256))
image.save(C.get_surface(),'test.png')
D = C.subarray((180,87,8,83))
image.save(D.get_surface(),'test1.png')
E = C.subarray((0,0,8,256))
image.save(E.get_surface(),'test2.png')
pass
#b.fill([255,255,255],(32,32,32,32))
#print(b.get_array())
#image.save(surfarray.make_surface(c.get_array()),'test.png',)
#img = surfarray.array3d(image.load("data\\img\\stone.png")).reshape((32*32*3)).tolist()
#image.save(blending_mul(image.load("data\\img\\stone.png"),image.load("data\\img\\stone_with_window.png")),'test.png') # surfarray.make_surface(color_correction(img,0.7,32,32))