forked from moicci/pngpaste
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pngpaste.h
44 lines (35 loc) · 1.06 KB
/
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
41
42
43
44
/*
* pngpaste
*/
#import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>
#import <unistd.h>
#define APP_NAME "pngpaste"
#define APP_VERSION "0.2.2"
#define PDF_SCALE_FACTOR 1.5
#define STDOUT_FILENAME "-"
typedef enum imageType
{
ImageTypeNone = 0,
ImageTypePDF,
ImageTypeBitmap,
} ImageType;
typedef struct parameters
{
NSString *outputFile;
BOOL wantsVersion;
BOOL wantsUsage;
BOOL wantsStdout;
BOOL malformed;
} Parameters;
void usage ();
void fatal (const char *msg);
void version ();
ImageType extractImageType (NSImage *image);
NSData *renderImageData (NSImage *image, NSBitmapImageFileType bitmapImageFileType);
NSData *renderFromBitmap (NSImage *image, NSBitmapImageFileType bitmapImageFileType);
NSData *renderFromPDF (NSImage *image, NSBitmapImageFileType bitmapImageFileType);
NSBitmapImageFileType getBitmapImageFileTypeFromFilename (NSString *filename);
NSData *getPasteboardImageData (NSBitmapImageFileType bitmapImageFileType);
Parameters parseArguments (int argc, char* const argv[]);
int main (int argc, char * const argv[]);