[net.micro.amiga] Some questions and a Digi-Review

kdd@well.UUCP (Keith David Doyle) (08/26/86)

References:



[.............]

Questions:
    Does anyone have any good ideas of how to get RAW: keyboard data from
THE cli window without having to open a second window?  I found I could open
the RAW: device for keyboard input so that I can check keystrokes as they
occur (and not echo), but a new window is involved.  If I am using this
method for input and normal 'printf's for output, everything works ok,
but it is confusing if you decide to switch to another window via mouse
click and then back again, as you have to click on the little RAW: window
which I have carefully shrunk to minimum size and moved out of the way
instead of the display window where the printf's are going.  I am trying
to produce a simple CLI utility (more) and find that there seems to be no
clean way to do it.  One version I've seen opens its own window for both 
input and output but then must remove the window when you do a 'q' to exit,
whereas I'd like to leave the last bit on the screen so I can peruse it
further.  Any ideas?  Basically, I'm trying to do the same as the UNIX
CBREAK.

Well, as far as Digi-View is concerned, I saw one at a local computer store
and decide to buy it.  I have to say I'm pretty satisfied, especially
considering the price.  I already had a very good B&W camera, so I was
halfway there anyway.  So, for the benifit of youse guys out there, here's
a review:

I found it works pretty well once you've got the lighting and focusing and
etc. all set up correctly.  While trying it in the store, there was not enough
light, and they just had a security type B&W camera with a fixed lens on a
lightweight tripod, that was clumsy to try to point and aim at the flat
artwork I brought for a test.  I have a zoom and a set of closeup lenses
which I found pretty indespensable while trying to do this kind of work.

It appears that the Digi-View actually digitizes to 7 bits, and will then
normalize (or whatever you call it) down to 4 bits which is very handy, as
it will try the best it can to fit the picture it gets to the shade range
you have to work with on the screen this way.  Otherwise, you might find
yourself having to ajust the heck out of the lighting or the video level
or whatever to try to get a full range of shades out of it.  There is a
reasonable set of 'controls' that allow you to adjust brightness, contrast,
sharpness, etc for b&w, and saturation, red, and blue for color.  As a 
previous poster mentioned, I saw no way the hi-res software would support
color if you did have >512k for it, maybe that is 1.1 which I guess I don't
have yet.  

There are also 2 adjustments in the 'calibration' section that adjusts 'width'
and 'sync'.  The use of width is pretty obvious, but there is no mention of
what to do with sync in the manual.  I found that in lo-res I sometimes 
noticed a slight distortion on the right hand side of the screen and found
that by adjusting the sync control it went away.  Still don't have any idea
of what it does though.

I am quite satisfied with the ability of the hi-res mode to effectively
capture an image, the lo-res mode is not bad, but a little grainer than
I thought it might be, at least for most images.  I guess without a
real-time grabber sitting next to it to compare with I can't tell, but for
$199.00 I'm not really complaining.

The software is fairly rudimentary though does do its job ok.  My main
complaints are really only user-friendliness issues.  In particular,
there is no way to save the 'sync' and 'width' parameters once you get
them setup right, so you have to keep ajusting them every time you enter
the program.  And, since the lo-res and hi-res programs are seperate, you
may do that fairly often while trying lo-res and hi-res captures of the same
image.  In addition, it would seem that the two programs were probably written
by different people, as the 'width' parameter works opposite on the two
programs.  On one, moving width up makes the picture wider, on the other
makes it narrower.

I found it a useful feature that you can save a rgb picture as the 3 planes
of 7 bit data, so you can later tweak the color controls and etc. to your
hearts content perhaps then saving the image with several different color
adjustments.

And one final note, there was no information on what the histograms are telling
me, they're there, but I guess I'll have to go find a book on image processing
or something to try to figure out if I can make any use of them.

Keith Doyle
ihnp4!ptsfa!well!kdd

phillip@cbmvax.cbm.UUCP (Phillip Lindsay) (08/29/86)

[ lines die and goto hell ]
 
> Questions:
>     Does anyone have any good ideas of how to get RAW: keyboard data from
> THE cli window without having to open a second window?

Under 1.2 you'll be able to switch a regular CON: window into  RAW: mode.
A new packet is supported for this purpose (SetRawMode=994) ... I hacked
Andy's earlier example of sending a ACTION_DISK_INFO packet to the console
handler:

(Here is the information from the release doc - program follows...)

2) A new packet action type SetRawMode (=994) is supported by the console
   device to switch it into raw mode and back again. The single
   argument is TRUE for raw mode (ie as if RAW: had been requested)
   and FALSE to turn it back to CON: style.
   Note that in addition to this an escape sequence may be sent
   by the user if required to turn on or off the automatic translation
   of LF to CR/LF. Normally RAW: does not enable this and CON: does,
   sending the packet SetRawMode does not affect the translation.
   The code is CSI 20h to enable translation and CSI 20l to disable.

......Cut Here
/*************************************************************************
 * (C) 1986 Commodore-Amiga
 * Example program to demonstrate finding the CON: window pointer
 * by Andy Finkel and Robert (Kodiak) Burns
 *
 * HACKED quickly by Phillip Lindsay to show off CON: Raw mode...
 *
 * Use it any way you like, as long as the copyright notice is left on.
 *
 ************************************************************************/
#include	"exec/types.h"
#include	"exec/ports.h"
#include	"exec/io.h"
#include	"exec/memory.h"
#include	"libraries/dos.h"
#include	"libraries/dosextens.h"
#include	"intuition/intuitionbase.h"
#include        <stdio.h>

#define ACTION_SCREEN_MODE 994L
#define DOSTRUE             -1L


extern struct Library *OpenLibrary();
struct IntuitionBase *IntuitionBase = 0;

struct MsgPort iorp = {
    {0, 0, NT_MSGPORT, 0, 0}, 0,
    -1,				/* initialize signal to -1 */
    0,
				/* start with empty list */
    {&iorp.mp_MsgList.lh_Tail, 0, &iorp.mp_MsgList.lh_Head, 0, 0}
};



cleanup(code)
{
 if (iorp.mp_SigBit != -1) 
    FreeSignal(iorp.mp_SigBit);

 CloseLibrary(IntuitionBase);
  
    exit(20);
}

main(argc, argv)
int argc;
char *argv[];
{
    struct MsgPort *con;
    struct StandardPacket *packet;
    UBYTE  a_char;

    if ((IntuitionBase = OpenLibrary("intuition.library", 0)) == 0)
	exit(20);


    /* set up the message port */
    if ((iorp.mp_SigBit = AllocSignal(-1)) < 0) {
	cleanup(0);
	exit(35);
    }
    iorp.mp_SigTask = (struct Task *) FindTask((char *) NULL);


    /* try to find console associated with calling process */
    /* if started from CLI, than is 			   */
    if ((iorp.mp_SigTask->tc_Node.ln_Type == NT_PROCESS)&&(argc != 0)) {
	con = (struct MsgPort *) 
	    ((struct Process *) iorp.mp_SigTask) -> pr_ConsoleTask;
	if (con != 0) {
	    if ((packet = (struct StandardPacket *)
		    AllocMem(sizeof(*packet), MEMF_CLEAR))) {
		    /* this is the console handlers packet port */
		    packet->sp_Msg.mn_Node.ln_Name = &(packet->sp_Pkt);
		    packet->sp_Pkt.dp_Link = &(packet->sp_Msg);
		    packet->sp_Pkt.dp_Port = &iorp;
		    packet->sp_Pkt.dp_Type = ACTION_SCREEN_MODE;
		    packet->sp_Pkt.dp_Arg1 = DOSTRUE;
		    PutMsg(con, packet);
		    WaitPort(&iorp);
                    GetMsg(&iorp); /* pull message */
                    puts("In RAW: mode...type something...press ESC to exit.");
                    while((a_char=getchar())!=0x1b) putchar(a_char);
		    packet->sp_Pkt.dp_Arg1 = FALSE;
		    packet->sp_Pkt.dp_Port = &iorp;
		    PutMsg(con, packet);
		    WaitPort(&iorp);                    
		    FreeMem(packet, sizeof(*packet));
	    }
	}
    }
    cleanup(0);
}

/* eof  */
-- 
==============================================================================
  Phillip Lindsay - Commodore Business Machines - Amiga Technical Support
    uucp: {ihnp4|seismo|caip}!cbmvax!phillip
    arpa: cbmvax!phillip@seismo -or- phillip@cbmvax.UUCP@{seismo | harvard}
    Tel.: (215) 431-9180
==============================================================================