List Info

Thread: CLX xy-pixmap




CLX xy-pixmap
user name
2006-08-01 16:40:37
Hello, I try to use the CLX library but I don't know how to
view these
pixmaps I get via GET-IMAGE.

Here is an example:

,----
| (require 'clx)
| (in-package lib)
| 
| (defun test ()
|   (let* ((d (open-display "127.0.0.1" :display
+display+))
|          (s (car (display-roots d)))
|          (w (screen-root s)))
|     (get-image w
|                 0 :y
0
|                :width (drawable-width w)
|                :height (drawable-height w)
|                :format y-pix
map)
|                                         ;t
|     ))
| 
| (write-bitmap-file "/tmp/test.xpm" (test))
`----

That test.xpm file is unreadable for Gimp etc.  How can I
view that
file?

Looks like this:

,----
| #define image_width 1024
| #define image_height 768
| #define image_blue_mask 31
| #define image_green_mask 2016
| #define image_red_mask 63488
| static char image_bits[] = {
| 
0x2b,0x00,0x00,0x00,0x2b,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
0x14,0x33,0x3b,
| 
0x40,0xf8,0xf7,0xfe,0xbf,0x94,0xf7,0xfe,0xbf,0x9c,0x51,0xff,
0xbf,0x00,0x00,
| 
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,
| 
0x00,0x00,0x00,0xaa,0xb3,0x6a,0x08,0x23,0x00,0x00,0x00,0x13,
0x32,0x00,0x00,
|..........
`----

thanks

-- 
...sutongi tti olleh



CLX xy-pixmap -> netpbm?
user name
2006-08-01 19:34:25
You wrote:
 ign> From: ignotushixsplit.hu
 ign> Date: Tue, 01 Aug 2006 18:40:37 +0200
 ign> X-list: cmucl-help
 ign> Hello, I try to use the CLX library but I don't
know how to view these
 ign> pixmaps I get via GET-IMAGE.
 ign> That test.xpm file is unreadable for Gimp etc.  How
can I view that file?

The netpbm suite of converters is handy for this kind of
stuff.

http://netpbm.sourcefor
ge.net

  Netpbm is a toolkit for manipulation of graphic images,
including
  conversion of images between a variety of different
formats.  There
  are over 220 separate tools in the package including
converters for
  more than 80 graphics formats.

These suite members might be of use:

  http:
//netpbm.sourceforge.net/doc/xpmtoppm.html

  http:
//netpbm.sourceforge.net/doc/ppmtogif.html

As in

  xpmtoppm test.xpm | ppmtogif > test.gif

(note I just made this up, actual results depends on your
shell
 and my faulty memory of pipes 'n stuff).

Good luck,
-f
 


CLX xy-pixmap -> netpbm?
user name
2006-08-01 22:11:34
>>>>> Regarding 'Re: CLX xy-pixmap ->
netpbm?'; fred lakin adds:

  ign> Hello, I try to use the CLX library but I don't
know how to view
  ign> these pixmaps I get via GET-IMAGE.  That test.xpm
file is
  ign> unreadable for Gimp etc.  How can I view that
file?

  > The netpbm suite of converters is handy for this kind
of stuff.
  > http://netpbm.sourcefor
ge.net

Thanks, but the problem is that none of these tools
recognise the output
of XLIB:WRITE-BITMAP-FILE as a valid XPM.

Like:

,----
| ignotus agony:/opt/tmp/3 [7028]% xpmtoppm --verbose
test11.xpm 
| xpmtoppm: missing or invalid format
`----

After I add manually "/* XPM */" as the first
line, the error message
becomes:

,----
| ignotus agony:/opt/tmp/3 [7030]% xpmtoppm --verbose
test11.xpm
| xpmtoppm: Cannot find data structure declaration. 
Expected a line starting with 'static char', but found the
line '#define image_width 1024
`----

If I delete lines beginning with "#define", I
get:

,----
| ignotus agony:/opt/tmp/3 [7034]% xpmtoppm --verbose
test11.xpm
| xpmtoppm: error scanning hints line
`----

:-(

-- 
...sutongi tti olleh



CLX xy-pixmap
user name
2006-08-07 15:39:32
>>>>> "ignotus" == ignotus 
<ignotushixsplit.hu> writes:

    ignotus> Hello, I try to use the CLX library but I
don't know how to view these
    ignotus> pixmaps I get via GET-IMAGE.

    ignotus> Here is an example:

    ignotus> ,----
    ignotus> | (require 'clx)
    ignotus> | (in-package lib)
    ignotus> | 
    ignotus> | (defun test ()
    ignotus> |   (let* ((d (open-display
"127.0.0.1" :display +display+))
    ignotus> |          (s (car (display-roots d)))
    ignotus> |          (w (screen-root s)))
    ignotus> |     (get-image w
    ignotus> |                 0 :y
0
    ignotus> |                :width (drawable-width w)
    ignotus> |                :height (drawable-height w)
    ignotus> |                :format y-pix
map)
    ignotus> |                                         ;t
    ignotus> |     ))
    ignotus> | 
    ignotus> | (write-bitmap-file
"/tmp/test.xpm" (test))
    ignotus> `----

    ignotus> That test.xpm file is unreadable for Gimp
etc.  How can I view that
    ignotus> file?

    ignotus> Looks like this:

    ignotus> ,----
    ignotus> | #define image_width 1024
    ignotus> | #define image_height 768
    ignotus> | #define image_blue_mask 31
    ignotus> | #define image_green_mask 2016
    ignotus> | #define image_red_mask 63488
    ignotus> | static char image_bits[] = {
    ignotus> | 
0x2b,0x00,0x00,0x00,0x2b,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
0x14,0x33,0x3b,
    ignotus> | 
0x40,0xf8,0xf7,0xfe,0xbf,0x94,0xf7,0xfe,0xbf,0x9c,0x51,0xff,
0xbf,0x00,0x00,
    ignotus> | 
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,
    ignotus> | 
0x00,0x00,0x00,0xaa,0xb3,0x6a,0x08,0x23,0x00,0x00,0x00,0x13,
0x32,0x00,0x00,
    ignotus> |..........

I'm not very familiar with this stuff, but isn't this the
X11 bitmap
format?  xv recognizes this.  xbmtopbm seems to recognize
this too.

Ray


[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )