Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
da86ef2e
Commit
da86ef2e
authored
Mar 02, 1993
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VFile: fix c0bits etc. after setformat; Vrec.py: use setformat; rm Makefile.
parent
ed12467e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
10 deletions
+27
-10
Demo/sgi/video/VFile.py
Demo/sgi/video/VFile.py
+20
-3
Demo/sgi/video/Vrec.py
Demo/sgi/video/Vrec.py
+7
-7
No files found.
Demo/sgi/video/VFile.py
View file @
da86ef2e
...
...
@@ -190,6 +190,7 @@ class VideoParams:
self
.
width
=
0
# width of frame
self
.
height
=
0
# height of frame
self
.
packfactor
=
1
,
1
# expansion using rectzoom
# Colormap info
self
.
c0bits
=
8
# bits in first color dimension
self
.
c1bits
=
0
# bits in second color dimension
self
.
c2bits
=
0
# bits in third color dimension
...
...
@@ -224,6 +225,22 @@ class VideoParams:
self
.
realwidth
=
self
.
width
/
self
.
xpf
self
.
realheight
=
self
.
height
/
self
.
ypf
# Set colormap info
def
setcmapinfo
(
self
):
stuff
=
0
,
0
,
0
,
0
,
0
if
self
.
format
in
(
'rgb8'
,
'grey'
):
stuff
=
8
,
0
,
0
,
0
,
0
if
self
.
format
==
'grey4'
:
stuff
=
4
,
0
,
0
,
0
,
0
if
self
.
format
==
'grey2'
:
stuff
=
2
,
0
,
0
,
0
,
0
if
self
.
format
==
'mono'
:
stuff
=
1
,
0
,
0
,
0
,
0
print
'setcmapinfo:'
,
stuff
self
.
c0bits
,
self
.
c1bits
,
self
.
c2bits
,
\
self
.
offset
,
self
.
chrompack
=
stuff
# Set the frame width and height (e.g. from gl.getsize())
def
setsize
(
self
,
width
,
height
):
...
...
@@ -242,9 +259,9 @@ class VideoParams:
def
setformat
(
self
,
format
):
if
self
.
frozen
:
raise
CallError
if
format
<>
self
.
format
:
self
.
format
=
format
self
.
setderived
()
self
.
format
=
format
self
.
setderived
()
self
.
setcmapinfo
()
# Get the format
...
...
Demo/sgi/video/Vrec.py
View file @
da86ef2e
...
...
@@ -255,17 +255,17 @@ def record(v, info, filename, audiofilename, mono, grey, greybits, \
if
filename
:
vout
=
VFile
.
VoutFile
().
init
(
filename
)
if
mono
:
vout
.
format
=
'mono'
format
=
'mono'
elif
grey
and
greybits
==
8
:
vout
.
format
=
'grey'
format
=
'grey'
elif
grey
:
vout
.
format
=
'grey'
+
`abs(greybits)`
format
=
'grey'
+
`abs(greybits)`
else
:
vout
.
format
=
'rgb8'
vout
.
width
=
x
vout
.
height
=
y
format
=
'rgb8'
vout
.
setformat
(
format
)
vout
.
setsize
(
x
,
y
)
if
fields
:
vout
.
packfactor
=
(
1
,
-
2
)
vout
.
setpf
(
1
,
-
2
)
)
vout
.
writeheader
()
if
preallocspace
:
print
'Preallocating space...'
...
...
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