Comments (8)
You are the king! Really appreciate for your support.
from fmphotopicker.
Thanks for those kind words.
Can you post your current configuration here? Then I can give you some suggestion.
from fmphotopicker.
Hi again,
Into FMFilter.swift file, I've added my new filter, where applicable.
Then, in Const.swift file, I've added new filter name into kDefaultAvailableFilters.
Now at the end of the slide, I can see the new filter name, however it does not have any functionality, and I cannot find where to add the filter code.
from fmphotopicker.
@barisnurlu
Can you post your configuration? It's easy for me to understand how you are using the lib.
from fmphotopicker.
Let me put it in this way. I implemented BBMetalImage pod into my project. It is simply working as following:
let source = BBMetalStaticImageSource(image: myImage!)
source.add(consumer: BBMetalAddBlendFilter())
myImage = BBMetalAddBlendFilter().bbimage
So I want to run this code when user clicks.
from fmphotopicker.
Firstly, you have to define your custom filters type by adopting the FMFilterable
protocol.
For example:
struct MyFilter1: FMFilterable {
func filter(image: UIImage) -> UIImage {
// do whatever to get the filtered image synchronously.
// https://github.com/Silence-GitHub/BBMetalImage#process-image-synchronously
}
func filterName() -> String {
// return the name that will be used in the filter screen
}
}
Then define all filters you want to use by assigning them to the availableFilters
.
config.availableFilters = [
MyFilter1(),
MyFilter2(),
MyFilter3(),
// ...
]
Then instantiate FMPhotoPickerViewController or FMImageEditorViewController using the configuration above
let editor = FMImageEditorViewController(config: config, sourceImage: yourImage)
let picker = FMPhotoPickerViewController(config: config)
And now you can see your custom filters in the filter screen.
from fmphotopicker.
I really really appreciate for your support. It did work!
One more question: When I add config.availableFilters = [MyFilter()], it removes all previously built filters. How can I append, instead of overwrite the existing ones.
from fmphotopicker.
You can config like this:
config.availableFilters = [
FMFilter.None,
FMFilter.CIPhotoEffectChrome,
FMFilter.CIPhotoEffectInstant,
FMFilter.CIPhotoEffectMono,
FMFilter.CIPhotoEffectProcess,
FMFilter.CIPhotoEffectTransfer,
FMFilter.CISepiaTone,
FMFilter.CIPhotoEffectNoir,
FMFilter.CIMinimumComponent,
FMFilter.CIColorPosterize,
FMFilter.CIColorMonochrome,
FMFilter.CIColorCrossPolynomial,
FMFilter.CIColorCube,
FMFilter.CIColorCubeWithColorSpace,
FMFilter.CIColorInvert,
FMFilter.CIFalseColor,
FMFilter.CIPhotoEffectFade,
FMFilter.CIPhotoEffectTonal,
FMFilter.CIVignette,
MyFilter1(),
MyFilter2(),
MyFilter3(),
// ...
]
from fmphotopicker.
Related Issues (20)
- Swift Package Manager HOT 2
- CocoaPods installing error HOT 2
- Package Resolution Found HOT 1
- Carthage build error HOT 4
- [Feature Request] Configurable Fonts & Colors HOT 2
- Dark mode support HOT 1
- Image rotation functionality when we edit the image. HOT 2
- How to play video asset?
- Survey about Open Source Image editors for Master's thesis HOT 2
- SDK crashes while showing warning HOT 2
- How to disable photo Editing mode. HOT 1
- select More photos
- Can I support Dark/Light theme ??
- Guys. Now I start support in my personal repo (+dark mode)
- crash when preview a video asset
- Crash ,in iOS 13 and up version,UIApplication.shared.delegate?.window??.rootViewController = nil
- Picc
- No way to know the editing was cancelled.
- How we can add current choose to open FMPhotoPicker viewcontroller again? HOT 1
- Uuu
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fmphotopicker.