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
bac45723
Kaydet (Commit)
bac45723
authored
Kas 04, 1991
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed to understand new file format; and cosmetics.
üst
5d731fc8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
5 deletions
+21
-5
v2i.c
Demo/sgi/video/v2i.c
+21
-5
No files found.
Demo/sgi/video/v2i.c
Dosyayı görüntüle @
bac45723
/* Convert the first image of a CMIF video movie file to SGI .rgb format.
usage: v2i videofile imagefile [planemask]
link with -limage
*/
#include <stdio.h>
#include <gl/image.h>
long
bm
[
1280
];
short
rb
[
1280
],
gb
[
1280
],
bb
[
1280
];
long
h
,
w
;
long
w
,
h
,
pf
;
#define R(comp) ((comp) & 0xff)
#define G(comp) (((comp)>>8) & 0xff)
...
...
@@ -20,7 +25,7 @@ main(argc, argv)
if
(
argc
!=
3
&&
argc
!=
4
)
{
fprintf
(
stderr
,
"Usage: v2i videofile imgfile [planemask]
\n
"
);
exit
(
1
);
exit
(
2
);
}
if
(
argc
==
4
)
pmask
=
atoi
(
argv
[
3
]);
...
...
@@ -30,12 +35,23 @@ main(argc, argv)
perror
(
argv
[
1
]);
exit
(
1
);
}
gets
(
lbuf
);
if
(
sscanf
(
lbuf
,
"(%d,%d)"
,
&
w
,
&
h
)
!=
2
)
{
if
(
fgets
(
lbuf
,
sizeof
lbuf
,
stdin
)
==
NULL
)
{
fprintf
(
stderr
,
"Immediate EOF
\n
"
);
exit
(
1
);
}
if
(
strncmp
(
lbuf
,
"CMIF"
,
4
)
==
0
)
{
/* Skip optional header line */
if
(
fgets
(
lbuf
,
sizeof
lbuf
,
stdin
)
==
NULL
)
{
fprintf
(
stderr
,
"Immediate EOF after header
\n
"
);
exit
(
1
);
}
}
pf
=
2
;
/* Default */
if
(
sscanf
(
lbuf
,
"(%d,%d,%d)"
,
&
w
,
&
h
,
&
pf
)
<
2
)
{
fprintf
(
stderr
,
"%s: bad size spec: %s
\n
"
,
argv
[
0
],
lbuf
);
exit
(
1
);
}
gets
(
lbuf
);
/* Skip time info */
fgets
(
lbuf
,
sizeof
lbuf
,
stdin
);
/* Skip time info */
if
(
w
>
1280
)
{
fprintf
(
stderr
,
"%s: Sorry, too wide
\n
"
,
argv
[
0
]);
exit
(
1
);
...
...
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