From 39584d781547b3cdc873f41d8e3d501438d928d7 Mon Sep 17 00:00:00 2001 From: lmj01 Date: Tue, 21 Nov 2023 17:43:16 +0800 Subject: [PATCH] update --- cg/Color.md | 11 +++++++---- cg/curve.md | 25 +++++++++++++++++++++++++ cg/image/gif.md | 4 ++++ index/article.md | 1 + index/computerScience.md | 1 + index/standard.md | 1 + nodejs/zip.md | 28 ++++++++++++++++++++++++++++ 7 files changed, 67 insertions(+), 4 deletions(-) create mode 100644 cg/curve.md create mode 100644 cg/image/gif.md create mode 100644 nodejs/zip.md diff --git a/cg/Color.md b/cg/Color.md index cc8053a..3a554d4 100644 --- a/cg/Color.md +++ b/cg/Color.md @@ -1,4 +1,5 @@ -# Color +# [Color](https://www.color.org/index.xalter) +> ICC International Color Consortium 色彩主观就是光线给人眼的感觉,客观地说就是人眼对可见光0.43um到0.78um的波长,不同的波长对人眼产生不同的神经信号,传递大脑的感知就是色彩,非可见光人眼是无法感知的。 @@ -36,6 +37,10 @@ HSL/HSV解释:L是指从最暗的黑色到色相纯色再到白色,L最大 ![](../images/cg/hsl_hsv.png) +### [DCI-p3](https://www.color.org/chardata/rgb/DCIP3.xalter) + +js中canvas的颜色getImageData中setting有这个参数 + ## Gamma Correction gamma校正,存在的原因有 @@ -49,14 +54,12 @@ gamma校正,存在的原因有 - gamma meta在不同应用中解释不一致,缺乏标准 - 与RGB应用时,需要转换,否则产生意外的结果 -## 其他 +## HDR 把场景变成数字化的图片,需要光学信号进行采样sampling和数字化,sampling决定了图片的分辨率,即单位尺度内的单位像素的个数;数字化,在常见色彩空间下,用8bits,共256个阶梯来数字化 HDR高动态范围High dynamic range,就是添加更多的动态范围到图片中,人眼对场景采样是有能自动**变焦频率**的,即在明暗对比度比较强烈的场景下人眼都能看得各个部分的细节,但相机等在拍照时由于变焦固定或频率很低,得到的图片就只有一个焦距上的细节,导致细节上的缺失。通过多次曝光,得到不同亮度不同焦距内的细节组合起来提高清晰度,这就是HDR。 - - ## 术语 - 亮度Lightness、Luminance diff --git a/cg/curve.md b/cg/curve.md new file mode 100644 index 0000000..2313da5 --- /dev/null +++ b/cg/curve.md @@ -0,0 +1,25 @@ +# Curve + +## bezier + +## Catmull-Rom + +- uniform +- chordal +- centripetal + +过四个点的曲线(p0,p1,p2,p3)的曲线方程为B(t)=a+b*t+c*t^2+d*t^3 +其切线方程为C(t)=b+2c*t+3*d*t^2 +满足以下条件 +- B(0) = p1 => a = p1 +- C(0) = (p2 - p1) / 2, => b = (P2 - p1) / 2 +- B(1) = p2 => a + b + c + d = p2 +- C(1) = (p3 - p1) / 2 => b + 2c + 3d = (p3 - p1) / 2 +由上面的条件得出 +- a = p1 +- b = (p2 - p1) / 2 +- c = (2p0 - 5p1 + 4p2 - p3) / 2 +- d = (-p0 + 3p1 - 3p2 + p3) / 2 + +[On the Parameterization of Catmull-Rom Curves](http://www.cemyuksel.com/research/catmullrom_param/catmullrom.pdf) + diff --git a/cg/image/gif.md b/cg/image/gif.md new file mode 100644 index 0000000..4db922c --- /dev/null +++ b/cg/image/gif.md @@ -0,0 +1,4 @@ +# GIF + + +- [jsgif: A GIF player in JavaScript](https://slbkbs.org/jsgif/) \ No newline at end of file diff --git a/index/article.md b/index/article.md index 3e225ff..725e30b 100644 --- a/index/article.md +++ b/index/article.md @@ -35,6 +35,7 @@ - [diff算法原理](../nodejs/diff.md) - [electron框架](../nodejs/electron.md) - [quill富文本编辑器](../nodejs/quill.md) +- [压缩](../nodejs/zip.md) ## 整理总结 diff --git a/index/computerScience.md b/index/computerScience.md index 75a1bdd..9785b26 100644 --- a/index/computerScience.md +++ b/index/computerScience.md @@ -42,6 +42,7 @@ ### 网格与CAD - [HalfEdge半边结构](../cg/half-edge.md) - [网格划分](../cg/mesh-generation.md) +- [曲线](../cg/curve.md) - [GMesh]() - [Triangulate Efficient Triangulation Algorithm Suitable for Terrain Modelling or An Algorithm for Interpolating Irregularly-Spaced Data with Applications in Terrain Modelling](http://paulbourke.net/papers/triangulate/) - [多边形网格算法](http://paulbourke.net/geometry/polygonmesh/) diff --git a/index/standard.md b/index/standard.md index 691fdb2..00dbbd4 100644 --- a/index/standard.md +++ b/index/standard.md @@ -35,6 +35,7 @@ - [JPEG](../cg/image//JPEG.md) - [Image Process](../cg/image/ImageProcessing.md) - [CT](../cg/ct.md) +- [gif](../cg/image/gif.md) - [GIMP](../cg/image/gimp.md) - [ImageMagick](../cg/image/imageMagick.md) diff --git a/nodejs/zip.md b/nodejs/zip.md new file mode 100644 index 0000000..3cdb351 --- /dev/null +++ b/nodejs/zip.md @@ -0,0 +1,28 @@ +# 压缩 +> js压缩 + +## jszip + +```js +new Promise(()=>{ + +}).then(res=>{ + // 字符串 + if (res.byteLength < 100) { + const tmp = JSON.parse(new TextDecoder().decode(new Uint8Array(res))); + } else { + const zip = new JSZip(); + zip.loadAsync(res).then(zip=>{ + let i = 0; + for (const fname in zip.files) { + zip.file(fname).async('arraybuffer').then(img=>{ + const blob = new Blob([img]); + i++; + if (i == 4) { + } + }); + } + }); + } +}) +```