Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
7961ea78
Kaydet (Commit)
7961ea78
authored
Şub 17, 1993
tarafından
Jack Jansen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Moved line-size stuff to single routine
üst
eeec33f8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
11 deletions
+15
-11
LiveVideoIn.py
Demo/sgi/video/LiveVideoIn.py
+15
-11
No files found.
Demo/sgi/video/LiveVideoIn.py
Dosyayı görüntüle @
7961ea78
...
@@ -54,7 +54,7 @@ class LiveVideoIn:
...
@@ -54,7 +54,7 @@ class LiveVideoIn:
# Initialize capture
# Initialize capture
(
mode
,
self
.
realwidth
,
self
.
realheight
,
qsize
,
rate
)
=
\
(
mode
,
self
.
realwidth
,
self
.
realheight
,
qsize
,
rate
)
=
\
v
.
InitContinuousCapture
(
SV
.
RGB8_FRAMES
,
\
v
.
InitContinuousCapture
(
SV
.
RGB8_FRAMES
,
\
self
.
realwidth
,
self
.
realheight
,
1
,
5
)
self
.
realwidth
,
self
.
realheight
,
1
,
2
)
self
.
width
=
vw
self
.
width
=
vw
self
.
height
=
vh
self
.
height
=
vh
self
.
x0
=
(
self
.
realwidth
-
self
.
width
)
/
2
self
.
x0
=
(
self
.
realwidth
-
self
.
width
)
/
2
...
@@ -62,8 +62,8 @@ class LiveVideoIn:
...
@@ -62,8 +62,8 @@ class LiveVideoIn:
self
.
y0
=
(
self
.
realheight
-
self
.
height
)
/
2
self
.
y0
=
(
self
.
realheight
-
self
.
height
)
/
2
self
.
y1
=
self
.
y0
+
self
.
height
-
1
self
.
y1
=
self
.
y0
+
self
.
height
-
1
# Compute # full lines per packet
# Compute # full lines per packet
self
.
lpp
=
pktmax
/
self
.
width
self
.
lpp
=
pktmax
/
self
.
linewidth
()
self
.
pktsize
=
self
.
lpp
*
self
.
width
self
.
pktsize
=
self
.
lpp
*
self
.
linewidth
()
self
.
data
=
None
self
.
data
=
None
self
.
dataoffset
=
0
self
.
dataoffset
=
0
self
.
lpos
=
0
self
.
lpos
=
0
...
@@ -86,6 +86,17 @@ class LiveVideoIn:
...
@@ -86,6 +86,17 @@ class LiveVideoIn:
def
close
(
self
):
def
close
(
self
):
v
.
EndContinuousCapture
()
v
.
EndContinuousCapture
()
# Get the length in bytes of a video line
def
linewidth
(
self
):
if
self
.
type
==
'mono'
:
return
(
self
.
width
+
7
)
/
8
elif
self
.
type
==
'grey2'
:
return
(
self
.
width
+
3
)
/
4
elif
self
.
type
==
'grey4'
:
return
(
self
.
width
+
1
)
/
2
else
:
return
self
.
width
# Get the next video packet.
# Get the next video packet.
# This returns (lpos, data) where:
# This returns (lpos, data) where:
# - lpos is the line position
# - lpos is the line position
...
@@ -125,12 +136,5 @@ class LiveVideoIn:
...
@@ -125,12 +136,5 @@ class LiveVideoIn:
data
=
self
.
data
[
self
.
dataoffset
:
self
.
dataoffset
+
self
.
pktsize
]
data
=
self
.
data
[
self
.
dataoffset
:
self
.
dataoffset
+
self
.
pktsize
]
lpos
=
self
.
lpos
lpos
=
self
.
lpos
self
.
dataoffset
=
self
.
dataoffset
+
self
.
pktsize
self
.
dataoffset
=
self
.
dataoffset
+
self
.
pktsize
if
self
.
type
==
'mono'
:
self
.
lpos
=
self
.
lpos
+
self
.
lpp
self
.
lpos
=
self
.
lpos
+
self
.
lpp
*
8
elif
self
.
type
==
'grey2'
:
self
.
lpos
=
self
.
lpos
+
self
.
lpp
*
4
elif
self
.
type
==
'grey4'
:
self
.
lpos
=
self
.
lpos
+
self
.
lpp
*
2
else
:
self
.
lpos
=
self
.
lpos
+
self
.
lpp
return
lpos
,
data
return
lpos
,
data
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment