RE: New to GTK; some beginner questions.



On Tue, 2003-12-02 at 23:55, Amit BHATNAGAR wrote:
> Thanks Michael for you helpful reply.
> 
> I have checked out the documentation for the GdkPixbuf at 
> 
> http://gtkmm.sourceforge.net/gtkmm2/docs/reference/html/classGdk_1_1Pixbuf.h
> tml 
> 
> and I cannot find any information about the image manipulation services 
> that I require, Am I looking in the wrong spot?

Umm, no that's right.  Everything you need is there.  If you wish to do
edge detection and other image operations, you'll have to do them
yourself.  GdkPixbuf does allow you to access individual pixels so you
can apply your own matrix transforms to it.  Basically this is a
lowlevel library and this is the same way all libraries would do it.  If
you need something higher-level you may need to look elsewhere.  Scaling
and compositing is what GdkPixbuf is used for.  You can do all your own
manipulations to the GdkPixbuf image, and then stick into the window. 
The nice thing is GdkPixbuf has built-in image loaders for many formats.

> 
> I've read up a bit on ImageMagick and I have found Magick++ (C++ API to 
> ImageMagick) and if GdkPixbuf cannot perform the requested operations, 
> I think I can use Magick++; it looks like I would have to encode my image
> first to a jpeg and let Magick++ load it (either from file or BLOB) and
> then it should be able to perform the operations.

Dunno.

> 
> I hope it is as simple as linking this library with my app. 

I don't really think that it will ever be this way, nor should it.  The
library is a tool.  You have to be the one to use it.

> 
> Also, I have tried making a simple app like you suggested so I can get
> familiar with GTK/Glade--, however when I run my executable, no UI 
> appears - it just hangs and nothing appears! I will investigate further.

Please pay attention to the Tutorials (both gtkmm and gtk).  After going
through the tutorial for gtkmm, you should be able to figure that part
out.

Note that while glade is a great way to do user interfaces, it's not
always the best tool for all parts of your project.  In this case, all
it's good for is putting up the controls you'll hook to and setting up a
blank spot to later on paste your GdkPixbuf.  I recommend that you first
learn how guis are done in straight code and then look at glade.  You
have to have some understanding of structure and method before you mess
with glade (which for many is a whole new way of thinking).

Michael


> 
> thanks again,
> amit.
> 
> -----Original Message-----
> From: Michael Torrie
> To: 'gtk-list gnome org'
> Sent: 02/12/03 6:12 PM
> Subject: Re: New to GTK; some beginner questions.
> 
> On Tue, 2003-12-02 at 12:23, Amit BHATNAGAR wrote:
> > Hi all.
> > 
> > I am considering using GTK+ to develop an app for Solaris 8, and I 
> > could use some help in answering some of my questions that would allow
> > me to make a decision on whether or not to use GTK+. I have searched
> > the FAQ & online docs, however if any of my questions have documented
> > answers that I failed to find, please point me in the right direction.
> > 
> > The app that I would be creating would largely deal with viewing radar
> > images, and I would require to do some image manipulation, (zoom, pan,
> 
> > filtering, contrast, brightness, display multiple images, edge
> detection,
> > mirror, etc). I would like to use GTKmm (and Glademm) as C++ would be
> > my primary development language of choice.
> > 
> > #1 Does GTK provide an API that I can use to perform the above
> operations? 
> > Since GTK is closely connected with GIMP, is it possible to use GIMP
> to 
> > achieve this? (assuming that GIMP has an API). I have read the
> documentation
> > for GtkImage and even GdkPixmap, but nothing would suggest that image
> > manipulation is possible from these. 
> 
> GdkPixmap is going away.  The replacement you should use is GdkPixbuf
> which has all kinds of functions for scaling and manipulation, including
> alpha-compositing of alpha-channel pixbufs.  GdkPixbuf has built-in
> loaders for a variety of image formats and does let you manipulate  it
> on a pixel level.  You could then apply your own matrix
> transformations.  You then typically draw the GdkPixbuf onto a
> GtkDrawingArea widget.
> 
> > 
> > #2 Is my only other alternative to use a library like ImageMagick to 
> > perform these operations? Is there a GTK(mm) interface for this? I
> have
> > found GDKMagick but this seems to be very old (obsolete?). There is
> also
> > Magic++, but again I don't know how this integrates well within a GTK
> app.
> > Is there any better alternative than ImageMagick?
> 
> GdkPixbuf works very well as I mentioned, but ImageMagick has been  a
> very good library too (not to be confused with GdkImageMagick).  I'm
> pretty sure ImageMagick can integrate with GTK.  GtkMM has a full
> object-oriented version of GdkPixbuf which I've used before and it's
> quite workable.  
> 
> I think GTK and GTK-- would work very well for you.  If you do a small
> test program to get familiar with the toolkit you should be able to
> determine if it has the vital features you need.
> 
> Michael
> 
> > 
> > Thanks in advance for your assistance.
> > 
> > amit.
> > 
> > _______________________________________________
> > gtk-list mailing list
> > gtk-list gnome org
> > http://mail.gnome.org/mailman/listinfo/gtk-list
-- 
Michael Torrie <torriem chem byu edu>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]