Hello,
I'm using LispWorks Personal Edition, and the CAPI/GP packages for
manipulating images. There was a very useful posting by Wade Humeniuk
<············@news3.cadvision.com> a little while ago on how to go
about loading and converting images. I have gotten quite far after
reading that.
But I need to accomplish something which is probably quite simple: I
would like to see the actual data of a 'gp:image' instance. I know it
is an abstract class, but I have an image created by
'gp:convert-external-image', and I would like to be able to manipulate
the data of this instance directly.
I try to inspect the instance I have (and also try to understand the
class by using the class browser of LW), but I only see the slot:
'GRAPHICS-PORTS::REPRESENTATION 46138223' which I suspect is a
reference to the data representation. The other slots are
'GRAPHICS-PORTS::HEIGHT', 'GRAPHICS-PORTS::WIDTH',
'GRAPHICS-PORTS:EXTERNAL-IMAGE' (which has value nil) and
'GRAPHICS-PORTS::COLOR-USERS'.
COLOR-USERS is set to something which seems to be a Motif pane, WIDTH
and HEIGHT are correctly set. The image displays nicely with
'gp:draw-image'.
I'd like to go one level deeper, to look more closely at
'GRAPHICS-PORTS::REPRESENTATION'. But how?
I have not looked much at CLOS yet, I expect to soon, but if I could
get a quick pointer now that would be great. As the Subject line says,
I'm still a newbie at CL.
--
Robert Folland
······@circinus.no
"Robert Folland" <······@circinus.no> wrote in message
···················@dagros.circinus.no...
> I try to inspect the instance I have (and also try to understand the
> class by using the class browser of LW), but I only see the slot:
> 'GRAPHICS-PORTS::REPRESENTATION 46138223' which I suspect is a
> reference to the data representation. The other slots are
> 'GRAPHICS-PORTS::HEIGHT', 'GRAPHICS-PORTS::WIDTH',
> 'GRAPHICS-PORTS:EXTERNAL-IMAGE' (which has value nil) and
> 'GRAPHICS-PORTS::COLOR-USERS'.
>
> COLOR-USERS is set to something which seems to be a Motif pane, WIDTH
> and HEIGHT are correctly set. The image displays nicely with
> 'gp:draw-image'.
>
> I'd like to go one level deeper, to look more closely at
> 'GRAPHICS-PORTS::REPRESENTATION'. But how?
>
> I have not looked much at CLOS yet, I expect to soon, but if I could
> get a quick pointer now that would be great. As the Subject line says,
> I'm still a newbie at CL.
I assume you are using the Linux or Unix version of LispWorks. I have the
Windows version. In the Windows version the gp:representation has a
gp:dib-info and a pointer to the DIB bits. In your version the number
46138223 might be a pointer or handle to a X compatible image (maybe an X
pixmap) type. I do not know how X works, maybe someone could comment.
GP:REPRESENTATION may be a foreign allocated object or X resource handle.
If it is it is outside of the LW inspection capabilities.
Wade
From: Jochen Schmidt
Subject: Re: Newbie: Would like to see details of object slots
Date:
Message-ID: <3C48CD5B.4070008@dataheaven.de>
Robert Folland wrote:
> Hello,
>
> I'm using LispWorks Personal Edition, and the CAPI/GP packages for
> manipulating images. There was a very useful posting by Wade Humeniuk
> <············@news3.cadvision.com> a little while ago on how to go
> about loading and converting images. I have gotten quite far after
> reading that.
>
> But I need to accomplish something which is probably quite simple: I
> would like to see the actual data of a 'gp:image' instance. I know it
> is an abstract class, but I have an image created by
> 'gp:convert-external-image', and I would like to be able to manipulate
> the data of this instance directly.
>
> I try to inspect the instance I have (and also try to understand the
> class by using the class browser of LW), but I only see the slot:
> 'GRAPHICS-PORTS::REPRESENTATION 46138223' which I suspect is a
> reference to the data representation. The other slots are
> 'GRAPHICS-PORTS::HEIGHT', 'GRAPHICS-PORTS::WIDTH',
> 'GRAPHICS-PORTS:EXTERNAL-IMAGE' (which has value nil) and
> 'GRAPHICS-PORTS::COLOR-USERS'.
>
> COLOR-USERS is set to something which seems to be a Motif pane, WIDTH
> and HEIGHT are correctly set. The image displays nicely with
> 'gp:draw-image'.
>
> I'd like to go one level deeper, to look more closely at
> 'GRAPHICS-PORTS::REPRESENTATION'. But how?
>
> I have not looked much at CLOS yet, I expect to soon, but if I could
> get a quick pointer now that would be great. As the Subject line says,
> I'm still a newbie at CL.
I think this representation is a foreign object representing the image
in a form that depends on the target platform (Windows, X11)
The way it is represented means that it is an opaque object from the
lisp side.
In the examples/capi/graphics/ directory of my LW-4.2 installation I
found a file named "image-access.lisp" which shows how to use an
abstracted low-level interface to the image-data. This facility is not
described in the manuals but this example shows pretty well what you can
do with it.
If you do not have LW-4.2 you can download it from the Xanalys
FTP-Server (ftp://ftp.xanalys.com)
ciao,
Jochen