-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.pcd
159 lines (114 loc) · 6.08 KB
/
README.pcd
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
Copyright 1993-2001 David Clunie.
PCD patch for XV 3.10a Release Notes 2001/07/08.
See also the progress notes at the end of this file. Thanks to all those
contributors who have substantially improved this patch.
These patches allow xv to read Kodak photocd files and choose which of the
5 available resolutions one wants to view.
When a photocd file is loaded, a dialog box asks which resolution you
would like. The visual schnauzer builds thumbnails by reading the lowest
resolution image. The selected resolution can be selected from the
command line with the -pcd option:
[-pcd 0|1|2|3|4]
where:
0=192*128, base/16 resolution
1=384*256, base/4 resolution
2=768*512, base resolution
3=1536*1024, 4base resolution
4=3072*2048 16base resolution.
Note that the Pro format is not supported.
The command line option allows loops without the dialog box popping up, eg.:
xv -pcd 1 -wloop -wait 10 *.pcd
The code is pretty crude and was written quickly for a specific purpose and
has not really been cleaned up. It is poorly structured, full of debugging
codes and verbose comments, and there is very little attempt at optimizing
things. No profiling has been done.
There is not yet support for overview files, nor is there a facility to
use the higher resolution chroma planes from when viewing lower resolution
images.
It's only claim to fame is that it works and produces reasonable looking
images.
The outline of this is shamelessly derived from xvpbm.c to read the
file, and xvtiffwr.c to handle the popup window and X stuff (X never
has been my forte !), and the PhotoCD format information (though not
the code) was found in Hadmut Danisch's ([email protected]) hpcdtoppm
program in which he has reverse engineered the format by studying
hex dumps of PhotoCDs ! The color stuff and Huffman decding were
extensively revised by Matthew Francey.
Feel free to send me comments or improvements, or even better, more
information about the photo CD format ... hopefully someone who really
knows what they are doing will tidy it up or do a neater job.
david ([email protected])
---------
The trace #define in xvpcd.c is now in the right place, and the ansi
prototype for the magnify function has been fixed. Colin made me switch to
xvbcopy() which seems like a good idea for System V victims.
---------
Date: Wed, 22 Dec 1993 16:09:52 --1000
From: [email protected] (Colin Canfield )
I have done some more work using your patch I thought you might be intested in.
The major change was adding a size parameter to the LoadPCD; either -1 to mean
the popup or else the size you desired. This allows batch mode processing,
specifically xv -pcd <size> <filename>, and the visual schnauzer can work in
quick mode (ie. you don't have to select each image size when it is building
the icons)
I have added an xbm file for the file type but haven't drawn an icon for it,
this is in bitmaps/br_pcd.xbm. I will just send you the new files.
---------
From: [email protected] (Andrew Daviel)
Date: 16 Feb 1995 23:32:21 GMT
This is David Clunie's patch for xv-3.00 tuned a bit to work
on xv-3.10. The code's all the same except for replacing
"trace" with "fprintf" in xvpcd.c and adding an "unsigned" qualifier to
keep my compiler (gcc) happy. Oh yes, changed RFT_PCD to 20 as
John Bradley has now used 15 through 19.
---------
From: [email protected] (David A. Clunie)
Date: Thu Jun 15 14:43:46 GMT+0300 1995
Andrew's patch didn't include Colin's browser changes, so I redid the
xv-3.10 update from scratch ... it seems pretty much the same as
Andrew's changes. I also edited the Imakefile and Makefiles in order
to support the PCD changes, as well as make the install process a
little more flexible, with options to strip and set modes and so on.
Also made RFT_PCD 25 so as not to conflict with magpic patch from Japan
by Ikemoto Masahiro <[email protected]>, and used his
bitmap icon for pcd files.
Now there are two versions of the patch, one which should be applied
to the xv-3.10 distribution.
The other should be applied to xv-3.10 AFTER Ikemoto Masahiro's
Patch.magpic2.PhotoCD.XV319a, in order to add the browser features to
the latter, as well as fixing a Makefile typo (was xcpcd.c not xvpcd.c)
and including unistd.h for the SEEK_xxx constants in the magicpic
stuff.
---------
Subject: Re: photo-cd patch for xv
From: Matthew Francey <[email protected]>
Date: Mon, 26 Mar 2001 15:37:55 +0000
Attached is a revised version of xvpcd.c; the areas that I have
re-written or changed are in a different coding style so you can tell
what has changed. The GNU 'indent' program can be run against the file
to enforce a consistent style ..
Here is what I've done though:
a) huffman table reader re-written, because it would fail on some
photocd files with "unusual" huffman codes.
b) the huffman-coded corrections are now properly applied
c) the corrections can sometimes over or underflow; clipping has been
introduced and effectively fixes the problem, but I suspect that
there is something deeper going on.
d) the "official" YCC->sRGB transform is done. a "beyond 100% white"
mapping table was snarfed from ImageMagick. an option for using a
flat linear LUT was added -- this can make somewhat over-exposed images
look alot nicer.
e) there were strange problems where the code wouldn't be able to find
the huffman tables and data for the 16base image (the bit-buffering
code was starting mid-sector, instead of at a sector boundary). Looking
at a pcd file with a hex editor suggests to me that it is possible to
just skip directly to these huffman tables -- no special "+12" and such
constants necessary. But I haven't tried this yet.
The results: I've been able to read about 50 or 60 .pcd files [scattered
in age from 6 years old to scans done last week] with this code without
incident. Image quality at the high resolution is excellent. Even the
trivial amount of LUT control is useful when dealing with over-exposed
images.
If I get around to it: finer LUT control to take advantage of the
slightly extended dynamic range of PhotoCD scans, especially in regards to
dark or somewhat underexposed scenes.