├── FloodFillAlgo2.xcodeproj
├── project.pbxproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcuserdata
│ │ ├── gaurav.singh.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
│ │ ├── gauravsingh.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
│ │ └── manish.sharma2.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
└── xcuserdata
│ ├── gaurav.singh.xcuserdatad
│ ├── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
│ └── xcschemes
│ │ ├── FloodFillAlgo2.xcscheme
│ │ └── xcschememanagement.plist
│ ├── gauravsingh.xcuserdatad
│ └── xcschemes
│ │ ├── FloodFillAlgo2.xcscheme
│ │ └── xcschememanagement.plist
│ └── manish.sharma2.xcuserdatad
│ ├── xcdebugger
│ └── Breakpoints_v2.xcbkptlist
│ └── xcschemes
│ ├── FloodFillAlgo2.xcscheme
│ └── xcschememanagement.plist
├── FloodFillAlgo2
├── AppDelegate.h
├── AppDelegate.m
├── Base.lproj
│ └── Main.storyboard
├── DetailViewController.h
├── DetailViewController.m
├── FloodFill.h
├── FloodFill.m
├── FloodFillAlgo2-Info.plist
├── FloodFillAlgo2-Prefix.pch
├── ImageCanvas.h
├── ImageCanvas.m
├── Images.xcassets
│ ├── AppIcon.appiconset
│ │ └── Contents.json
│ └── LaunchImage.launchimage
│ │ └── Contents.json
├── MasterViewController.h
├── MasterViewController.m
├── en.lproj
│ └── InfoPlist.strings
├── images
│ ├── 1+1=.png
│ ├── 1+2=.png
│ ├── 2+2=.png
│ ├── 2+3=.png
│ ├── 3+3=.png
│ ├── 3,1,2.png
│ ├── 3,5,7.png
│ ├── 4+5=.png
│ ├── 5+3=.png
│ ├── 5+5=.png
│ ├── A.png
│ ├── Ambulance.png
│ ├── Ant.png
│ ├── Apple.png
│ ├── B.png
│ ├── Bear.png
│ ├── Beet.png
│ ├── Beetle.png
│ ├── Bells.png
│ ├── Bigfoot.png
│ ├── Bilberry.png
│ ├── Boat.png
│ ├── Bull.png
│ ├── Bullfinch.png
│ ├── Butterfly 1.png
│ ├── Butterfly 10.png
│ ├── Butterfly 2.png
│ ├── Butterfly 3.png
│ ├── Butterfly 4.png
│ ├── Butterfly 5.png
│ ├── Butterfly 6.png
│ ├── Butterfly 7.png
│ ├── Butterfly 8.png
│ ├── Butterfly 9.png
│ ├── C.png
│ ├── Cabbage.png
│ ├── Candle.png
│ ├── Car.png
│ ├── Cat 1.png
│ ├── Cat 2.png
│ ├── Cat 3.png
│ ├── Cat 4.png
│ ├── Cat 5.png
│ ├── Cat 6.png
│ ├── Cat 7.png
│ ├── Cat 8.png
│ ├── Cat.png
│ ├── Caterpillar.png
│ ├── Cement mixer.png
│ ├── Chameleon.png
│ ├── Cherry.png
│ ├── Clownfish.png
│ ├── Cow.png
│ ├── Crow.png
│ ├── D.png
│ ├── Dog.png
│ ├── Dolphin 2.png
│ ├── Dolphin.png
│ ├── Donkey.png
│ ├── Dragonfly.png
│ ├── Duck.png
│ ├── E.png
│ ├── Eight.png
│ ├── F.png
│ ├── Fish.png
│ ├── Five.png
│ ├── Fly.png
│ ├── Four.png
│ ├── Fox.png
│ ├── Furseal.png
│ ├── G.png
│ ├── Garlic.png
│ ├── Goat.png
│ ├── Gooseberry.png
│ ├── Grapes.png
│ ├── Grasshopper.png
│ ├── H.png
│ ├── Helloween 1.png
│ ├── Helloween 2.png
│ ├── Helloween 3.png
│ ├── Helloween 4.png
│ ├── Helloween 5.png
│ ├── Helloween 6.png
│ ├── Helloween 7.png
│ ├── Helloween 8.png
│ ├── Hippocampus.png
│ ├── Hips.png
│ ├── Horse.png
│ ├── I.png
│ ├── Island.png
│ ├── J.png
│ ├── K.png
│ ├── Kozlik.png
│ ├── L.png
│ ├── Lemur.png
│ ├── Lighthouse.png
│ ├── M.png
│ ├── Magic truck.png
│ ├── Mantis.png
│ ├── Medusa 2.png
│ ├── Medusa.png
│ ├── Minivan.png
│ ├── Monkey.png
│ ├── N.png
│ ├── Nine.png
│ ├── Numbers.png
│ ├── O.png
│ ├── Octopus 2.png
│ ├── Octopus.png
│ ├── One.png
│ ├── Orange.png
│ ├── Orca.png
│ ├── Ornament.png
│ ├── Oslik.png
│ ├── Ove4ka.png
│ ├── P.png
│ ├── Panda.png
│ ├── Parrot.png
│ ├── Peacock.png
│ ├── Pelikan.png
│ ├── Pig.png
│ ├── Pigeon.png
│ ├── Plum.png
│ ├── Pomegranate.png
│ ├── Potato.png
│ ├── Presents.png
│ ├── Pumpkin.png
│ ├── Q.png
│ ├── R.png
│ ├── Racing car.png
│ ├── Raspberry.png
│ ├── Redcurrant.png
│ ├── Reindeer.png
│ ├── Rooster.png
│ ├── S.png
│ ├── Santa.png
│ ├── Seagull.png
│ ├── Seven.png
│ ├── Shark.png
│ ├── Sheep.png
│ ├── Shells.png
│ ├── Shrimp.png
│ ├── Six.png
│ ├── Snail.png
│ ├── Snowman.png
│ ├── Sparrow.png
│ ├── Spider.png
│ ├── Starfish.png
│ ├── Strawberry.png
│ ├── T.png
│ ├── Ten.png
│ ├── Three.png
│ ├── Tomato.png
│ ├── Tow car.png
│ ├── Truck crane.png
│ ├── Truck.png
│ ├── Turtle.png
│ ├── Two.png
│ ├── U.png
│ ├── V.png
│ ├── W.png
│ ├── Wasp.png
│ ├── Watermelon.png
│ ├── Whale.png
│ ├── Wild strawberry.png
│ ├── X.png
│ ├── Y.png
│ ├── Z.png
│ ├── Zebra.png
│ ├── stamp31.png
│ ├── stamp32.png
│ ├── stamp33.png
│ ├── stamp34.png
│ ├── stamp35.png
│ ├── stamp36.png
│ ├── stamp37.png
│ ├── stamp38.png
│ ├── stamp39.png
│ ├── stamp40.png
│ ├── stamp41.png
│ ├── stamp42.png
│ ├── stamp43.png
│ ├── stamp44.png
│ ├── stamp45.png
│ ├── stamp46.png
│ ├── stamp47.png
│ ├── stamp48.png
│ ├── stamp49.png
│ ├── stamp50.png
│ ├── stamp51.png
│ ├── stamp52.png
│ ├── stamp53.png
│ ├── stamp54.png
│ ├── stamp55.png
│ ├── stamp56.png
│ ├── stamp57.png
│ ├── stamp58.png
│ ├── stamp59.png
│ ├── stamp60.png
│ ├── stamp61.png
│ ├── stamp62.png
│ ├── stamp63.png
│ ├── stamp64.png
│ ├── stamp65.png
│ ├── stamp66.png
│ ├── stamp67.png
│ ├── stamp68.png
│ ├── А.png
│ ├── Б.png
│ ├── В.png
│ ├── Г.png
│ ├── Д.png
│ ├── Е.png
│ ├── Ё.png
│ ├── Ж.png
│ ├── З.png
│ ├── И.png
│ ├── Й.png
│ ├── К.png
│ ├── Л.png
│ ├── М.png
│ ├── Н.png
│ ├── О.png
│ ├── П.png
│ ├── Р.png
│ ├── С.png
│ ├── Т.png
│ ├── У.png
│ ├── Ф.png
│ ├── Х.png
│ ├── Ц.png
│ ├── Ч.png
│ ├── Ш.png
│ ├── Щ.png
│ ├── Ъ.png
│ ├── Ы.png
│ ├── Ь.png
│ ├── Э.png
│ ├── Ю.png
│ └── Я.png
├── main.m
└── optimized FloodFill
│ ├── LinkedListStack.h
│ ├── LinkedListStack.m
│ ├── UIImage+FloodFill.h
│ └── UIImage+FloodFill.m
├── FloodFillAlgo2Tests
├── FloodFillAlgo2Tests-Info.plist
├── FloodFillAlgo2Tests.m
└── en.lproj
│ └── InfoPlist.strings
└── README.md
/FloodFillAlgo2.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/FloodFillAlgo2.xcodeproj/project.xcworkspace/xcuserdata/gaurav.singh.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2.xcodeproj/project.xcworkspace/xcuserdata/gaurav.singh.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/FloodFillAlgo2.xcodeproj/project.xcworkspace/xcuserdata/gauravsingh.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2.xcodeproj/project.xcworkspace/xcuserdata/gauravsingh.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/FloodFillAlgo2.xcodeproj/project.xcworkspace/xcuserdata/manish.sharma2.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2.xcodeproj/project.xcworkspace/xcuserdata/manish.sharma2.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/FloodFillAlgo2.xcodeproj/xcuserdata/gaurav.singh.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/FloodFillAlgo2.xcodeproj/xcuserdata/gaurav.singh.xcuserdatad/xcschemes/FloodFillAlgo2.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
42 |
43 |
49 |
50 |
51 |
52 |
61 |
62 |
68 |
69 |
70 |
71 |
72 |
73 |
79 |
80 |
86 |
87 |
88 |
89 |
91 |
92 |
95 |
96 |
97 |
--------------------------------------------------------------------------------
/FloodFillAlgo2.xcodeproj/xcuserdata/gaurav.singh.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | FloodFillAlgo2.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 914F917118067D050086256B
16 |
17 | primary
18 |
19 |
20 | 914F919518067D050086256B
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/FloodFillAlgo2.xcodeproj/xcuserdata/gauravsingh.xcuserdatad/xcschemes/FloodFillAlgo2.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
42 |
43 |
49 |
50 |
51 |
52 |
61 |
62 |
68 |
69 |
70 |
71 |
72 |
73 |
79 |
80 |
86 |
87 |
88 |
89 |
91 |
92 |
95 |
96 |
97 |
--------------------------------------------------------------------------------
/FloodFillAlgo2.xcodeproj/xcuserdata/gauravsingh.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | FloodFillAlgo2.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 914F917118067D050086256B
16 |
17 | primary
18 |
19 |
20 | 914F919518067D050086256B
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/FloodFillAlgo2.xcodeproj/xcuserdata/manish.sharma2.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
8 |
20 |
21 |
22 |
24 |
36 |
37 |
38 |
40 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/FloodFillAlgo2.xcodeproj/xcuserdata/manish.sharma2.xcuserdatad/xcschemes/FloodFillAlgo2.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
42 |
43 |
49 |
50 |
51 |
52 |
61 |
62 |
68 |
69 |
70 |
71 |
72 |
73 |
79 |
80 |
86 |
87 |
88 |
89 |
91 |
92 |
95 |
96 |
97 |
--------------------------------------------------------------------------------
/FloodFillAlgo2.xcodeproj/xcuserdata/manish.sharma2.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | FloodFillAlgo2.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 914F917118067D050086256B
16 |
17 | primary
18 |
19 |
20 | 914F919518067D050086256B
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/FloodFillAlgo2/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // FloodFillAlgo2
4 | //
5 | // Created by Gaurav Singh on 10/10/13.
6 | // Copyright (c) 2013 Gaurav Singh. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/FloodFillAlgo2/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // FloodFillAlgo2
4 | //
5 | // Created by Gaurav Singh on 10/10/13.
6 | // Copyright (c) 2013 Gaurav Singh. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @implementation AppDelegate
12 |
13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
14 | {
15 | // Override point for customization after application launch.
16 | UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
17 | UINavigationController *navigationController = [splitViewController.viewControllers lastObject];
18 | splitViewController.delegate = (id)navigationController.topViewController;
19 | return YES;
20 | }
21 |
22 | - (void)applicationWillResignActive:(UIApplication *)application
23 | {
24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
26 | }
27 |
28 | - (void)applicationDidEnterBackground:(UIApplication *)application
29 | {
30 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
31 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
32 | }
33 |
34 | - (void)applicationWillEnterForeground:(UIApplication *)application
35 | {
36 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
37 | }
38 |
39 | - (void)applicationDidBecomeActive:(UIApplication *)application
40 | {
41 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
42 | }
43 |
44 | - (void)applicationWillTerminate:(UIApplication *)application
45 | {
46 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
47 | }
48 |
49 | @end
50 |
--------------------------------------------------------------------------------
/FloodFillAlgo2/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
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 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
--------------------------------------------------------------------------------
/FloodFillAlgo2/DetailViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // DetailViewController.h
3 | // FloodFillAlgo2
4 | //
5 | // Created by Gaurav Singh on 10/10/13.
6 | // Copyright (c) 2013 Gaurav Singh. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface DetailViewController : UIViewController
12 |
13 | @property (strong, nonatomic) id detailItem;
14 |
15 | @property (weak, nonatomic) IBOutlet UIImageView *imageView;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/FloodFillAlgo2/DetailViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // DetailViewController.m
3 | // FloodFillAlgo2
4 | //
5 | // Created by Gaurav Singh on 10/10/13.
6 | // Copyright (c) 2013 Gaurav Singh. All rights reserved.
7 | //
8 |
9 | #import "FloodFill.h"
10 | #import "DetailViewController.h"
11 | #import
12 | #import "UIImage+FloodFill.h"
13 |
14 | @interface DetailViewController ()
15 | @property (strong, nonatomic) UIPopoverController *masterPopoverController;
16 | - (void)configureView;
17 | @end
18 |
19 | @implementation DetailViewController
20 |
21 | #pragma mark - Managing the detail item
22 |
23 | - (void)setDetailItem:(id)newDetailItem
24 | {
25 | if (_detailItem != newDetailItem) {
26 | _detailItem = newDetailItem;
27 |
28 | // Update the view.
29 | [self configureView];
30 | }
31 |
32 | if (self.masterPopoverController != nil) {
33 | [self.masterPopoverController dismissPopoverAnimated:YES];
34 | }
35 | }
36 |
37 | - (void)configureView
38 | {
39 | // Update the user interface for the detail item.
40 |
41 | if (self.detailItem) {
42 |
43 | UIImage *img = [UIImage imageWithData:UIImageJPEGRepresentation([UIImage imageNamed:_detailItem], 1)];
44 | [self.imageView setBounds:CGRectMake(0, 0, img.size.width, img.size.height)];
45 | [self.imageView setImage:img];
46 | }
47 | }
48 |
49 | - (void)viewDidLoad
50 | {
51 | [super viewDidLoad];
52 | // Do any additional setup after loading the view, typically from a nib.
53 | [self configureView];
54 | }
55 |
56 | - (void)didReceiveMemoryWarning
57 | {
58 | [super didReceiveMemoryWarning];
59 | // Dispose of any resources that can be recreated.
60 | }
61 |
62 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
63 | {
64 | //NSLog(@"touchesBegan");
65 | }
66 |
67 | - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
68 | {
69 | //NSLog(@"touchesMoved");
70 | }
71 |
72 | - (void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
73 | {
74 | if ([touches count] == 1)
75 | {
76 | UITouch * touch = [touches anyObject];
77 | if ([touch tapCount] == 1)
78 | {
79 |
80 |
81 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
82 |
83 | // UIImage *filledImage = [self floodFillAtPoint:[touch locationInView:self.imageView]];
84 | UIImage *filledImage= [self.imageView.image floodFillFromPoint:[touch locationInView:self.imageView] withColor:[self getRandomColor] andTolerance:0];
85 |
86 | dispatch_async(dispatch_get_main_queue(), ^{
87 |
88 | self.imageView.image = filledImage;
89 | });
90 | });
91 |
92 |
93 | }
94 | }
95 |
96 | }
97 |
98 | #pragma mark - Split view
99 |
100 | - (void)splitViewController:(UISplitViewController *)splitController willHideViewController:(UIViewController *)viewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)popoverController
101 | {
102 | barButtonItem.title = NSLocalizedString(@"Master", @"Master");
103 | [self.navigationItem setLeftBarButtonItem:barButtonItem animated:YES];
104 | self.masterPopoverController = popoverController;
105 | }
106 |
107 | - (UIImage*)floodFillAtPoint:(CGPoint)fillCenter
108 | {
109 | unsigned char *rawData = [self rawDataFromImage:self.imageView.image];
110 |
111 | color fromColor = [FloodFill getColorForX:fillCenter.x Y:fillCenter.y fromImage:rawData imageWidth:self.imageView.image.size.width];
112 | int fromColorInt = [self mkcolorI:fromColor.red G:fromColor.green B:fromColor.blue A:fromColor.alpha];
113 |
114 | CGFloat r, g, b, a;
115 |
116 | [[self getRandomColor] getRed: &r green:&g blue:&b alpha:&a];
117 |
118 | CGFloat alpha = 255.0 * ((100.0 - 0.9) / 100.0);
119 | int toColorInt = [self mkcolorI:r*255 G:g*255 B:b*255 A:alpha];
120 |
121 |
122 |
123 |
124 | [FloodFill floodfillX:fillCenter.x Y:fillCenter.y image:rawData width:self.imageView.image.size.width height:self.imageView.image.size.height origIntColor:fromColorInt replacementIntColor:toColorInt];
125 |
126 | UIImage *filledImage = [self imageFromRawData:rawData];
127 |
128 | free(rawData);
129 |
130 | return filledImage;
131 | }
132 |
133 | // creates color int from RGBA
134 | - (int)mkcolorI:(int)red G:(int)green B:(int)blue A:(int)alpha {
135 | int x = 0;
136 | x |= (red & 0xff) << 24;
137 | x |= (green & 0xff) << 16;
138 | x |= (blue & 0xff) << 8;
139 | x |= (alpha & 0xff);
140 | return x;
141 | }
142 |
143 | - (unsigned char*)rawDataFromImage:(UIImage*)image
144 | {
145 | CGImageRef imageRef = [image CGImage];
146 | NSUInteger width = CGImageGetWidth(imageRef);
147 | NSUInteger height = CGImageGetHeight(imageRef);
148 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
149 | unsigned char *rawData = malloc(height * width * 4);
150 | NSUInteger bytesPerPixel = 4;
151 | NSUInteger bytesPerRow = bytesPerPixel * width;
152 | NSUInteger bitsPerComponent = 8;
153 | CGContextRef context = CGBitmapContextCreate(rawData, width, height,
154 | bitsPerComponent, bytesPerRow, colorSpace,
155 | kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big);
156 | CGColorSpaceRelease(colorSpace);
157 |
158 | CGContextDrawImage(context, CGRectMake(0, 0, width, height), imageRef);
159 | CGContextRelease(context);
160 |
161 | return rawData;
162 | }
163 |
164 | - (UIImage*)imageFromRawData:(unsigned char*)rawData
165 | {
166 | NSUInteger bitsPerComponent = 8;
167 | NSUInteger bytesPerPixel = 4;
168 | NSUInteger bytesPerRow = bytesPerPixel * self.imageView.image.size.width;
169 | CGImageRef imageRef = [self.imageView.image CGImage];
170 | CGColorSpaceRef colorSpace = CGImageGetColorSpace(imageRef);
171 |
172 | CGContextRef context = CGBitmapContextCreate(rawData,
173 | self.imageView.image.size.width,
174 | self.imageView.image.size.height,
175 | bitsPerComponent,
176 | bytesPerRow,
177 | colorSpace,
178 | kCGImageAlphaPremultipliedLast);
179 |
180 | imageRef = CGBitmapContextCreateImage (context);
181 | UIImage* rawImage = [UIImage imageWithCGImage:imageRef];
182 |
183 | CGContextRelease(context);
184 |
185 | CGImageRelease(imageRef);
186 |
187 | return rawImage;
188 | }
189 |
190 |
191 | - (UIColor*)getRandomColor
192 | {
193 | CGFloat hue = ( arc4random() % 256 / 256.0 ); // 0.0 to 1.0
194 | CGFloat saturation = ( arc4random() % 128 / 256.0 ) + 0.5; // 0.5 to 1.0, away from white
195 | CGFloat brightness = ( arc4random() % 128 / 256.0 ) + 0.5; // 0.5 to 1.0, away from black
196 | return [UIColor colorWithHue:hue saturation:saturation brightness:brightness alpha:1];
197 | }
198 |
199 | - (void)splitViewController:(UISplitViewController *)splitController willShowViewController:(UIViewController *)viewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem
200 | {
201 | // Called when the view is shown again in the split view, invalidating the button and popover controller.
202 | [self.navigationItem setLeftBarButtonItem:nil animated:YES];
203 | self.masterPopoverController = nil;
204 | }
205 |
206 | @end
207 |
--------------------------------------------------------------------------------
/FloodFillAlgo2/FloodFill.h:
--------------------------------------------------------------------------------
1 | //
2 | // FloodFill.h
3 | // FloodFillAlgo2
4 | //
5 | // Created by Gaurav Singh on 10/10/13.
6 | // Copyright (c) 2013 Gaurav Singh. All rights reserved.
7 | //
8 |
9 | #import
10 | #define COLOR_DEPTH 4
11 | #define THRESHOULD 25
12 |
13 | typedef struct {
14 | int red;
15 | int green;
16 | int blue;
17 | int alpha;
18 | } color;
19 |
20 | // Definint a linked list structure
21 | struct node_st {
22 | int x;
23 | int y;
24 | struct node_st *next;
25 | };
26 | typedef struct node_st node;
27 |
28 | @interface FloodFill : NSObject {
29 |
30 |
31 |
32 | }
33 |
34 | +(int)floodfillX:(int)x Y:(int)y image:(unsigned char*)image width:(int)w height:(int)h origIntColor:(int)iOrigColor replacementIntColor:(int)iColor;
35 | +(color)imkcolor:(int)thecolor;
36 | +(color)mkcolorR:(int)red G:(char)green B:(char)blue A:(char)alpha;
37 | +(int)getIndexX:(int)x Y:(int)y W:(int)w;
38 | +(color)getColorForINDEX:(int)index fromImage:(unsigned char*)image;
39 | +(int)compareColorForPointX:(int)x Y:(int)y image:(unsigned char*)image width:(int)w height:(int)h targetColor:(color)target;
40 | +(int)compareColor:(color)current withTargetColor:(color) target;
41 | +(color)blendColor:(color)current withColor:(color)replacement alpha:(int) alpha;
42 | + (BOOL) isColorsSimilar:(color)color1 withColor:(color)color2;
43 | +(color)getColorForX:(int)x Y:(int)y fromImage:(unsigned char*)image imageWidth:(int)w;
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/FloodFillAlgo2/FloodFill.m:
--------------------------------------------------------------------------------
1 | //
2 | // FloodFill.m
3 | // FloodFillAlgo2
4 | //
5 | // Created by Gaurav Singh on 10/10/13.
6 | // Copyright (c) 2013 Gaurav Singh. All rights reserved.
7 | //
8 |
9 | #import "FloodFill.h"
10 |
11 | @implementation FloodFill
12 |
13 | - (id)init
14 | {
15 | self = [super init];
16 | if (self) {
17 | // Initialization code here.
18 | }
19 |
20 | return self;
21 | }
22 |
23 | /*
24 | * Flood Fill 4 algorythm, stack based
25 | */
26 | +(int)floodfillX:(int)x Y:(int)y image:(unsigned char*)image width:(int)w height:(int)h origIntColor:(int)iOrigColor replacementIntColor:(int)iColor {
27 | // Replacement color
28 | color replacement = [FloodFill imkcolor:iColor];
29 | color target = [FloodFill imkcolor:iOrigColor];
30 |
31 | // Target color
32 | //int index = [FloodFill getIndexX:x Y:y W:w BPC:bpc];
33 | //color target = [FloodFill getColorForINDEX:index fromImage:image BPC:bpc]; //getColor(getIndex(x, y, w, bpc), image, bpc);
34 |
35 | if ([FloodFill compareColor:target withTargetColor:replacement]) // if colors identical we don't need to fill
36 | return 0;
37 |
38 | // Creating the list/stack
39 | node *list = (node*) malloc(sizeof(struct node_st));
40 | (*list).x = x;
41 | (*list).y = y;
42 | (*list).next = NULL;
43 |
44 | // The algorithm itself
45 | int iterations=0;
46 |
47 | while (list != NULL) {
48 |
49 | node *pointer_to_free = list;
50 | node current = *list;
51 | list = current.next;
52 |
53 | int index = [FloodFill getIndexX:current.x Y:current.y W:w];
54 | color current_color = [FloodFill getColorForINDEX:index fromImage:image];
55 | int blending_alpha = [FloodFill compareColor:current_color withTargetColor:target];
56 | if (blending_alpha != (int)0x00) {
57 | color result = [FloodFill blendColor:current_color withColor:replacement alpha:blending_alpha];
58 | image[index] = result.red;
59 | image[index + 1] = result.green;
60 | image[index + 2] = result.blue;
61 | }
62 |
63 | // Query neighbours...
64 | node *new;
65 |
66 | // North
67 | if ([FloodFill compareColorForPointX:current.x Y:current.y-1 image:image width:w height:h targetColor:target] != (int)0x00) {
68 | new = (node*) malloc(sizeof(struct node_st));
69 | (*new).x = current.x;
70 | (*new).y = current.y-1;
71 | (*new).next = list;
72 | list = new;
73 | }
74 |
75 | // South
76 | if ([FloodFill compareColorForPointX:current.x Y:current.y+1 image:image width:w height:h targetColor:target] != (int)0x00) {
77 | new = (node*) malloc(sizeof(struct node_st));
78 | (*new).x = current.x;
79 | (*new).y = current.y+1;
80 | (*new).next = list;
81 | list = new;
82 | }
83 |
84 | // West
85 | if ([FloodFill compareColorForPointX:current.x-1 Y:current.y image:image width:w height:h targetColor:target] != (int)0x00) {
86 | new = (node*) malloc(sizeof(struct node_st));
87 | (*new).x = current.x-1;
88 | (*new).y = current.y;
89 | (*new).next = list;
90 | list = new;
91 | }
92 |
93 | // East
94 | if ([FloodFill compareColorForPointX:current.x+1 Y:current.y image:image width:w height:h targetColor:target] != (int)0x00) {
95 | new = (node*) malloc(sizeof(struct node_st));
96 | (*new).x = current.x+1;
97 | (*new).y = current.y;
98 | (*new).next = list;
99 | list = new;
100 | }
101 |
102 | free(pointer_to_free);
103 | iterations ++; if (iterations == w*h*COLOR_DEPTH*5) break;
104 | }
105 | NSLog(@"Iterations: %d", iterations);
106 | return 0;
107 | }
108 |
109 | // Scanline flood fill algorythm (based on C implementation here: http://www.academictutorials.com/graphics/graphics-flood-fill.asp )
110 | // WARNING: DOESN'T WORK!!! Critical bug here...
111 | +(int)scanlineFloodfillX:(int)x Y:(int)y image:(unsigned char*)image width:(int)w height:(int)h origIntColor:(int)iOrigColor replacementIntColor:(int)iColor {
112 | // Replacement color
113 | color replacement = [FloodFill imkcolor:iColor];
114 | // Current color of the point where tap was received
115 | color target = [FloodFill imkcolor:iOrigColor];
116 |
117 | if ([FloodFill compareColor:target withTargetColor:replacement]) // if colors identical we don't need to fill
118 | return 0;
119 |
120 | // Creating the list/stack
121 | node *list = (node*) malloc(sizeof(struct node_st));
122 | (*list).x = x;
123 | (*list).y = y;
124 | (*list).next = NULL;
125 |
126 | // The algorithm itself
127 | int y1;
128 | BOOL spanLeft, spanRight;
129 |
130 | while (list != NULL) {
131 | node *pointer_to_free = list;
132 | node current = *list;
133 | list = current.next;
134 |
135 | y1 = current.y;
136 |
137 | color current_color = [FloodFill getColorForX:current.x Y:y1 fromImage:image imageWidth:w];
138 | while(y1 >= 0 && [FloodFill compareColor:current_color withTargetColor:target]!=0) {
139 | y1--;
140 | current_color = [FloodFill getColorForX:current.x Y:y1 fromImage:image imageWidth:w];
141 | }
142 | y1++;
143 |
144 | spanLeft = NO;
145 | spanRight = NO;
146 |
147 | current_color = [FloodFill getColorForX:current.x Y:y1 fromImage:image imageWidth:w];
148 | int blending_alpha = [FloodFill compareColor:current_color withTargetColor:target];
149 | while(y1 < h && blending_alpha != 0)
150 | {
151 | int index = [FloodFill getIndexX:current.x Y:y1 W:w];
152 | color result = [FloodFill blendColor:current_color withColor:replacement alpha:blending_alpha];
153 | image[index] = result.red;
154 | image[index + 1] = result.green;
155 | image[index + 2] = result.blue;
156 |
157 | color rightColor = [FloodFill getColorForX:(current.x+1) Y:y1 fromImage:image imageWidth:w];
158 | color leftColor = [FloodFill getColorForX:(current.x-1) Y:y1 fromImage:image imageWidth:w];
159 | int blendRight = [FloodFill compareColor:rightColor withTargetColor:target];
160 | int blendLeft = [FloodFill compareColor:leftColor withTargetColor:target];
161 |
162 | if(!spanLeft && current.x > 0 && blendLeft != (int)0) // pixel on left same or similar
163 | {
164 | node *new = (node*) malloc(sizeof(struct node_st));
165 | (*new).x = current.x-1;
166 | (*new).y = y1;
167 | (*new).next = list;
168 | list = new;
169 |
170 | spanLeft = 1;
171 | }
172 | else if(spanLeft && current.x > 0 && blendLeft == (int)0) // pixel on left is different color
173 | {
174 | spanLeft = 0;
175 | }
176 | if(!spanRight && current.x < w - 1 && blendRight != (int)0) // pixel on right same or similar
177 | {
178 | node *new = (node*) malloc(sizeof(struct node_st));
179 | (*new).x = current.x+1;
180 | (*new).y = y1;
181 | (*new).next = list;
182 | list = new;
183 |
184 | spanRight = 1;
185 | }
186 | else if(spanRight && current.x < w - 1 && blendRight == (int)0)// pixel on right is different color
187 | {
188 | spanRight = 0;
189 | }
190 |
191 | free(pointer_to_free);
192 | y1++;
193 | current_color = [FloodFill getColorForX:current.x Y:y1 fromImage:image imageWidth:w];
194 | blending_alpha = [FloodFill compareColor:current_color withTargetColor:target];
195 | }
196 |
197 | }
198 | return 0;
199 | }
200 |
201 |
202 | // creates color struct from int
203 | +(color)imkcolor:(int)thecolor {
204 | color result;
205 |
206 | result.red = (thecolor & 0xff000000) >> 24;
207 | result.green = (thecolor & 0x00ff0000) >> 16;
208 | result.blue = (thecolor & 0x0000ff00) >> 8;
209 | result.alpha = (thecolor & 0x000000ff);
210 |
211 | return result;
212 | }
213 |
214 | // creates color struct from RGBA
215 | +(color)mkcolorR:(int)red G:(char)green B:(char)blue A:(char)alpha {
216 | int x = 0;
217 | x |= (red & 0xff) << 24;
218 | x |= (green & 0xff) << 16;
219 | x |= (blue & 0xff) << 8;
220 | x |= (alpha & 0xff);
221 | return [FloodFill imkcolor:x];
222 | }
223 |
224 | +(int)getIndexX:(int)x Y:(int)y W:(int)w {
225 | return y*w*COLOR_DEPTH + x*COLOR_DEPTH;
226 | }
227 |
228 |
229 | +(color)getColorForINDEX:(int)index fromImage:(unsigned char*)image {
230 | int red, green, blue, alpha;
231 | red = image[index];
232 | green = image[index + 1];
233 | blue = image[index + 2];
234 | if (COLOR_DEPTH == 4) alpha = image[index + 3];
235 |
236 | return [FloodFill mkcolorR:red G:green B:blue A:alpha];
237 | }
238 |
239 | +(color)getColorForX:(int)x Y:(int)y fromImage:(unsigned char*)image imageWidth:(int)w {
240 | int red, green, blue, alpha;
241 | int index= y*w*COLOR_DEPTH + x*COLOR_DEPTH;
242 | red = image[index];
243 | green = image[index + 1];
244 | blue = image[index + 2];
245 | if (COLOR_DEPTH == 4) alpha = image[index + 3];
246 |
247 | return [FloodFill mkcolorR:red G:green B:blue A:alpha];
248 | }
249 |
250 |
251 | +(int)compareColorForPointX:(int)x Y:(int)y image:(unsigned char*)image width:(int)w height:(int)h targetColor:(color)target {
252 | if (x<0 || x>=w) return NO;
253 | if (y<0 || y>=h) return NO;
254 |
255 | int index = [FloodFill getIndexX:x Y:y W:w];
256 | color current = [FloodFill getColorForINDEX:index fromImage:image];//getColor(getIndex(x, y, w, bpc), image, bpc);
257 |
258 | return [FloodFill compareColor:current withTargetColor:target];
259 | }
260 |
261 | // checks are colors same/similar or not.
262 | // Returns current color alpha if colors are same/similar OR if current color is very transperent (alpha <= 100)
263 | // returns 0 if colors aren't similar and current color has alpha > 100.
264 | +(int)compareColor:(color)current withTargetColor:(color) target {
265 | if (current.red == target.red &&
266 | current.green == target.green &&
267 | current.blue == target.blue)
268 | return current.alpha;
269 | else if([FloodFill isColorsSimilar:current withColor:target])
270 | return current.alpha;
271 | else if(current.alpha > 100)
272 | return (int)0x00;
273 |
274 | return current.alpha;
275 | }
276 |
277 | // Checks are colors similar or not.
278 | + (BOOL) isColorsSimilar:(color)color1 withColor:(color)color2
279 | {
280 | int da = abs(color1.alpha - color2.alpha);
281 | int dr = abs(color1.red - color2.red);
282 | int dg = abs(color1.green - color2.green);
283 | int db = abs(color1.blue - color2.blue);
284 |
285 |
286 | if (((double)(da + dr + dg + db) / 4.0) <= THRESHOULD)
287 | {
288 | //NSLog(@"YES");
289 | return YES;
290 | }
291 |
292 | //NSLog(@"diff: %i, currentColor: %i, color: %i", (currentColor - color), currentColor, color);
293 | return NO;
294 | }
295 |
296 | // blend colors. If current color is "solid", then replace it, if it is transperent, then blend colors
297 | +(color)blendColor:(color)current withColor:(color)replacement alpha:(int) alpha {
298 |
299 | color result;
300 |
301 | float falpha;
302 | if (alpha == 255) falpha = 1.;
303 | else falpha = alpha/255.;
304 |
305 | if (alpha > 100) {
306 | return replacement;
307 | }
308 |
309 | result.red = (int)(current.red*falpha) + (int)(replacement.red*(1-falpha));
310 | result.green = (int)(current.green*falpha) + (int)(replacement.green*(1-falpha));
311 | result.blue = (int)(current.blue*falpha) + (int)(replacement.blue*(1-falpha));
312 | if (current.alpha == 0)
313 | result.alpha = replacement.alpha;
314 |
315 | return result;
316 | }
317 |
318 |
319 | @end
320 |
--------------------------------------------------------------------------------
/FloodFillAlgo2/FloodFillAlgo2-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleIdentifier
12 | com.gst.${PRODUCT_NAME:rfc1034identifier}
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${PRODUCT_NAME}
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1.0
25 | LSRequiresIPhoneOS
26 |
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UIStatusBarTintParameters
34 |
35 | UINavigationBar
36 |
37 | Style
38 | UIBarStyleDefault
39 | Translucent
40 |
41 |
42 |
43 | UISupportedInterfaceOrientations
44 |
45 | UIInterfaceOrientationPortrait
46 | UIInterfaceOrientationLandscapeLeft
47 | UIInterfaceOrientationLandscapeRight
48 |
49 | UISupportedInterfaceOrientations~ipad
50 |
51 | UIInterfaceOrientationPortrait
52 | UIInterfaceOrientationPortraitUpsideDown
53 | UIInterfaceOrientationLandscapeLeft
54 | UIInterfaceOrientationLandscapeRight
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/FloodFillAlgo2/FloodFillAlgo2-Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header
3 | //
4 | // The contents of this file are implicitly included at the beginning of every source file.
5 | //
6 |
7 | #import
8 |
9 | #ifndef __IPHONE_5_0
10 | #warning "This project uses features only available in iOS SDK 5.0 and later."
11 | #endif
12 |
13 | #ifdef __OBJC__
14 | #import
15 | #import
16 | #endif
17 |
--------------------------------------------------------------------------------
/FloodFillAlgo2/ImageCanvas.h:
--------------------------------------------------------------------------------
1 | //
2 | // ImageCanvas.h
3 | // FloodFillAlgo2
4 | //
5 | // Created by Gaurav Singh on 10/10/13.
6 | // Copyright (c) 2013 Gaurav Singh. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ImageCanvas : UIView
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/FloodFillAlgo2/ImageCanvas.m:
--------------------------------------------------------------------------------
1 | //
2 | // ImageCanvas.m
3 | // FloodFillAlgo2
4 | //
5 | // Created by Gaurav Singh on 10/10/13.
6 | // Copyright (c) 2013 Gaurav Singh. All rights reserved.
7 | //
8 |
9 | #import "ImageCanvas.h"
10 |
11 | @implementation ImageCanvas
12 |
13 | - (id)initWithFrame:(CGRect)frame
14 | {
15 | self = [super initWithFrame:frame];
16 | if (self) {
17 | // Initialization code
18 | }
19 | return self;
20 | }
21 |
22 |
23 | - (void)drawRect:(CGRect)rect
24 | {
25 | // Drawing code
26 |
27 |
28 |
29 |
30 | }
31 |
32 |
33 |
34 |
35 |
36 | @end
37 |
--------------------------------------------------------------------------------
/FloodFillAlgo2/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "ipad",
5 | "size" : "29x29",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "ipad",
10 | "size" : "29x29",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "ipad",
15 | "size" : "40x40",
16 | "scale" : "1x"
17 | },
18 | {
19 | "idiom" : "ipad",
20 | "size" : "40x40",
21 | "scale" : "2x"
22 | },
23 | {
24 | "idiom" : "ipad",
25 | "size" : "76x76",
26 | "scale" : "1x"
27 | },
28 | {
29 | "idiom" : "ipad",
30 | "size" : "76x76",
31 | "scale" : "2x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/FloodFillAlgo2/Images.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "ipad",
6 | "extent" : "full-screen",
7 | "minimum-system-version" : "7.0",
8 | "scale" : "1x"
9 | },
10 | {
11 | "orientation" : "landscape",
12 | "idiom" : "ipad",
13 | "extent" : "full-screen",
14 | "minimum-system-version" : "7.0",
15 | "scale" : "1x"
16 | },
17 | {
18 | "orientation" : "portrait",
19 | "idiom" : "ipad",
20 | "extent" : "full-screen",
21 | "minimum-system-version" : "7.0",
22 | "scale" : "2x"
23 | },
24 | {
25 | "orientation" : "landscape",
26 | "idiom" : "ipad",
27 | "extent" : "full-screen",
28 | "minimum-system-version" : "7.0",
29 | "scale" : "2x"
30 | }
31 | ],
32 | "info" : {
33 | "version" : 1,
34 | "author" : "xcode"
35 | }
36 | }
--------------------------------------------------------------------------------
/FloodFillAlgo2/MasterViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // MasterViewController.h
3 | // FloodFillAlgo2
4 | //
5 | // Created by Gaurav Singh on 10/10/13.
6 | // Copyright (c) 2013 Gaurav Singh. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @class DetailViewController;
12 |
13 | @interface MasterViewController : UITableViewController
14 |
15 | @property (strong, nonatomic) DetailViewController *detailViewController;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/FloodFillAlgo2/MasterViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // MasterViewController.m
3 | // FloodFillAlgo2
4 | //
5 | // Created by Gaurav Singh on 10/10/13.
6 | // Copyright (c) 2013 Gaurav Singh. All rights reserved.
7 | //
8 |
9 | #import "MasterViewController.h"
10 |
11 | #import "DetailViewController.h"
12 |
13 | @interface MasterViewController () {
14 | NSMutableArray *_objects;
15 | }
16 | @end
17 |
18 | @implementation MasterViewController
19 |
20 | - (void)awakeFromNib
21 | {
22 | self.clearsSelectionOnViewWillAppear = NO;
23 | self.preferredContentSize = CGSizeMake(320.0, 600.0);
24 | [super awakeFromNib];
25 | }
26 |
27 | - (void)viewDidLoad
28 | {
29 | [super viewDidLoad];
30 | // Do any additional setup after loading the view, typically from a nib.
31 | self.navigationItem.leftBarButtonItem = self.editButtonItem;
32 |
33 | NSString *bundleRootPath = [[NSBundle mainBundle] bundlePath];
34 | NSArray *bundleRootContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:bundleRootPath error:nil];
35 | NSArray *files = [bundleRootContents filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"self endswith '.png'"]];
36 |
37 | _objects = [[NSMutableArray alloc] initWithArray:files];
38 |
39 | self.detailViewController = (DetailViewController *)[[self.splitViewController.viewControllers lastObject] topViewController];
40 | }
41 |
42 | - (void)didReceiveMemoryWarning
43 | {
44 | [super didReceiveMemoryWarning];
45 | // Dispose of any resources that can be recreated.
46 | }
47 |
48 |
49 | #pragma mark - Table View
50 |
51 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
52 | {
53 | return 1;
54 | }
55 |
56 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
57 | {
58 | return _objects.count;
59 | }
60 |
61 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
62 | {
63 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];
64 |
65 | NSDate *object = _objects[indexPath.row];
66 | cell.textLabel.text = [object description];
67 | return cell;
68 | }
69 |
70 | - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
71 | {
72 | // Return NO if you do not want the specified item to be editable.
73 | return YES;
74 | }
75 |
76 | - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
77 | {
78 | if (editingStyle == UITableViewCellEditingStyleDelete) {
79 | [_objects removeObjectAtIndex:indexPath.row];
80 | [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
81 | } else if (editingStyle == UITableViewCellEditingStyleInsert) {
82 | // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view.
83 | }
84 | }
85 |
86 | /*
87 | // Override to support rearranging the table view.
88 | - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
89 | {
90 | }
91 | */
92 |
93 | /*
94 | // Override to support conditional rearranging of the table view.
95 | - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
96 | {
97 | // Return NO if you do not want the item to be re-orderable.
98 | return YES;
99 | }
100 | */
101 |
102 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
103 | {
104 | NSDate *object = _objects[indexPath.row];
105 | self.detailViewController.detailItem = object;
106 | }
107 |
108 | @end
109 |
--------------------------------------------------------------------------------
/FloodFillAlgo2/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/1+1=.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/1+1=.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/1+2=.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/1+2=.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/2+2=.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/2+2=.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/2+3=.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/2+3=.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/3+3=.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/3+3=.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/3,1,2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/3,1,2.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/3,5,7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/3,5,7.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/4+5=.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/4+5=.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/5+3=.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/5+3=.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/5+5=.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/5+5=.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/A.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/A.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Ambulance.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Ambulance.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Ant.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Ant.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Apple.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Apple.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/B.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/B.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Bear.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Bear.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Beet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Beet.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Beetle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Beetle.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Bells.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Bells.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Bigfoot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Bigfoot.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Bilberry.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Bilberry.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Boat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Boat.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Bull.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Bull.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Bullfinch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Bullfinch.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Butterfly 1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Butterfly 1.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Butterfly 10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Butterfly 10.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Butterfly 2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Butterfly 2.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Butterfly 3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Butterfly 3.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Butterfly 4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Butterfly 4.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Butterfly 5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Butterfly 5.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Butterfly 6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Butterfly 6.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Butterfly 7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Butterfly 7.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Butterfly 8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Butterfly 8.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Butterfly 9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Butterfly 9.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/C.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/C.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Cabbage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Cabbage.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Candle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Candle.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Car.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Car.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Cat 1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Cat 1.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Cat 2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Cat 2.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Cat 3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Cat 3.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Cat 4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Cat 4.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Cat 5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Cat 5.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Cat 6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Cat 6.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Cat 7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Cat 7.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Cat 8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Cat 8.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Cat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Cat.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Caterpillar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Caterpillar.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Cement mixer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Cement mixer.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Chameleon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Chameleon.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Cherry.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Cherry.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Clownfish.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Clownfish.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Cow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Cow.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Crow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Crow.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/D.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/D.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Dog.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Dog.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Dolphin 2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Dolphin 2.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Dolphin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Dolphin.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Donkey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Donkey.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Dragonfly.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Dragonfly.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Duck.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Duck.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/E.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/E.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Eight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Eight.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/F.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/F.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Fish.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Fish.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Five.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Five.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Fly.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Fly.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Four.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Four.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Fox.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Fox.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Furseal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Furseal.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/G.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/G.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Garlic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Garlic.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Goat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Goat.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Gooseberry.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Gooseberry.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Grapes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Grapes.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Grasshopper.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Grasshopper.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/H.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/H.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Helloween 1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Helloween 1.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Helloween 2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Helloween 2.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Helloween 3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Helloween 3.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Helloween 4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Helloween 4.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Helloween 5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Helloween 5.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Helloween 6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Helloween 6.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Helloween 7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Helloween 7.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Helloween 8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Helloween 8.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Hippocampus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Hippocampus.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Hips.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Hips.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Horse.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Horse.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/I.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/I.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Island.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Island.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/J.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/J.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/K.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/K.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Kozlik.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Kozlik.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/L.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/L.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Lemur.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Lemur.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Lighthouse.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Lighthouse.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/M.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/M.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Magic truck.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Magic truck.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Mantis.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Mantis.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Medusa 2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Medusa 2.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Medusa.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Medusa.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Minivan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Minivan.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Monkey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Monkey.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/N.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/N.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Nine.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Nine.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Numbers.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Numbers.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/O.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/O.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Octopus 2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Octopus 2.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Octopus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Octopus.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/One.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/One.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Orange.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Orange.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Orca.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Orca.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Ornament.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Ornament.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Oslik.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Oslik.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Ove4ka.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Ove4ka.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/P.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/P.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Panda.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Panda.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Parrot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Parrot.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Peacock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Peacock.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Pelikan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Pelikan.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Pig.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Pig.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Pigeon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Pigeon.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Plum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Plum.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Pomegranate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Pomegranate.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Potato.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Potato.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Presents.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Presents.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Pumpkin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Pumpkin.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Q.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Q.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/R.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/R.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Racing car.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Racing car.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Raspberry.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Raspberry.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Redcurrant.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Redcurrant.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Reindeer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Reindeer.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Rooster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Rooster.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/S.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/S.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Santa.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Santa.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Seagull.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Seagull.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Seven.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Seven.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Shark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Shark.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Sheep.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Sheep.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Shells.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Shells.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Shrimp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Shrimp.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Six.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Six.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Snail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Snail.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Snowman.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Snowman.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Sparrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Sparrow.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Spider.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Spider.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Starfish.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Starfish.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Strawberry.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Strawberry.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/T.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/T.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Ten.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Ten.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Three.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Three.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Tomato.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Tomato.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Tow car.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Tow car.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Truck crane.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Truck crane.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Truck.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Truck.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Turtle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Turtle.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Two.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Two.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/U.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/U.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/V.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/V.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/W.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/W.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Wasp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Wasp.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Watermelon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Watermelon.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Whale.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Whale.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Wild strawberry.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Wild strawberry.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/X.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/X.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Y.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Y.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Z.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Z.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Zebra.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Zebra.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp31.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp31.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp32.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp33.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp33.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp34.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp34.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp35.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp35.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp36.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp36.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp37.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp37.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp38.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp38.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp39.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp39.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp40.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp41.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp41.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp42.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp42.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp43.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp43.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp44.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp44.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp45.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp45.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp46.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp46.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp47.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp47.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp48.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp49.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp49.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp50.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp50.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp51.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp51.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp52.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp52.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp53.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp53.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp54.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp54.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp55.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp55.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp56.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp56.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp57.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp58.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp59.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp59.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp60.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp61.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp61.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp62.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp62.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp63.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp63.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp64.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp65.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp65.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp66.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp66.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp67.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp67.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/stamp68.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/stamp68.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/А.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/А.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Б.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Б.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/В.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/В.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Г.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Г.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Д.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Д.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Е.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Е.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Ё.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Ё.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Ж.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Ж.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/З.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/З.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/И.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/И.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Й.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Й.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/К.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/К.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Л.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Л.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/М.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/М.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Н.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Н.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/О.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/О.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/П.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/П.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Р.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Р.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/С.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/С.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Т.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Т.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/У.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/У.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Ф.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Ф.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Х.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Х.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Ц.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Ц.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Ч.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Ч.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Ш.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Ш.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Щ.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Щ.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Ъ.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Ъ.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Ы.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Ы.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Ь.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Ь.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Э.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Э.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Ю.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Ю.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/images/Я.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gauravstomar/Image-fill-color-ObjectiveC/bb49a68a2c0d28a8af440aec01bf31b04753dfec/FloodFillAlgo2/images/Я.png
--------------------------------------------------------------------------------
/FloodFillAlgo2/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // FloodFillAlgo2
4 | //
5 | // Created by Gaurav Singh on 10/10/13.
6 | // Copyright (c) 2013 Gaurav Singh. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | #import "AppDelegate.h"
12 |
13 | int main(int argc, char * argv[])
14 | {
15 | @autoreleasepool {
16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/FloodFillAlgo2/optimized FloodFill/LinkedListStack.h:
--------------------------------------------------------------------------------
1 | //
2 | // LinkedList.h
3 | // FloodFillAlgo2
4 | //
5 | // Created by Gaurav Singh on 10/10/13.
6 | // Copyright (c) 2013 Gaurav Singh. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | #define FINAL_NODE_OFFSET -1
12 | #define INVALID_NODE_CONTENT INT_MIN
13 |
14 | typedef struct PointNode
15 | {
16 | int nextNodeOffset;
17 |
18 | int point;
19 |
20 | } PointNode;
21 |
22 | @interface LinkedListStack : NSObject
23 | {
24 | NSMutableData *nodeCache;
25 |
26 | int freeNodeOffset;
27 | int topNodeOffset;
28 | int _cacheSizeIncrements;
29 |
30 | int multiplier;
31 | }
32 |
33 | - (id)initWithCapacity:(int)capacity incrementSize:(int)increment andMultiplier:(int)mul;
34 | - (id)initWithCapacity:(int)capacity;
35 |
36 | - (void)pushFrontX:(int)x andY:(int)y;
37 | - (int)popFront:(int *)x andY:(int *)y;
38 | @end
39 |
--------------------------------------------------------------------------------
/FloodFillAlgo2/optimized FloodFill/LinkedListStack.m:
--------------------------------------------------------------------------------
1 | //
2 | // LinkedList.m
3 | // FloodFillAlgo2
4 | //
5 | // Created by Gaurav Singh on 10/10/13.
6 | // Copyright (c) 2013 Gaurav Singh. All rights reserved.
7 | //
8 |
9 | #import "LinkedListStack.h"
10 |
11 | @implementation LinkedListStack
12 |
13 | #pragma mark - Initialisation
14 | /*
15 | A linked List is create with size of .
16 | When you add more element that than Lisk List is incressed by size
17 | mul is value for H (for H see comment Stack methods)
18 | */
19 | - (id)init
20 | {
21 | return [self initWithCapacity:500];
22 | }
23 |
24 | - (id)initWithCapacity:(int)capacity
25 | {
26 | return [self initWithCapacity:capacity incrementSize:500 andMultiplier:1000];
27 | }
28 |
29 | - (id)initWithCapacity:(int)capacity incrementSize:(int)increment andMultiplier:(int)mul
30 | {
31 | self = [super init];
32 |
33 | if(self)
34 | {
35 | _cacheSizeIncrements = increment;
36 |
37 | int bytesRequired = capacity * sizeof(PointNode);
38 |
39 | nodeCache = [[NSMutableData alloc] initWithLength:bytesRequired];
40 |
41 | [self initialiseNodesAtOffset:0 count:capacity];
42 |
43 | freeNodeOffset = 0;
44 | topNodeOffset = FINAL_NODE_OFFSET;
45 |
46 | multiplier = mul;
47 | }
48 |
49 | return self;
50 | }
51 |
52 | #pragma mark - Stack methods
53 | /*
54 | X and Y are converted in single integer value (P) to push in stack.
55 | And again that value (P) are converted to X and Y when pop by using following equation:
56 |
57 | P = H * X + Y
58 |
59 | X = P / H;
60 | Y = P % H;
61 |
62 | H is same for all X and Y and must be grater than Y. So generaly Height is prefered value;
63 | */
64 | - (void)pushFrontX:(int)x andY:(int)y;
65 | {
66 | int p = multiplier * x + y;
67 |
68 | PointNode *node = [self getNextFreeNode];
69 |
70 | node->point = p;
71 | node->nextNodeOffset = topNodeOffset;
72 |
73 | topNodeOffset = [self offsetOfNode:node];
74 | }
75 |
76 | - (int)popFront:(int *)x andY:(int *)y;
77 | {
78 | if(topNodeOffset == FINAL_NODE_OFFSET)
79 | {
80 | return INVALID_NODE_CONTENT;
81 | }
82 |
83 | PointNode *node = [self nodeAtOffset:topNodeOffset];
84 |
85 | int thisNodeOffset = topNodeOffset;
86 |
87 | // Remove this node from the queue
88 | topNodeOffset = node->nextNodeOffset;
89 | int value = node->point;
90 |
91 | // Reset it and add it to the free node cache
92 | node->point = 0;
93 | node->nextNodeOffset = freeNodeOffset;
94 |
95 | freeNodeOffset = thisNodeOffset;
96 |
97 | *x = value / multiplier;
98 | *y = value % multiplier;
99 |
100 | return value;
101 | }
102 |
103 | #pragma mark - utility functions
104 | - (int)offsetOfNode:(PointNode *)node
105 | {
106 | return node - (PointNode *)nodeCache.mutableBytes;
107 | }
108 |
109 | - (PointNode *)nodeAtOffset:(int)offset
110 | {
111 | return (PointNode *)nodeCache.mutableBytes + offset;
112 | }
113 |
114 | - (PointNode *)getNextFreeNode
115 | {
116 | if(freeNodeOffset < 0)
117 | {
118 | // Need to extend the size of the nodeCache
119 | int currentSize = nodeCache.length / sizeof(PointNode);
120 | [nodeCache increaseLengthBy:_cacheSizeIncrements * sizeof(PointNode)];
121 |
122 | // Set these new nodes to be the free ones
123 | [self initialiseNodesAtOffset:currentSize count:_cacheSizeIncrements];
124 | freeNodeOffset = currentSize;
125 | }
126 |
127 | PointNode *node = (PointNode*)nodeCache.mutableBytes + freeNodeOffset;
128 | freeNodeOffset = node->nextNodeOffset;
129 |
130 | return node;
131 | }
132 |
133 | - (void)initialiseNodesAtOffset:(int)offset count:(int)count
134 | {
135 | PointNode *node = (PointNode *)nodeCache.mutableBytes + offset;
136 |
137 | for (int i=0; ipoint = 0;
140 | node->nextNodeOffset = offset + i + 1;
141 | node++;
142 | }
143 |
144 | node->point = 0;
145 |
146 | // Set the next node offset to make sure we don't continue
147 | node->nextNodeOffset = FINAL_NODE_OFFSET;
148 | }
149 |
150 | @end
--------------------------------------------------------------------------------
/FloodFillAlgo2/optimized FloodFill/UIImage+FloodFill.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+FloodFill.h
3 | // ImageFloodFilleDemo
4 | //
5 | // Created by chintan on 15/07/13.
6 | // Copyright (c) 2013 ZWT. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "LinkedListStack.h"
11 |
12 | @interface UIImage (FloodFill)
13 |
14 | - (UIImage *) floodFillFromPoint:(CGPoint)startPoint withColor:(UIColor *)newColor andTolerance:(int)tolerance;
15 |
16 | @end
--------------------------------------------------------------------------------
/FloodFillAlgo2/optimized FloodFill/UIImage+FloodFill.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+FloodFill.m
3 | // FloodFillAlgo2
4 | //
5 | // Created by Gaurav Singh on 10/10/13.
6 | // Copyright (c) 2013 Gaurav Singh. All rights reserved.
7 | //
8 |
9 | #import "UIImage+FloodFill.h"
10 |
11 | @implementation UIImage (FloodFill)
12 | /*
13 | startPoint : Point from where you want to color. Generaly this is touch point.
14 | This is important because color at start point will be replaced with other.
15 |
16 | newColor : This color will be apply at point where the match on startPoint color found.
17 |
18 | tolerance : If Tolerance is 0 than it will search for exact match of color
19 | other wise it will take range according to tolerance value.
20 |
21 | If You dont want to use tolerance and want to incress performance Than you can change
22 | compareColor(ocolor, color, tolerance) with just ocolor==color which reduse function call.
23 | */
24 | - (UIImage *) floodFillFromPoint:(CGPoint)startPoint withColor:(UIColor *)newColor andTolerance:(int)tolerance;
25 | {
26 | @try
27 | {
28 | /*
29 | First We create rowData from UIImage.
30 | We require this conversation so that we can use detail at pixel like color at pixel.
31 | You can get some discussion about this topic here:
32 | http://stackoverflow.com/questions/448125/how-to-get-pixel-data-from-a-uiimage-cocoa-touch-or-cgimage-core-graphics
33 | */
34 |
35 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
36 |
37 | CGImageRef imageRef = [self CGImage];
38 |
39 | NSUInteger width = CGImageGetWidth(imageRef);
40 | NSUInteger height = CGImageGetHeight(imageRef);
41 |
42 | unsigned char *imageData = malloc(height * width * 4);
43 |
44 | NSUInteger bytesPerPixel = CGImageGetBitsPerPixel(imageRef) / 8;
45 | NSUInteger bytesPerRow = CGImageGetBytesPerRow(imageRef);
46 | NSUInteger bitsPerComponent = CGImageGetBitsPerComponent(imageRef);
47 |
48 | CGContextRef context = CGBitmapContextCreate(imageData,
49 | width,
50 | height,
51 | bitsPerComponent,
52 | bytesPerRow,
53 | colorSpace,
54 | CGImageGetBitmapInfo(imageRef));
55 | CGColorSpaceRelease(colorSpace);
56 |
57 | CGContextDrawImage(context, CGRectMake(0, 0, width, height), imageRef);
58 |
59 | //Get color at start point
60 | unsigned int byteIndex = (bytesPerRow * startPoint.y) + startPoint.x * bytesPerPixel;
61 |
62 | unsigned int ocolor = getColorCode(byteIndex, imageData);
63 |
64 | //Convert newColor to RGBA value so we can save it to image.
65 | int newRed, newGreen, newBlue, newAlpha;
66 |
67 | const CGFloat *components = CGColorGetComponents(newColor.CGColor);
68 |
69 | /*
70 | If you are not getting why I use CGColorGetNumberOfComponents than read following link:
71 | http://stackoverflow.com/questions/9238743/is-there-an-issue-with-cgcolorgetcomponents
72 | */
73 |
74 | if(CGColorGetNumberOfComponents(newColor.CGColor) == 2)
75 | {
76 | newRed = newGreen = newBlue = components[0] * 255;
77 | newAlpha = components[1];
78 | }
79 | else if (CGColorGetNumberOfComponents(newColor.CGColor) == 4)
80 | {
81 | newRed = components[0] * 255;
82 | newGreen = components[1] * 255;
83 | newBlue = components[2] * 255;
84 | newAlpha = 255;
85 | }
86 |
87 | unsigned int ncolor = (newRed << 24) | (newGreen << 16) | (newBlue << 8) | newAlpha;
88 |
89 | /*
90 | We are using stack to store point.
91 | Stack is implemented by LinkList.
92 | To incress speed I have used NSMutableData insted of NSMutableArray.
93 | To see Detail Of This implementation visit following leink.
94 | http://iwantmyreal.name/blog/2012/09/29/a-faster-array-in-objective-c/
95 | */
96 |
97 | LinkedListStack *points = [[LinkedListStack alloc] initWithCapacity:500 incrementSize:500 andMultiplier:height];
98 |
99 | int x = startPoint.x;
100 | int y = startPoint.y;
101 |
102 | [points pushFrontX:x andY:y];
103 |
104 | /*
105 | This algorithem is prety simple though it llook odd in Objective C syntex.
106 | To get familer with this algorithm visit following link.
107 | http://lodev.org/cgtutor/floodfill.html
108 | You can read hole artical for knowledge.
109 | If you are familer with flood fill than got to Scanline Floodfill Algorithm With Stack (floodFillScanlineStack)
110 | */
111 |
112 | unsigned int color;
113 | BOOL spanLeft,spanRight;
114 |
115 | while ([points popFront:&x andY:&y] != INVALID_NODE_CONTENT)
116 | {
117 | byteIndex = (bytesPerRow * y) + x * bytesPerPixel;
118 |
119 | color = getColorCode(byteIndex, imageData);
120 |
121 | while(y >= 0 && compareColor(ocolor, color, tolerance))
122 | {
123 | y--;
124 |
125 | if(y >= 0)
126 | {
127 | byteIndex = (bytesPerRow * y) + x * bytesPerPixel;
128 |
129 | color = getColorCode(byteIndex, imageData);
130 | }
131 | }
132 |
133 | y++;
134 |
135 | spanLeft = spanRight = NO;
136 |
137 | byteIndex = (bytesPerRow * y) + x * bytesPerPixel;
138 |
139 | color = getColorCode(byteIndex, imageData);
140 |
141 | while (y < height && compareColor(ocolor, color, tolerance) && ncolor != color)
142 | {
143 | //Change old color with newColor RGBA value
144 | imageData[byteIndex + 0] = newRed;
145 | imageData[byteIndex + 1] = newGreen;
146 | imageData[byteIndex + 2] = newBlue;
147 | imageData[byteIndex + 3] = newAlpha;
148 |
149 | if(x > 0)
150 | {
151 | byteIndex = (bytesPerRow * y) + (x - 1) * bytesPerPixel;
152 |
153 | color = getColorCode(byteIndex, imageData);
154 |
155 | if(!spanLeft && x > 0 && compareColor(ocolor, color, tolerance))
156 | {
157 | [points pushFrontX:(x - 1) andY:y];
158 |
159 | spanLeft = YES;
160 | }
161 | else if(spanLeft && x > 0 && !compareColor(ocolor, color, tolerance))
162 | {
163 | spanLeft = NO;
164 | }
165 | }
166 |
167 | if(x < width - 1)
168 | {
169 | byteIndex = (bytesPerRow * y) + (x + 1) * bytesPerPixel;
170 |
171 | color = getColorCode(byteIndex, imageData);
172 |
173 | if(!spanRight && compareColor(ocolor, color, tolerance))
174 | {
175 | [points pushFrontX:(x + 1) andY:y];
176 |
177 | spanRight = YES;
178 | }
179 | else if(spanRight && !compareColor(ocolor, color, tolerance))
180 | {
181 | spanRight = NO;
182 | }
183 | }
184 |
185 | y++;
186 |
187 | if(y < height)
188 | {
189 | byteIndex = (bytesPerRow * y) + x * bytesPerPixel;
190 |
191 | color = getColorCode(byteIndex, imageData);
192 | }
193 | }
194 | }
195 |
196 | //Convert Flood filled image row data back to UIImage object.
197 |
198 | CGImageRef newCGImage = CGBitmapContextCreateImage(context);
199 |
200 | UIImage *result = [UIImage imageWithCGImage:newCGImage];
201 |
202 | CGImageRelease(newCGImage);
203 |
204 | CGContextRelease(context);
205 |
206 | free(imageData);
207 |
208 | return result;
209 | }
210 | @catch (NSException *exception)
211 | {
212 | NSLog(@"Exception : %@", exception);
213 | }
214 | }
215 |
216 | /*
217 | I have used pure C function because it is said than C function is faster than Objective - C method in call.
218 | This two function are called most of time so it require that calling this work in speed.
219 | I have not verified this performance so I like to here comment on this.
220 | */
221 | /*
222 | This function extract color from image and convert it to integer represent.
223 |
224 | Converting to integer make comperation easy.
225 | */
226 | unsigned int getColorCode (unsigned int byteIndex, unsigned char *imageData)
227 | {
228 | unsigned int red = imageData[byteIndex];
229 | unsigned int green = imageData[byteIndex + 1];
230 | unsigned int blue = imageData[byteIndex + 2];
231 | unsigned int alpha = imageData[byteIndex + 3];
232 |
233 | return (red << 24) | (green << 16) | (blue << 8) | alpha;
234 | }
235 |
236 | /*
237 | This function compare two color with counting tolerance value.
238 |
239 | If color is between tolerance rancge than it return true other wise false.
240 | */
241 | bool compareColor (unsigned int color1, unsigned int color2, int tolorance)
242 | {
243 | if(color1 == color2)
244 | return true;
245 |
246 | int red1 = ((0xff000000 & color1) >> 24);
247 | int green1 = ((0x00ff0000 & color1) >> 16);
248 | int blue1 = ((0x0000ff00 & color1) >> 8);
249 | int alpha1 = (0x000000ff & color1);
250 |
251 | int red2 = ((0xff000000 & color2) >> 24);
252 | int green2 = ((0x00ff0000 & color2) >> 16);
253 | int blue2 = ((0x0000ff00 & color2) >> 8);
254 | int alpha2 = (0x000000ff & color2);
255 |
256 | int diffRed = abs(red2 - red1);
257 | int diffGreen = abs(green2 - green1);
258 | int diffBlue = abs(blue2 - blue1);
259 | int diffAlpha = abs(alpha2 - alpha1);
260 |
261 | if( diffRed > tolorance ||
262 | diffGreen > tolorance ||
263 | diffBlue > tolorance ||
264 | diffAlpha > tolorance )
265 | {
266 | return false;
267 | }
268 |
269 | return true;
270 | }
271 | @end
--------------------------------------------------------------------------------
/FloodFillAlgo2Tests/FloodFillAlgo2Tests-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | es.${PRODUCT_NAME:rfc1034identifier}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundlePackageType
14 | BNDL
15 | CFBundleShortVersionString
16 | 1.0
17 | CFBundleSignature
18 | ????
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/FloodFillAlgo2Tests/FloodFillAlgo2Tests.m:
--------------------------------------------------------------------------------
1 | //
2 | // FloodFillAlgo2Tests.m
3 | // FloodFillAlgo2Tests
4 | //
5 | // Created by Gaurav Singh on 10/10/13.
6 | // Copyright (c) 2013 Gaurav Singh. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface FloodFillAlgo2Tests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation FloodFillAlgo2Tests
16 |
17 | - (void)setUp
18 | {
19 | [super setUp];
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 | }
22 |
23 | - (void)tearDown
24 | {
25 | // Put teardown code here. This method is called after the invocation of each test method in the class.
26 | [super tearDown];
27 | }
28 |
29 | - (void)testExample
30 | {
31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
32 | }
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/FloodFillAlgo2Tests/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | FloodFill
2 | =========
3 |
4 | Image color filling API in Objective C
5 |
--------------------------------------------------------------------------------