• 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: multiple layers in tiff
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multiple layers in tiff


  • Subject: Re: multiple layers in tiff
  • From: Ryan Stevens <email@hidden>
  • Date: Fri, 23 Jan 2004 09:23:42 -0800

On Jan 23, 2004, at 6:38 AM, Roberto Toro wrote:

> Hi,
>
> Is it possible to save multiple layers in a tiff file?
> I have been trying with TIFFRepresentationWithImageRepsInArray, but I
> think
> it is not intended for that...
> otherwise, I have tried creating a NSImage where I compose several
> images
> and then saving that as a TIFFRepresentation, but I get just one
> layer...
>
> Is it maybe possible with a pdf file?
> .. should I better use libtiff?
>
>

It should be possible to "fake" layers....

// disclaimer: typed in Mail...
@implementation NSImage (Convenience)

- (NSImage *)addImageAsLayer:(NSImage *)img {
// should do sanity checking and add all of img's reps, left to the
reader.
[self addRepresentation: [[img representations] objectAtIndex:0] ];
return self;
}

- (NSArray *)imageLayers
{
NSMutableArray *contents = [NSMutableArray array];

NSImage *tmp;

NSArray *reps = [self representations];
int count = [reps count];
int i=0;

for (;i<count;i++) {
id rep = [reps objectAtIndex:i];
tmp = [[NSImage alloc] initWithSize:[rep size]];
[tmp addRepresentation:rep];
[tmp setFlipped:YES];
[contents addObject:tmp];
[tmp release];
}
return contents;
}
@end

HTH!
_______________________________________________
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.

References: 
 >multiple layers in tiff (From: "Roberto Toro" <email@hidden>)

  • Prev by Date: Rolling back sharedAddressBook changes
  • Next by Date: NSXMLParserTroubles (errors and line/column positions wrong?)
  • Previous by thread: multiple layers in tiff
  • Next by thread: AppleScripting of Cocoa Applications
  • Index(es):
    • Date
    • Thread