My favorites | Sign in
Project Home Downloads Wiki Issues Source
Repository:
Checkout   Browse   Changes   Clones  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/* Copyright (c) 2006-2007 Christopher J. W. Lloyd

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */

#import <Foundation/Foundation.h>


enum {
NSTIFFTypeBYTE=1,
NSTIFFTypeASCII=2,
NSTIFFTypeSHORT=3,
NSTIFFTypeLONG=4,
NSTIFFTypeRATIONAL=5,
};

enum {
NSTIFFTagArtist=315,
NSTIFFTagBitsPerSample=258,
NSTIFFTagCellLength=265,
NSTIFFTagCellWidth=264,
NSTIFFTagColorMap=320,
NSTIFFTagCompression=259,
NSTIFFTagCopyright=33432,
NSTIFFTagDateTime=306,
NSTIFFTagDocumentName=269,
NSTIFFTagExtraSamples=338,
NSTIFFTagFillOrder=266,
NSTIFFTagFreeByteCounts=289,
NSTIFFTagFreeOffsets=288,
NSTIFFTagGrayResponseCurve=291,
NSTIFFTagGrayResponseUnit=290,
NSTIFFTagHostComputer=316,
NSTIFFTagImageDescription=270,
NSTIFFTagImageLength=257,
NSTIFFTagImageWidth=256,
NSTIFFTagMake=271,
NSTIFFTagMaxSampleValue=281,
NSTIFFTagMinSampleValue=280,
NSTIFFTagModel=272,
NSTIFFTagNewSubfileType=254,
NSTIFFTagOrientation=274,
NSTIFFTagPageName=285,
NSTIFFTagPageNumber=297,
NSTIFFTagPhotometricInterpretation=262,
NSTIFFTagPlanarConfiguration=284,
NSTIFFTagResolutionUnit=296,
NSTIFFTagRowsPerStrip=278,
NSTIFFTagSamplesPerPixel=277,
NSTIFFTagSoftware=305,
NSTIFFTagStripByteCounts=279,
NSTIFFTagStripOffsets=273,
NSTIFFTagSubfileType=255,
NSTIFFTagThreshholding=263,
NSTIFFTagXPosition=286,
NSTIFFTagXResolution=282,
NSTIFFTagYPosition=287,
NSTIFFTagYResolution=283,

NSTIFFTagPhotoshopPrivate1=34377,
NSTIFFTagPhotoshopPrivate2=37724,
};

enum {
NSTIFFExtraSamples_unspecified=0,
NSTIFFExtraSamples_associatedAlpha=1,
NSTIFFExtraSamples_unassociatedAlpha=2,

NSTIFFCompression_none=1,
NSTIFFCompression_CCITTGroup3=2,
NSTIFFCompression_packBits=32773,

NSTIFFResolutionUnit_none=1,
NSTIFFResolutionUnit_inch=2,
NSTIFFResolutionUnit_centimeter=3,


};

@interface NSTIFFReader : NSObject {
NSData *_data;
const unsigned char *_bytes;
unsigned _length,_position;
BOOL _bigEndian;

NSMutableArray *_directory;
}

-initWithContentsOfFile:(NSString *)path;

-(BOOL)tracingEnabled;

-(unsigned)currentOffset;
-(void)seekToOffset:(unsigned)offset;

-(unsigned)nextUnsigned16;
-(unsigned)nextUnsigned32;
-(unsigned)expectUnsigned16;
-(unsigned)expectUnsigned32;
-(double)expectRational;
-(NSString *)expectASCII;
-(unsigned)expectUnsigned16OrUnsigned32;
-(void)expectArrayOfUnsigned16:(unsigned **)valuesp count:(unsigned *)countp;
-(void)expectArrayOfUnsigned16OrUnsigned32:(unsigned **)valuesp count:(unsigned *)countp;


-(int)pixelsWide;
-(int)pixelsHigh;

-(BOOL)getRGBAImageBytes:(unsigned char *)bytes width:(int)width height:(int)height;

@end

Change log

2470bd80abf4 by cocotron on Jan 1, 2007   Diff
Added templates for many missing classes,
updated copyright for 2007, +[NSValue
valueWithRange:],-[NSObject className]
Go to: 
Project members, sign in to write a code review

Older revisions

e5277a40a7e8 by cocotron on Dec 21, 2006   Diff
Original
All revisions of this file

File info

Size: 3615 bytes, 115 lines
Powered by Google Project Hosting