減色プログラム
Revision | da245e71c7b6e7ffeaaf7f9084afe17af956db83 (tree) |
---|---|
Time | 2011-05-21 12:21:13 |
Author | berupon <berupon@gmai...> |
Commiter | berupon |
added copyright notice.
@@ -124,6 +124,7 @@ | ||
124 | 124 | EnableEnhancedInstructionSet="2" |
125 | 125 | FloatingPointModel="2" |
126 | 126 | UsePrecompiledHeader="2" |
127 | + BrowseInformation="1" | |
127 | 128 | WarningLevel="3" |
128 | 129 | DebugInformationFormat="3" |
129 | 130 | ForcedIncludeFiles="common.h" |
@@ -144,6 +145,7 @@ | ||
144 | 145 | SubSystem="1" |
145 | 146 | OptimizeReferences="2" |
146 | 147 | EnableCOMDATFolding="2" |
148 | + RandomizedBaseAddress="1" | |
147 | 149 | TargetMachine="1" |
148 | 150 | /> |
149 | 151 | <Tool |
@@ -0,0 +1,6 @@ | ||
1 | + | |
2 | +空間周波数が低いところは、色の広がりの範囲も広いはず。逆に周波数が高いところは色の変化も急激なはず。 | |
3 | + | |
4 | +画像処理で、特徴のあるものを抽出して、減色の判断に利用する。 | |
5 | + | |
6 | +色の要素ごとに重み付けを変えられる作りにしているが計算量が大きいので、簡略化してまとめた処理も用意する。 |
@@ -1,3 +1,34 @@ | ||
1 | +// | |
2 | +// speed optimized scolorq by berupon at gmail dot com | |
3 | +// | |
4 | +// see original copyright notice. | |
5 | +// | |
6 | +// | | |
7 | +// | | |
8 | +// V | |
9 | +// | |
10 | +/* Copyright (c) 2006 Derrick Coetzee | |
11 | + | |
12 | +Permission is hereby granted, free of charge, to any person obtaining | |
13 | +a copy of this software and associated documentation files (the | |
14 | +"Software"), to deal in the Software without restriction, including | |
15 | +without limitation the rights to use, copy, modify, merge, publish, | |
16 | +distribute, sublicense, and/or sell copies of the Software, and to | |
17 | +permit persons to whom the Software is furnished to do so, subject to | |
18 | +the following conditions: | |
19 | + | |
20 | +The above copyright notice and this permission notice shall be | |
21 | +included in all copies or substantial portions of the Software. | |
22 | + | |
23 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |
24 | +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |
25 | +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |
26 | +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | |
27 | +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | |
28 | +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | |
29 | +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |
30 | +*/ | |
31 | + | |
1 | 32 | #include "stdafx.h" |
2 | 33 | |
3 | 34 | #include "quantize.h" |
@@ -292,7 +323,6 @@ void compute_initial_s( | ||
292 | 323 | const double* p_jcv = &coarse_variables(j_x, j_y, v); |
293 | 324 | Color* ps = s.pBuff_ + v * palette_size + v; |
294 | 325 | // TODO: 変更画像、縦方向ではなく横方向に操作する。後で転置。 |
295 | -// TODO: Color4fの全ての要素が同じなので、Array2D<Color4f> ではなく Array2D<float> で処理してみる。 | |
296 | 326 | for (size_t alpha=v; alpha<palette_size; ++alpha) { |
297 | 327 | *ps += (*p_jcv++) * b_ij2; |
298 | 328 | ps += palette_size; |