[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference hydra::amiga_v1

Title:AMIGA NOTES
Notice:Join us in the *NEW* conference - HYDRA::AMIGA_V2
Moderator:HYDRA::MOORE
Created:Sat Apr 26 1986
Last Modified:Wed Feb 05 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:5378
Total number of notes:38326

3684.0. "DDIF to IFF -- test of concept" by SKINUT::FOWLER () Tue Apr 17 1990 21:03

I've seen a few requests in this notes file for DDIF to IFF conversions.  I've
not seen replies that indicate anyone has done this, so I made an attempt at
it.

The first problem was in writting the IFF file.  I found the public domain
IFF reader/writer code from Electronic Arts on one of the Fish disk and toyed
with it until it works under VMS, at least buffered mode, anyway.

The second problem was getting the image data and color table info to write
into the file.  For this I used the DECimage Application Services software.  I
import the DDIF file into an image frame, dither it to the proper depth, render
it for display on a workstation screen and put the image onto the screen via
xputimage, or copyarea or copyplane.  I can then build an ILBM from the image
data and grab the color info out of the workstation colormap via xquerycolor.

You must have the DECimage Application Services software installed on your
system for this to work.  There are no .OLB files, just shareable images to
link against.  The netkit for DAS can be found at VISUAL::IMAGE$FT:IMG020.%

The routines (source and 1 .exe) can be found at SKINUT::DUA1:[PUBLIC]*.*

To run DDIF_TO_IFF, define it as a foreign command and invoke it supplying an
input and output file name.
                             $ XXX:==$[MYDIR]DDIF_TO_IFF
			     $ XXX infile.ddif outfile.iff

Right now, DDIF_TO_IFF works for multispectral or bitonal images.  Grayscale
wouldn't be hard to add.

The resulting IFF file is a stream_lf file that can be transferred to an Amiga
via xmodem or Kermit if you convert it to fixed length records via CVTARC
(records are often too long for Kermit to handle). The IFF writer code tacks a
long word -1 onto the end of the file so xmodem doesn't chop it.

You must be on a color workstation to convert a multispectral image.  You'll
get the best results on an 8 plane system, although 4 should work.

I'm not a C coder by trade, so please excuse any atrocities I committed against
the language.

Gary

T.RTitleUserPersonal
Name
DateLines
3684.1DAS installed?NAVIER::MELLITZWed Apr 18 1990 11:577
    Sounds great!
    
    I'll have to try this soon. But.. How do I know if I already have
    DAS installed on my system?
    
    Thanks,
    Rich
3684.2NAVIER::MELLITZWed Apr 18 1990 12:033
    Looks like SkiNut::[public] is protected.
    
    ...r
3684.3Any interersting DDIF files around ?CSHTRX::ALVAREZPlaying with DECwindowsWed Apr 18 1990 13:524
	I have the same question a reply .1, plus I was wondering if there is
a directory of interesting DDIF files somewhere in the E-net.

	Miguel A. Alvarez
3684.4sharable images neededSKINUT::FOWLERWed Apr 18 1990 14:587
    
    re .1 and .2
    The shareabler images you need are:
       SYS$SHARE:IMG$SHRLIB.EXE  ( DAS )
       SYS$SHARE:CDA$ACCESS.EXE  (comes with DECwindows??)
    
    The directory is SKINUT::DUA1:[PUBLIC]  (no logical names here)
3684.5First TryNAVIER::MELLITZWed Apr 18 1990 16:5824
    I tried DDIF_TO_IFF.EXE on a scanned image that was saved as DDIF.
    I get the following message:
    ---------------------------------------------------
    Source Image: 232 pixels wide by 236 pixels high
    IBLM depth is 1
    Number of colors used = 2
    ---------------------------------------------------
    The then the image appears in a window with the name of the DDIF
    file. 
    In another window I was doing a "show proc/cont/id=.."
       The state went to mostly compute while the screen was being
       displayed then went to a LEF state.
    If I control Z out. I notice an IFF file was created that was double
    the size of the the DDIF file. 
    
    Is this file likely to be OK?
    
    Do I have to relink on my system? I've got all the sharable librarys
    that were discussed.
    
    Thanks
    Rich
    
    
3684.6Please, don't copy those executables...IDONT::MIDDLETONJohnWed Apr 18 1990 19:2519
We of the CDA group would prefer that you *not* copy the executable images
previously mentioned in order to get CDA Base Services and DECimage Application
Services support onto your systems.  These executable images are installed as
part of VMS V5.3 or later and that is how you should get them.  If you get them
through any means other than normal installation and then have problems, we
will not be able to help you.

Also, to get full CDA support (CDA converters and CDA viewers) you will need
to install DECwindows.

Finally, there are many samples DDIF files in

			DDIF::CDA$SAMPLES:



							John Middleton
							CDA Converter Library PL
3684.7NAVIER::MELLITZWed Apr 18 1990 20:027
    In regard to re.-1 and re.-2:
    
    I'm running VMS 5.3 with DECWindows installed. IE the CDA Base Services
    and DECimage are already installed. I only copied the DDIF_to_IFF.EXE
    
    ...r 
    
3684.8Looks OK to meSKINUT::FOWLERWed Apr 18 1990 20:0841
re .5

I'm not sure what you're questioning here, so I'll stab at everything.  Short
response is "everything looks normal to me".

The window's title bar should contain the name of the DDIF file.

The IFF file is written out before the image is displayed in the window. After
displaying the image in the window, DDIF_TO_IFF waits for a carriage return to
be typed from the keyboard.  Note that I don't handle expose events, wasn't
intended to be a viewer.  So if the window gets covered up, it won't repaint.

The conversion process is compute intensive.  Bitonal images will convert
fastest.  Most of the processing here is switching the bit order in all the
bytes.  Color images can take several to "take a coffee break" minutes to
convert.  There's alot of processing involved in dithering the image down to
four or five bits deep.  After that, the bits in the bytes have to be arranged
into the interleaved bitmap format.

File sizes are hard to compare.  A bitonal image in a DDIF file is usually
compressed, but not always.  If it is compressed, it can be compressed in one
of 2 or 3 ways, with the tradeoff being final size of the image .vs. the amount
of time to compress it.  The IFF file will be compressed using the byte-run
scheme implemented by the reader/writer code from EA.

I will put a program called IFFCHECK in the directory.  Run in by defining it
as a foreign command and supplying it with the name of an IFF file.
         $ XXX:==$[MYDIR]IFFCHECK
         $ XXX file.iff

This is a VMS version of the public domain program to check the integrity
of an IFF file.  It uses the IFF reader code from EA.  It hasn't been
completely ported yet, the headings are printed backwards for example, but
the final good/bad status message is clear.  The IFF file must be a stream
file, such as written by DDIF_TO_IFF.  The reader uses fseeks to move around
in the file (fseeks to record boundaries only with record files)

Gary



3684.9Shareable image confusionSKINUT::FOWLERWed Apr 18 1990 21:0813
re .6

I spoke with John Middleton to clear up the confusion about the shareable
images.  CDA$ACESS and IMG$SHRLIB come with VMS V5.3. I was under the
impression that IMG$SHRLIB was part of the DAS installation kit (it used to
be), but is now part of the VMS kit.

I assured John I was not suggesting or implying that you copy these shareable
images from anywhere or get them via any means other than standard installation
procedures.  They are NOT in the public directory on SKINUT.

Gary

3684.10NAVIER::MELLITZFri Apr 20 1990 03:588
    It works! The only thing that though me was that I needed to hit a
    <CR> after the image was displayed as it looked to me that the program
    was hung. But it so far it's work on everything I've done.
    
    
    Thanks for the effort,
    
    Rich
3684.11anyone got this ?NOTIBM::MCGHIEThank Heaven for small Murphys !Sat Dec 08 1990 06:497
    Anyone still got this utility ? I tried a directory of
    SKINUT::DUA1:[PUBLIC] and got invalid login information.
    
    Thanks
    	Mike
    
    p.s. looked on TAPE.