forked from jcsalterego/pngpaste
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pngpaste.h
40 lines (31 loc) · 763 Bytes
/
pngpaste.h
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
/*
* pngpaste
*/
#import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>
#import <unistd.h>
#define APP_NAME "pngpaste"
#define APP_VERSION "0.2.0"
#define PDF_SCALE_FACTOR 1.5
typedef enum imageTypes
{
ImageTypeNone = 0,
ImageTypePNG,
ImageTypePDF
} ImageType;
typedef struct parameters
{
NSString *outputFile;
BOOL wantsVersion;
BOOL wantsUsage;
BOOL malformed;
} Parameters;
void usage ();
void fatal (const char *msg);
void version ();
ImageType extractImageType (NSImage *image);
NSData *extractPngData (NSImage *image);
NSData *extractPngDataFromPng (NSImage *image);
NSData *extractPngDataFromPdf (NSImage *image);
Parameters parseArguments (int argc, char* const argv[]);
int main (int argc, char * const argv[]);