Skip to content

Instantly share code, notes, and snippets.

View limejelly's full-sized avatar

Aliaksandr Andrashuk limejelly

View GitHub Profile
@soffes
soffes / GPUImageTextureInput+CIImage.h
Last active July 7, 2024 08:51
GPUImage + Core Image
//
// GPUImageTextureInput+CIImage.h
// GPUImage
//
// Created by Sam Soffes on 3/4/14.
// Copyright (c) 2014 Sam Soffes. All rights reserved.
//
#import "GPUImageTextureInput.h"
@victusfate
victusfate / apple bug report.txt
Last active September 29, 2020 09:43
slow export to photo library
Mark Essel10-Aug-2015 02:41 PM
Summary:
The issue specifically arises when a user has iCloud photo backup enabled, and attempts to export a substantial video to the photo library (the longer the video the longer the delay, exponentially slower)
https://gist.github.com/victusfate/8969a70e82c00ae448a7
Steps to Reproduce:
1. turn on icloud photo backup
2. run the attached code snippet in an app for a given videoURL
@shavit
shavit / CoreImageFilters.swift
Created May 12, 2018 18:13
CIFilter opacity
/*
Change the opacity of a CIFilter.
*/
func changeOpacity(to opacity: CGFloat, on filter: CIFilter, original image: UIImage) -> CIImage? {
guard let backgroundImage: CIImage = CIImage(image: image) else { fatalError() }
// The CIColorMatrix filter, will contain the requested filter and control its opacity
guard let overlayFilter: CIFilter = CIFilter(name: "CIColorMatrix") else { fatalError() }
let overlayRgba: [CGFloat] = [0, 0, 0, opacity]
let alphaVector: CIVector = CIVector(values: overlayRgba, count: 4)
@adamgraham
adamgraham / UIColor+HSL.swift
Last active July 6, 2022 02:34
An extension of the iOS class UIColor to provide conversion to and from HSL (hue, saturation, lightness) colors.
/// An extension to provide conversion to and from HSL (hue, saturation, lightness) colors.
extension UIColor {
/// The HSL (hue, saturation, lightness) components of a color.
struct HSL: Hashable {
/// The hue component of the color, in the range [0, 360°].
var hue: CGFloat
/// The saturation component of the color, in the range [0, 100%].
var saturation: CGFloat