For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.
| int[][] result; | |
| float t, c; | |
| float ease(float p) { | |
| return 3*p*p - 2*p*p*p; | |
| } | |
| float ease(float p, float g) { | |
| if (p < 0.5) | |
| return 0.5 * pow(2*p, g); |
| /* global chrome, MediaRecorder, FileReader */ | |
| chrome.runtime.onConnect.addListener(port => { | |
| let recorder = null | |
| port.onMessage.addListener(msg => { | |
| console.log(msg); | |
| switch (msg.type) { | |
| case 'REC_STOP': | |
| console.log('Stopping recording') | |
| if (!port.recorderPlaying || !recorder) { |
| int seed = int(random(999999)); | |
| void setup() { | |
| size(960, 960, P2D); | |
| smooth(8); | |
| pixelDensity(2); | |
| rectMode(CENTER); | |
| generate(); |
| //dynamic parenting for 3d layers | |
| //from Dan Ebberts on forums I think.. | |
| //Position | |
| L=thisComp.layer("Object center"); | |
| L.toWorld(L.effect(name)("3D Point")); | |
| //Scale | |
| L =thisComp.layer("Object center"); | |
| [L.transform.scale[0]/100*value[0],L.transform.scale[1]/100*value[1],L.transform.scale[2]/100*value[2]]; |
| /** | |
| * @file get/set caret position and insert text | |
| * @author islishude | |
| * @license MIT | |
| */ | |
| export class Caret { | |
| /** | |
| * get/set caret position | |
| * @param {HTMLColletion} target | |
| */ |
Last updated 2020/03/04
Some links from twitter on the topic of parsing PSD files (haven't looked into them in details). PSD include a flattened rasterized image so this is easy to load if that's the only thing you need. Most software / librairies have support for extracting this flattened data (e.g. stb_image.h does).
However if you want access to individual layers, render non-rasterized layers, emulate every photoshop features, extract or apply effects with more granularity, more code is needed. May range from easy to lots-of-work depending on what exactly you need.
As far as I know there isn't a trivial stb-like ready-to-use C++ library to do that sort of things. Posting all links here. Some are probably bloated or hard to use into your project, some lacking features.
TODO: Actually look into the pros/cons of all those.
| import ( | |
| "compress/gzip" | |
| "fmt" | |
| "io" | |
| "os" | |
| "path/filepath" | |
| "strings" | |
| ) | |
| func gzipit(source, target string) error { |
| # | |
| # Makefile to perform "live code reloading" after changes to .go files. | |
| # | |
| # n.b. you must install fswatch (OS X: `brew install fswatch`) | |
| # | |
| # To start live reloading run the following command: | |
| # $ make serve | |
| # | |
| # binary name to kill/restart |
| /** | |
| * K.jpg's OpenSimplex 2, smooth variant ("SuperSimplex") | |
| * | |
| * More language ports, as well as legacy 2014 OpenSimplex, can be found here: | |
| * https://github.com/KdotJPG/OpenSimplex2 | |
| */ | |
| public class OpenSimplex2S { | |
| private static final long PRIME_X = 0x5205402B9270C86FL; |