forked from jlamarche/Tile-Cutter
-
Notifications
You must be signed in to change notification settings - Fork 4
/
NSBitmapImageRep-Tile.h
43 lines (35 loc) · 1.19 KB
/
NSBitmapImageRep-Tile.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
//
// NSBitmapImageRep-Tile.h
// Tile Cutter
//
// Created by jeff on 10/30/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface NSBitmapImageRep(Tile)
-(NSImage *)subImageWithTileWidth:(CGFloat)tileWidth
tileHeight:(CGFloat)tileHeight
column:(NSUInteger)column
row:(NSUInteger)row;
// Same as previous, but if rigid = YES - adds black pixels to fill
// all tileWidthxtileHeight zone, if there's no enough pixels in image
-(NSImage *)subImageWithTileWidth:(CGFloat)tileWidth
tileHeight:(CGFloat)tileHeight
column:(NSUInteger)column
row:(NSUInteger)row
rigidSize:(BOOL) rigid;
/** Designated method.
*
* @param potSize If YES - tile width & height will be rounded to nearest POT value, larger then existing.
* potSize have no effect if rigidSize is YES.
*
*/
-(NSImage *)subImageWithTileWidth:(CGFloat)tileWidth
tileHeight:(CGFloat)tileHeight
column:(NSUInteger)column
row:(NSUInteger)row
rigidSize:(BOOL) rigid
POTSize:(BOOL) potSize;
-(NSUInteger)columnsWithTileWidth:(CGFloat)tileWidth;
-(NSUInteger)rowsWithTileHeight:(CGFloat)tileHeight;
@end