设为首页 加入收藏

TOP

美图秀秀美化图片之【增强】模块界面与功能设计(六)
2017-10-12 12:09:18 】 浏览:1078
Tags:美图 美化 图片 增强 模块 界面 功能 设计
Image:[UIImage imageNamed:[normalImageArr objectAtIndex:i]] ]; item.title
= [textArr objectAtIndex:i]; [arr addObject:item]; } self.styleBar.items = arr; self.styleBar.delegate = self; [self.styleBar setSelectedItem:[self.styleBar.items objectAtIndex:0]]; [self.view addSubview:self.styleBar]; [self effectBar:self.styleBar didSelectItemAtIndex:0]; } - (void)setupSliderForColorList { UIView *subview = [[UIView alloc] initWithFrame:CGRectMake(0, HEIGHT - 115 - 40, WIDTH, 40)]; subview.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.5]; [self.view addSubview:subview]; self.slider = [[FWSlider alloc] initWithFrame:CGRectZero]; self.slider.minimumValue = -100; self.slider.maximumValue = 100; self.slider.value = 0; self.slider.frame = CGRectMake(WIDTH / 2 - 100, 10, 200, 20); [self.slider addTarget:self action:@selector(updateva lue:) forControlEvents:UIControlEventTouchUpInside]; [self.slider addTarget:self action:@selector(updateTipView:) forControlEvents:UIControlEventValueChanged]; [self.slider setThumbImage:[UIImage imageNamed:@"icon_slider_thumb"] forState:UIControlStateNormal]; [subview addSubview:self.slider]; self.slider.tipView.currentValueLabel.text = [NSString stringWithFormat:@"%f",self.slider.value]; }

 

不同页面的方法

- (void)displayAutoBeautyPage
{
    [self setupImageView];
    [self setupBar];
}

- (void)displayColorListPage
{
    [self setupImageView];
    [self setupBar];
    [self setupSliderForColorList];
}

- (void)displayEditPage
{
    [self setupImageView];
    [self setupBar];
    [self setupButtons];
}

 

 if ([text isEqualToString:@"智能优化"])
    {
        FWFunctionViewController *vc = [[FWFunctionViewController alloc] initWithImage:self.image type:FWBeautyProcessTypeAutoBeauty];
        [self presentViewController:vc animated:YES completion:^{
        }];
        [vc displayAutoBeautyPage];
    }
    else if ([text isEqualToString:@"增强"])
    {
        FWFunctionViewController *vc = [[FWFunctionViewController alloc] initWithImage:self.image type:FWBeautyProcessTypeColorList];
        [self presentViewController:vc animated:YES completion:^{
        }];
        [vc displayColorListPage];
    }
    else if ([text isEqualToString:@"编辑"]) {
        FWFunctionViewController *vc = [[FWFunctionViewController alloc] initWithImage:self.image type:FWBeautyProcessTypeEdit];
        [self presentViewController:vc animated:YES completion:^{
        }];
        [vc displayEditPage];
        
        //                CGRect frame1 = CGRectMake(87.5, 550, 200, 20);
        //                [vc setupSliderWithFrame:frame1];
    }e

 

 

  五、功能实现

1.亮度的实现

+ (UIImage *)changeva lueForBrightnessFilter:(float)value image:(UIImage *)image;
{
    GPUImageBrightnessFilter *filter = [[GPUImageBrightnessFilter alloc] init];
    filter.brightness = value;
    [filter forceProcessingAtSize:image.size];
    GPUImagePicture *pic = [[GPUImagePicture alloc] initWithImage:image];
    [pic addTarget:filter];

    [pic processImage];
    [filter useNextFrameForImageCapture];
    return [filter imageFromCurrentFramebuffer];
}

 

该功能使用了GPUImage库中的GPUImageBrightnessFilter滤镜,具体介绍请参考GPUImage简单滤镜使用(一)

 

2.对比度的实现

GPUImageContrastFilter *filter = [[GPUImageContrastFilter alloc] ini
首页 上一页 3 4 5 6 7 下一页 尾页 6/7/7
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇自定义进度条 下一篇UIButton

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目