//
//  ViewController.m
//  OJAKitDemo
//
//  Created by luxiaoming on 16/7/4.
//  Copyright © 2016年 luxiaoming. All rights reserved.
//

#import "ViewController.h"
#import <Foundation/Foundation.h>
#import "OJAKit.h"
#import "UIImage+YYWebImage.h"



@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    CGFloat width = CGRectGetWidth([UIScreen mainScreen].bounds);
    CGFloat height = CGRectGetHeight([UIScreen mainScreen].bounds);
//    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, width, 300)];
//    imageView.backgroundColor = [UIColor orangeColor];
//    imageView.image = testImage;
//    imageView.contentMode = UIViewContentModeScaleToFill;
    UIImage *originImage = [UIImage imageNamed:@"Jennifer Lynn Connelly.jpg"];//510*288 1x
    UIImage *testImage = [UIImage imageNamed:@"Jennifer Lynn Connelly.jpg"];//510*288 1x
//    testImage = [testImage oja_imageByResizeToSize:CGSizeMake(200, 400)];
//    testImage = [testImage oja_imageByResizeToSize:CGSizeMake(200, 400) contentMode:UIViewContentModeScaleToFill];
//    testImage = [testImage oja_imageByCropToRect:CGRectMake(0, 0, 800, 400)];
//    testImage = [testImage oja_imageByInsetEdge:UIEdgeInsetsMake(-10, -150, -10, -150) withColor:[UIColor redColor]];
//    testImage = [testImage oja_imageByInsetEdge:UIEdgeInsetsMake(10, 150, 10, 150) withColor:[UIColor redColor]];
    
    
//    testImage = [testImage oja_imageByRoundCornerRadius:100 corners:UIRectCornerTopLeft borderWidth:5 borderColor:[UIColor redColor] borderLineJoin:kCGLineJoinMiter];
//    testImage = [testImage yy_imageByRoundCornerRadius:10 corners:UIRectCornerTopLeft borderWidth:5 borderColor:[UIColor redColor] borderLineJoin:kCGLineJoinMiter];
    
    originImage = [originImage oja_imageByRotate:45 / 180.0 * M_PI fitSize:YES];
    testImage = [testImage yy_imageByRotate:45 / 180.0 * M_PI fitSize:YES];
//    testImage = [testImage oja_imageByRotate:45 / 180.0 * M_PI fitSize:NO];
//    testImage = [testImage yy_imageByTintColor:[UIColor redColor]];
//    testImage = [testImage yy_imageByBlurWithTint:[UIColor redColor]];
//    testImage = [testImage yy_imageByBlurLight];
//    testImage = [testImage yy_imageByGrayscale];
    
    
    UIImageView *imageView = [[UIImageView alloc] initWithImage:testImage];
    imageView.frame = CGRectMake(0, 0, 320, 280);
    imageView.backgroundColor = [UIColor orangeColor];
    imageView.contentMode = UIViewContentModeScaleAspectFit;
    [self.view addSubview:imageView];
    
    UIImageView *originImageView = [[UIImageView alloc] initWithImage:originImage];
    originImageView.frame = CGRectMake(0, 288, 320, 280);
    originImageView.backgroundColor = [UIColor orangeColor];
    originImageView.contentMode = UIViewContentModeScaleAspectFit;
    [self.view addSubview:originImageView];

    [originImageView setAllCornerRadius:10];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
