• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Quartz from the Command Line
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Quartz from the Command Line


  • Subject: Re: Quartz from the Command Line
  • From: Mike Paquette <email@hidden>
  • Date: Sun, 25 Apr 2004 09:55:20 -0700

On Apr 25, 2004, at 12:20 AM, Greg Hulands wrote:

I am about to create a tool that will composite two images together and produce a composited image. It has to be a tool that can run without a window server present (as it will be called from a webobjects application). I am just looking into what libraries to use to achieve this. I have tried linking against app kit and using NSImage to composite the images together, but it fails as it try's to make a connection to the window server.

The only other library available on OS X is the quartz library to composite the images, but I do not know whether or not a window server needs to be present in order for it to use the image compositing functions.

I found this thread on mamasam: http://cocoa.mamasam.com/MACOSXDEV/2002/05/2/34141.php

But there was no definitive answer that if you use these functions if you do indeed need a window server present.

If an application links with high level application-oriented frameworks such as Carbon or Cocoa, then during framework initialization these frameworks may try to form a connection to the window server. This is done in anticipation of a need to create windows, menus, and Dock reporesentations and to prepare to receive events.

The use of the Quartz (CG) functions to manipulate CGImageRefs and generate bitmap contexts, such as you are doing, does not require a connection to the window server. If you can avoid linking the Carbon or Cocoa frameworks, then your program won't need to form a window server connection. In general, this requires that your program link with Foundation, for Objective-C usage, and ApplicationServices, for Quartz access.

You may want to consider using the Python Quartz bindings available in Mac OS X 10.3. If you have Developer tools installed, look at the examples in /Developer/Examples/Quartz/Python. The contactsheet.py example demonstrates loading multiple images from JPEG files and assembling them in a single context. bitmap.py demonstrates how create a bitmap context and save it as a PNG file.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Quartz from the Command Line
      • From: Steven Majewski <email@hidden>
  • Prev by Date: Re: Setting message color in Mail programatically?
  • Next by Date: control autoresizing problem
  • Previous by thread: Re: Quartz from the Command Line
  • Next by thread: Re: Quartz from the Command Line
  • Index(es):
    • Date
    • Thread