commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject svn commit: r935812 [20/46] - in /websites/production/commons/content/proper/commons-imaging: ./ apidocs/ apidocs/org/apache/commons/imaging/ apidocs/org/apache/commons/imaging/class-use/ apidocs/org/apache/commons/imaging/color/ apidocs/org/apache/com...
Date Sun, 11 Jan 2015 12:33:28 GMT
Propchange: websites/production/commons/content/proper/commons-imaging/apidocs/src-html/org/apache/commons/imaging/palette/MedianCut.html
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: websites/production/commons/content/proper/commons-imaging/apidocs/src-html/org/apache/commons/imaging/palette/MedianCutQuantizer.html
==============================================================================
--- websites/production/commons/content/proper/commons-imaging/apidocs/src-html/org/apache/commons/imaging/palette/MedianCutQuantizer.html
(original)
+++ websites/production/commons/content/proper/commons-imaging/apidocs/src-html/org/apache/commons/imaging/palette/MedianCutQuantizer.html
Sun Jan 11 12:33:25 2015
@@ -91,7 +91,7 @@
 <span class="sourceLineNo">083</span>    }<a name="line.83"></a>
 <span class="sourceLineNo">084</span>    <a name="line.84"></a>
 <span class="sourceLineNo">085</span>    public Palette process(final BufferedImage
image, final int maxColors,<a name="line.85"></a>
-<span class="sourceLineNo">086</span>            final MedianCutImplementation
medianCutImplementation, final boolean verbose)<a name="line.86"></a>
+<span class="sourceLineNo">086</span>            final MedianCut medianCut, final
boolean verbose)<a name="line.86"></a>
 <span class="sourceLineNo">087</span>            throws ImageWriteException {<a
name="line.87"></a>
 <span class="sourceLineNo">088</span>        final Map&lt;Integer, ColorCount&gt;
colorMap = groupColors(image, maxColors);<a name="line.88"></a>
 <span class="sourceLineNo">089</span><a name="line.89"></a>
@@ -125,7 +125,7 @@
 <span class="sourceLineNo">117</span>        colorGroups.add(root);<a name="line.117"></a>
 <span class="sourceLineNo">118</span><a name="line.118"></a>
 <span class="sourceLineNo">119</span>        while (colorGroups.size() &lt;
maxColors) {<a name="line.119"></a>
-<span class="sourceLineNo">120</span>            if (!medianCutImplementation.performNextMedianCut(colorGroups,
ignoreAlpha)) {<a name="line.120"></a>
+<span class="sourceLineNo">120</span>            if (!medianCut.performNextMedianCut(colorGroups,
ignoreAlpha)) {<a name="line.120"></a>
 <span class="sourceLineNo">121</span>                break;<a name="line.121"></a>
 <span class="sourceLineNo">122</span>            }<a name="line.122"></a>
 <span class="sourceLineNo">123</span>        }<a name="line.123"></a>

Added: websites/production/commons/content/proper/commons-imaging/apidocs/src-html/org/apache/commons/imaging/palette/MostPopulatedBoxesMedianCut.html
==============================================================================
--- websites/production/commons/content/proper/commons-imaging/apidocs/src-html/org/apache/commons/imaging/palette/MostPopulatedBoxesMedianCut.html
(added)
+++ websites/production/commons/content/proper/commons-imaging/apidocs/src-html/org/apache/commons/imaging/palette/MostPopulatedBoxesMedianCut.html
Sun Jan 11 12:33:25 2015
@@ -0,0 +1,234 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="de">
+<head>
+<title>Source code</title>
+<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
+</head>
+<body>
+<div class="sourceContainer">
+<pre><span class="sourceLineNo">001</span>/*<a name="line.1"></a>
+<span class="sourceLineNo">002</span> * Licensed to the Apache Software Foundation
(ASF) under one or more<a name="line.2"></a>
+<span class="sourceLineNo">003</span> * contributor license agreements.  See
the NOTICE file distributed with<a name="line.3"></a>
+<span class="sourceLineNo">004</span> * this work for additional information
regarding copyright ownership.<a name="line.4"></a>
+<span class="sourceLineNo">005</span> * The ASF licenses this file to You under
the Apache License, Version 2.0<a name="line.5"></a>
+<span class="sourceLineNo">006</span> * (the "License"); you may not use this
file except in compliance with<a name="line.6"></a>
+<span class="sourceLineNo">007</span> * the License.  You may obtain a copy of
the License at<a name="line.7"></a>
+<span class="sourceLineNo">008</span> *<a name="line.8"></a>
+<span class="sourceLineNo">009</span> *      http://www.apache.org/licenses/LICENSE-2.0<a
name="line.9"></a>
+<span class="sourceLineNo">010</span> *<a name="line.10"></a>
+<span class="sourceLineNo">011</span> * Unless required by applicable law or
agreed to in writing, software<a name="line.11"></a>
+<span class="sourceLineNo">012</span> * distributed under the License is distributed
on an "AS IS" BASIS,<a name="line.12"></a>
+<span class="sourceLineNo">013</span> * WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.<a name="line.13"></a>
+<span class="sourceLineNo">014</span> * See the License for the specific language
governing permissions and<a name="line.14"></a>
+<span class="sourceLineNo">015</span> * limitations under the License.<a name="line.15"></a>
+<span class="sourceLineNo">016</span> */<a name="line.16"></a>
+<span class="sourceLineNo">017</span>package org.apache.commons.imaging.palette;<a
name="line.17"></a>
+<span class="sourceLineNo">018</span><a name="line.18"></a>
+<span class="sourceLineNo">019</span>import java.io.Serializable;<a name="line.19"></a>
+<span class="sourceLineNo">020</span>import java.util.ArrayList;<a name="line.20"></a>
+<span class="sourceLineNo">021</span>import java.util.Collections;<a name="line.21"></a>
+<span class="sourceLineNo">022</span>import java.util.Comparator;<a name="line.22"></a>
+<span class="sourceLineNo">023</span>import java.util.List;<a name="line.23"></a>
+<span class="sourceLineNo">024</span><a name="line.24"></a>
+<span class="sourceLineNo">025</span>import org.apache.commons.imaging.ImageWriteException;<a
name="line.25"></a>
+<span class="sourceLineNo">026</span><a name="line.26"></a>
+<span class="sourceLineNo">027</span>public class MostPopulatedBoxesMedianCut
implements MedianCut {<a name="line.27"></a>
+<span class="sourceLineNo">028</span><a name="line.28"></a>
+<span class="sourceLineNo">029</span>    public boolean performNextMedianCut(final
List&lt;ColorGroup&gt; colorGroups,<a name="line.29"></a>
+<span class="sourceLineNo">030</span>            final boolean ignoreAlpha) throws
ImageWriteException {<a name="line.30"></a>
+<span class="sourceLineNo">031</span>        int maxPoints = 0;<a name="line.31"></a>
+<span class="sourceLineNo">032</span>        ColorGroup colorGroup = null;<a
name="line.32"></a>
+<span class="sourceLineNo">033</span>        for (ColorGroup group : colorGroups)
{<a name="line.33"></a>
+<span class="sourceLineNo">034</span>            if (group.maxDiff &gt; 0)
{<a name="line.34"></a>
+<span class="sourceLineNo">035</span>                if (group.totalPoints &gt;
maxPoints) {<a name="line.35"></a>
+<span class="sourceLineNo">036</span>                    colorGroup = group;<a
name="line.36"></a>
+<span class="sourceLineNo">037</span>                    maxPoints = group.totalPoints;<a
name="line.37"></a>
+<span class="sourceLineNo">038</span>                }<a name="line.38"></a>
+<span class="sourceLineNo">039</span>            }<a name="line.39"></a>
+<span class="sourceLineNo">040</span>        }<a name="line.40"></a>
+<span class="sourceLineNo">041</span>        if (colorGroup == null) {<a name="line.41"></a>
+<span class="sourceLineNo">042</span>            return false;<a name="line.42"></a>
+<span class="sourceLineNo">043</span>        }<a name="line.43"></a>
+<span class="sourceLineNo">044</span>        <a name="line.44"></a>
+<span class="sourceLineNo">045</span>        <a name="line.45"></a>
+<span class="sourceLineNo">046</span>        <a name="line.46"></a>
+<span class="sourceLineNo">047</span>        double bestScore = Double.MAX_VALUE;<a
name="line.47"></a>
+<span class="sourceLineNo">048</span>        ColorComponent bestColorComponent
= null;<a name="line.48"></a>
+<span class="sourceLineNo">049</span>        int bestMedianIndex = -1;<a name="line.49"></a>
+<span class="sourceLineNo">050</span>        for (final ColorComponent colorComponent
: ColorComponent.values()) {<a name="line.50"></a>
+<span class="sourceLineNo">051</span>            if (ignoreAlpha &amp;&amp;
colorComponent == ColorComponent.ALPHA) {<a name="line.51"></a>
+<span class="sourceLineNo">052</span>                continue;<a name="line.52"></a>
+<span class="sourceLineNo">053</span>            }<a name="line.53"></a>
+<span class="sourceLineNo">054</span>            Collections.sort(colorGroup.colorCounts,
new ColorComparer(colorComponent));<a name="line.54"></a>
+<span class="sourceLineNo">055</span>            final int countHalf = (int)
Math.round((double) colorGroup.totalPoints / 2);<a name="line.55"></a>
+<span class="sourceLineNo">056</span>            int oldCount = 0;<a name="line.56"></a>
+<span class="sourceLineNo">057</span>            int newCount = 0;<a name="line.57"></a>
+<span class="sourceLineNo">058</span>            int medianIndex;<a name="line.58"></a>
+<span class="sourceLineNo">059</span>            for (medianIndex = 0; medianIndex
&lt; colorGroup.colorCounts.size(); medianIndex++) {<a name="line.59"></a>
+<span class="sourceLineNo">060</span>                final ColorCount colorCount
= colorGroup.colorCounts.get(medianIndex);<a name="line.60"></a>
+<span class="sourceLineNo">061</span>    <a name="line.61"></a>
+<span class="sourceLineNo">062</span>                newCount += colorCount.count;<a
name="line.62"></a>
+<span class="sourceLineNo">063</span>    <a name="line.63"></a>
+<span class="sourceLineNo">064</span>                if (newCount &lt; countHalf)
{<a name="line.64"></a>
+<span class="sourceLineNo">065</span>                    oldCount = newCount;<a
name="line.65"></a>
+<span class="sourceLineNo">066</span>                } else {<a name="line.66"></a>
+<span class="sourceLineNo">067</span>                    break;<a name="line.67"></a>
+<span class="sourceLineNo">068</span>                }<a name="line.68"></a>
+<span class="sourceLineNo">069</span>            }<a name="line.69"></a>
+<span class="sourceLineNo">070</span>            if (medianIndex == colorGroup.colorCounts.size()
- 1) {<a name="line.70"></a>
+<span class="sourceLineNo">071</span>                medianIndex--;<a name="line.71"></a>
+<span class="sourceLineNo">072</span>            } else if (medianIndex &gt;
0) {<a name="line.72"></a>
+<span class="sourceLineNo">073</span>                final int newDiff = Math.abs(newCount
- countHalf);<a name="line.73"></a>
+<span class="sourceLineNo">074</span>                final int oldDiff = Math.abs(countHalf
- oldCount);<a name="line.74"></a>
+<span class="sourceLineNo">075</span>                if (oldDiff &lt; newDiff)
{<a name="line.75"></a>
+<span class="sourceLineNo">076</span>                    medianIndex--;<a
name="line.76"></a>
+<span class="sourceLineNo">077</span>                }<a name="line.77"></a>
+<span class="sourceLineNo">078</span>            }<a name="line.78"></a>
+<span class="sourceLineNo">079</span><a name="line.79"></a>
+<span class="sourceLineNo">080</span>            final List&lt;ColorCount&gt;
lowerColors = new ArrayList&lt;ColorCount&gt;(<a name="line.80"></a>
+<span class="sourceLineNo">081</span>                    colorGroup.colorCounts.subList(0,
medianIndex + 1));<a name="line.81"></a>
+<span class="sourceLineNo">082</span>            final List&lt;ColorCount&gt;
upperColors = new ArrayList&lt;ColorCount&gt;(<a name="line.82"></a>
+<span class="sourceLineNo">083</span>                    colorGroup.colorCounts.subList(medianIndex
+ 1,<a name="line.83"></a>
+<span class="sourceLineNo">084</span>                            colorGroup.colorCounts.size()));<a
name="line.84"></a>
+<span class="sourceLineNo">085</span>            if (lowerColors.isEmpty() ||
upperColors.isEmpty()) {<a name="line.85"></a>
+<span class="sourceLineNo">086</span>                continue;<a name="line.86"></a>
+<span class="sourceLineNo">087</span>            }<a name="line.87"></a>
+<span class="sourceLineNo">088</span>            final ColorGroup lowerGroup
= new ColorGroup(lowerColors, ignoreAlpha);<a name="line.88"></a>
+<span class="sourceLineNo">089</span>            final ColorGroup upperGroup
= new ColorGroup(upperColors, ignoreAlpha);<a name="line.89"></a>
+<span class="sourceLineNo">090</span>            final int diff = Math.abs(lowerGroup.totalPoints
- upperGroup.totalPoints);<a name="line.90"></a>
+<span class="sourceLineNo">091</span>            final double score = diff /
(double) Math.max(lowerGroup.totalPoints, upperGroup.totalPoints);<a name="line.91"></a>
+<span class="sourceLineNo">092</span>            if (score &lt; bestScore)
{<a name="line.92"></a>
+<span class="sourceLineNo">093</span>                bestScore = score;<a
name="line.93"></a>
+<span class="sourceLineNo">094</span>                bestColorComponent = colorComponent;<a
name="line.94"></a>
+<span class="sourceLineNo">095</span>                bestMedianIndex = medianIndex;<a
name="line.95"></a>
+<span class="sourceLineNo">096</span>            }<a name="line.96"></a>
+<span class="sourceLineNo">097</span>        }<a name="line.97"></a>
+<span class="sourceLineNo">098</span><a name="line.98"></a>
+<span class="sourceLineNo">099</span>        if (bestColorComponent == null)
{<a name="line.99"></a>
+<span class="sourceLineNo">100</span>            return false;<a name="line.100"></a>
+<span class="sourceLineNo">101</span>        }<a name="line.101"></a>
+<span class="sourceLineNo">102</span>        <a name="line.102"></a>
+<span class="sourceLineNo">103</span>        Collections.sort(colorGroup.colorCounts,
new ColorComparer(bestColorComponent));<a name="line.103"></a>
+<span class="sourceLineNo">104</span>        final List&lt;ColorCount&gt;
lowerColors = new ArrayList&lt;ColorCount&gt;(<a name="line.104"></a>
+<span class="sourceLineNo">105</span>                colorGroup.colorCounts.subList(0,
bestMedianIndex + 1));<a name="line.105"></a>
+<span class="sourceLineNo">106</span>        final List&lt;ColorCount&gt;
upperColors = new ArrayList&lt;ColorCount&gt;(<a name="line.106"></a>
+<span class="sourceLineNo">107</span>                colorGroup.colorCounts.subList(bestMedianIndex
+ 1,<a name="line.107"></a>
+<span class="sourceLineNo">108</span>                        colorGroup.colorCounts.size()));<a
name="line.108"></a>
+<span class="sourceLineNo">109</span>        final ColorGroup lowerGroup = new
ColorGroup(lowerColors, ignoreAlpha);<a name="line.109"></a>
+<span class="sourceLineNo">110</span>        final ColorGroup upperGroup = new
ColorGroup(upperColors, ignoreAlpha);<a name="line.110"></a>
+<span class="sourceLineNo">111</span>        colorGroups.remove(colorGroup);<a
name="line.111"></a>
+<span class="sourceLineNo">112</span>        colorGroups.add(lowerGroup);<a
name="line.112"></a>
+<span class="sourceLineNo">113</span>        colorGroups.add(upperGroup);<a
name="line.113"></a>
+<span class="sourceLineNo">114</span>        <a name="line.114"></a>
+<span class="sourceLineNo">115</span>        final ColorCount medianValue = colorGroup.colorCounts.get(bestMedianIndex);<a
name="line.115"></a>
+<span class="sourceLineNo">116</span>        int limit;<a name="line.116"></a>
+<span class="sourceLineNo">117</span>        switch (bestColorComponent) {<a
name="line.117"></a>
+<span class="sourceLineNo">118</span>            case ALPHA:<a name="line.118"></a>
+<span class="sourceLineNo">119</span>                limit = medianValue.alpha;<a
name="line.119"></a>
+<span class="sourceLineNo">120</span>                break;<a name="line.120"></a>
+<span class="sourceLineNo">121</span>            case RED:<a name="line.121"></a>
+<span class="sourceLineNo">122</span>                limit = medianValue.red;<a
name="line.122"></a>
+<span class="sourceLineNo">123</span>                break;<a name="line.123"></a>
+<span class="sourceLineNo">124</span>            case GREEN:<a name="line.124"></a>
+<span class="sourceLineNo">125</span>                limit = medianValue.green;<a
name="line.125"></a>
+<span class="sourceLineNo">126</span>                break;<a name="line.126"></a>
+<span class="sourceLineNo">127</span>            case BLUE:<a name="line.127"></a>
+<span class="sourceLineNo">128</span>                limit = medianValue.blue;<a
name="line.128"></a>
+<span class="sourceLineNo">129</span>                break;<a name="line.129"></a>
+<span class="sourceLineNo">130</span>            default:<a name="line.130"></a>
+<span class="sourceLineNo">131</span>                throw new Error("Bad mode.");<a
name="line.131"></a>
+<span class="sourceLineNo">132</span>        }<a name="line.132"></a>
+<span class="sourceLineNo">133</span>        colorGroup.cut = new ColorGroupCut(lowerGroup,
upperGroup, bestColorComponent, limit);<a name="line.133"></a>
+<span class="sourceLineNo">134</span>        return true;<a name="line.134"></a>
+<span class="sourceLineNo">135</span>    }<a name="line.135"></a>
+<span class="sourceLineNo">136</span>    <a name="line.136"></a>
+<span class="sourceLineNo">137</span>    private static class ColorComparer implements
Comparator&lt;ColorCount&gt;, Serializable {<a name="line.137"></a>
+<span class="sourceLineNo">138</span>        private static final long serialVersionUID
= 1L;<a name="line.138"></a>
+<span class="sourceLineNo">139</span>        <a name="line.139"></a>
+<span class="sourceLineNo">140</span>        private final ColorComponent colorComponent;<a
name="line.140"></a>
+<span class="sourceLineNo">141</span>        <a name="line.141"></a>
+<span class="sourceLineNo">142</span>        public ColorComparer(final ColorComponent
colorComponent) {<a name="line.142"></a>
+<span class="sourceLineNo">143</span>            this.colorComponent = colorComponent;<a
name="line.143"></a>
+<span class="sourceLineNo">144</span>        }<a name="line.144"></a>
+<span class="sourceLineNo">145</span>        <a name="line.145"></a>
+<span class="sourceLineNo">146</span>        public int compare(final ColorCount
c1, final ColorCount c2) {<a name="line.146"></a>
+<span class="sourceLineNo">147</span>            switch (colorComponent) {<a
name="line.147"></a>
+<span class="sourceLineNo">148</span>                case ALPHA:<a name="line.148"></a>
+<span class="sourceLineNo">149</span>                    return c1.alpha - c2.alpha;<a
name="line.149"></a>
+<span class="sourceLineNo">150</span>                case RED:<a name="line.150"></a>
+<span class="sourceLineNo">151</span>                    return c1.red - c2.red;<a
name="line.151"></a>
+<span class="sourceLineNo">152</span>                case GREEN:<a name="line.152"></a>
+<span class="sourceLineNo">153</span>                    return c1.green - c2.green;<a
name="line.153"></a>
+<span class="sourceLineNo">154</span>                case BLUE:<a name="line.154"></a>
+<span class="sourceLineNo">155</span>                    return c1.blue - c2.blue;<a
name="line.155"></a>
+<span class="sourceLineNo">156</span>                default:<a name="line.156"></a>
+<span class="sourceLineNo">157</span>                    return 0;<a name="line.157"></a>
+<span class="sourceLineNo">158</span>            }<a name="line.158"></a>
+<span class="sourceLineNo">159</span>        }<a name="line.159"></a>
+<span class="sourceLineNo">160</span>    }<a name="line.160"></a>
+<span class="sourceLineNo">161</span><a name="line.161"></a>
+<span class="sourceLineNo">162</span>}<a name="line.162"></a>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</pre>
+</div>
+</body>
+</html>
\ No newline at end of file

Propchange: websites/production/commons/content/proper/commons-imaging/apidocs/src-html/org/apache/commons/imaging/palette/MostPopulatedBoxesMedianCut.html
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: websites/production/commons/content/proper/commons-imaging/apidocs/src-html/org/apache/commons/imaging/palette/Palette.html
==============================================================================
--- websites/production/commons/content/proper/commons-imaging/apidocs/src-html/org/apache/commons/imaging/palette/Palette.html
(original)
+++ websites/production/commons/content/proper/commons-imaging/apidocs/src-html/org/apache/commons/imaging/palette/Palette.html
Sun Jan 11 12:33:25 2015
@@ -30,7 +30,7 @@
 <span class="sourceLineNo">022</span>/**<a name="line.22"></a>
 <span class="sourceLineNo">023</span> * Color palette.<a name="line.23"></a>
 <span class="sourceLineNo">024</span> */<a name="line.24"></a>
-<span class="sourceLineNo">025</span>public abstract class Palette {<a name="line.25"></a>
+<span class="sourceLineNo">025</span>public interface Palette {<a name="line.25"></a>
 <span class="sourceLineNo">026</span><a name="line.26"></a>
 <span class="sourceLineNo">027</span>    /**<a name="line.27"></a>
 <span class="sourceLineNo">028</span>     * Looks up the palette index for a
given color.<a name="line.28"></a>
@@ -38,27 +38,22 @@
 <span class="sourceLineNo">030</span>     * @return the palette index<a name="line.30"></a>
 <span class="sourceLineNo">031</span>     * @throws ImageWriteException<a
name="line.31"></a>
 <span class="sourceLineNo">032</span>     */<a name="line.32"></a>
-<span class="sourceLineNo">033</span>    public abstract int getPaletteIndex(int
rgb) throws ImageWriteException;<a name="line.33"></a>
+<span class="sourceLineNo">033</span>    int getPaletteIndex(int rgb) throws
ImageWriteException;<a name="line.33"></a>
 <span class="sourceLineNo">034</span><a name="line.34"></a>
 <span class="sourceLineNo">035</span>    /**<a name="line.35"></a>
 <span class="sourceLineNo">036</span>     * Looks up the color for a given palette
index.<a name="line.36"></a>
 <span class="sourceLineNo">037</span>     * @param index the palette index to
look up<a name="line.37"></a>
 <span class="sourceLineNo">038</span>     * @return the color in ARGB format<a
name="line.38"></a>
 <span class="sourceLineNo">039</span>     */<a name="line.39"></a>
-<span class="sourceLineNo">040</span>    public abstract int getEntry(int index);<a
name="line.40"></a>
+<span class="sourceLineNo">040</span>    int getEntry(int index);<a name="line.40"></a>
 <span class="sourceLineNo">041</span><a name="line.41"></a>
 <span class="sourceLineNo">042</span>    /**<a name="line.42"></a>
 <span class="sourceLineNo">043</span>     * The number of entries in the palette.<a
name="line.43"></a>
 <span class="sourceLineNo">044</span>     * @return the number of palette entries<a
name="line.44"></a>
 <span class="sourceLineNo">045</span>     */<a name="line.45"></a>
-<span class="sourceLineNo">046</span>    public abstract int length();<a name="line.46"></a>
+<span class="sourceLineNo">046</span>    int length();<a name="line.46"></a>
 <span class="sourceLineNo">047</span><a name="line.47"></a>
-<span class="sourceLineNo">048</span>    public void dump() {<a name="line.48"></a>
-<span class="sourceLineNo">049</span>        for (int i = 0; i &lt; length();
i++) {<a name="line.49"></a>
-<span class="sourceLineNo">050</span>            Debug.debug("\t" + "palette["
+ i + "]: " + getEntry(i) + " (0x" + Integer.toHexString(getEntry(i)) + ")");<a name="line.50"></a>
-<span class="sourceLineNo">051</span>        }<a name="line.51"></a>
-<span class="sourceLineNo">052</span>    }<a name="line.52"></a>
-<span class="sourceLineNo">053</span>}<a name="line.53"></a>
+<span class="sourceLineNo">048</span>}<a name="line.48"></a>
 
 
 

Modified: websites/production/commons/content/proper/commons-imaging/apidocs/src-html/org/apache/commons/imaging/palette/PaletteFactory.html
==============================================================================
--- websites/production/commons/content/proper/commons-imaging/apidocs/src-html/org/apache/commons/imaging/palette/PaletteFactory.html
(original)
+++ websites/production/commons/content/proper/commons-imaging/apidocs/src-html/org/apache/commons/imaging/palette/PaletteFactory.html
Sun Jan 11 12:33:25 2015
@@ -398,7 +398,7 @@
 <span class="sourceLineNo">390</span>     */<a name="line.390"></a>
 <span class="sourceLineNo">391</span>    public Palette makeQuantizedRgbaPalette(final
BufferedImage src, final boolean transparent, final int max) throws ImageWriteException {<a
name="line.391"></a>
 <span class="sourceLineNo">392</span>        return new MedianCutQuantizer(!transparent).process(src,
max,<a name="line.392"></a>
-<span class="sourceLineNo">393</span>                new MedianCutLongestAxisImplementation(),
false);<a name="line.393"></a>
+<span class="sourceLineNo">393</span>                new LongestAxisMedianCut(),
false);<a name="line.393"></a>
 <span class="sourceLineNo">394</span>    }<a name="line.394"></a>
 <span class="sourceLineNo">395</span><a name="line.395"></a>
 <span class="sourceLineNo">396</span>    /**<a name="line.396"></a>

Modified: websites/production/commons/content/proper/commons-imaging/apidocs/src-html/org/apache/commons/imaging/palette/QuantizedPalette.html
==============================================================================
--- websites/production/commons/content/proper/commons-imaging/apidocs/src-html/org/apache/commons/imaging/palette/QuantizedPalette.html
(original)
+++ websites/production/commons/content/proper/commons-imaging/apidocs/src-html/org/apache/commons/imaging/palette/QuantizedPalette.html
Sun Jan 11 12:33:25 2015
@@ -27,7 +27,7 @@
 <span class="sourceLineNo">019</span>import java.util.List;<a name="line.19"></a>
 <span class="sourceLineNo">020</span>import org.apache.commons.imaging.ImageWriteException;<a
name="line.20"></a>
 <span class="sourceLineNo">021</span><a name="line.21"></a>
-<span class="sourceLineNo">022</span>public class QuantizedPalette extends Palette
{<a name="line.22"></a>
+<span class="sourceLineNo">022</span>public class QuantizedPalette implements
Palette {<a name="line.22"></a>
 <span class="sourceLineNo">023</span>    private final int precision;<a name="line.23"></a>
 <span class="sourceLineNo">024</span>    private final List&lt;ColorSpaceSubset&gt;
subsets;<a name="line.24"></a>
 <span class="sourceLineNo">025</span>    private final ColorSpaceSubset[] straight;<a
name="line.25"></a>
@@ -55,29 +55,25 @@
 <span class="sourceLineNo">047</span>        }<a name="line.47"></a>
 <span class="sourceLineNo">048</span>    }<a name="line.48"></a>
 <span class="sourceLineNo">049</span><a name="line.49"></a>
-<span class="sourceLineNo">050</span>    @Override<a name="line.50"></a>
-<span class="sourceLineNo">051</span>    public int getPaletteIndex(final int
rgb) throws ImageWriteException {<a name="line.51"></a>
-<span class="sourceLineNo">052</span>        final int precisionMask = (1 &lt;&lt;
precision) - 1;<a name="line.52"></a>
-<span class="sourceLineNo">053</span><a name="line.53"></a>
-<span class="sourceLineNo">054</span>        final int index = ((rgb &gt;&gt;
(24 - 3 * precision)) &amp; (precisionMask &lt;&lt; (precision &lt;&lt;
1)))<a name="line.54"></a>
-<span class="sourceLineNo">055</span>                | ((rgb &gt;&gt;
(16 - 2 * precision)) &amp; (precisionMask &lt;&lt; precision))<a name="line.55"></a>
-<span class="sourceLineNo">056</span>                | ((rgb &gt;&gt;
(8 - precision)) &amp; (precisionMask));<a name="line.56"></a>
-<span class="sourceLineNo">057</span><a name="line.57"></a>
-<span class="sourceLineNo">058</span>        return straight[index].getIndex();<a
name="line.58"></a>
-<span class="sourceLineNo">059</span>    }<a name="line.59"></a>
-<span class="sourceLineNo">060</span><a name="line.60"></a>
-<span class="sourceLineNo">061</span>    @Override<a name="line.61"></a>
-<span class="sourceLineNo">062</span>    public int getEntry(final int index)
{<a name="line.62"></a>
-<span class="sourceLineNo">063</span>        final ColorSpaceSubset subset =
subsets.get(index);<a name="line.63"></a>
-<span class="sourceLineNo">064</span>        return subset.rgb;<a name="line.64"></a>
-<span class="sourceLineNo">065</span>    }<a name="line.65"></a>
-<span class="sourceLineNo">066</span><a name="line.66"></a>
-<span class="sourceLineNo">067</span>    @Override<a name="line.67"></a>
-<span class="sourceLineNo">068</span>    public int length() {<a name="line.68"></a>
-<span class="sourceLineNo">069</span>        return subsets.size();<a name="line.69"></a>
-<span class="sourceLineNo">070</span><a name="line.70"></a>
-<span class="sourceLineNo">071</span>    }<a name="line.71"></a>
-<span class="sourceLineNo">072</span>}<a name="line.72"></a>
+<span class="sourceLineNo">050</span>    public int getPaletteIndex(final int
rgb) throws ImageWriteException {<a name="line.50"></a>
+<span class="sourceLineNo">051</span>        final int precisionMask = (1 &lt;&lt;
precision) - 1;<a name="line.51"></a>
+<span class="sourceLineNo">052</span><a name="line.52"></a>
+<span class="sourceLineNo">053</span>        final int index = ((rgb &gt;&gt;
(24 - 3 * precision)) &amp; (precisionMask &lt;&lt; (precision &lt;&lt;
1)))<a name="line.53"></a>
+<span class="sourceLineNo">054</span>                | ((rgb &gt;&gt;
(16 - 2 * precision)) &amp; (precisionMask &lt;&lt; precision))<a name="line.54"></a>
+<span class="sourceLineNo">055</span>                | ((rgb &gt;&gt;
(8 - precision)) &amp; (precisionMask));<a name="line.55"></a>
+<span class="sourceLineNo">056</span><a name="line.56"></a>
+<span class="sourceLineNo">057</span>        return straight[index].getIndex();<a
name="line.57"></a>
+<span class="sourceLineNo">058</span>    }<a name="line.58"></a>
+<span class="sourceLineNo">059</span><a name="line.59"></a>
+<span class="sourceLineNo">060</span>    public int getEntry(final int index)
{<a name="line.60"></a>
+<span class="sourceLineNo">061</span>        final ColorSpaceSubset subset =
subsets.get(index);<a name="line.61"></a>
+<span class="sourceLineNo">062</span>        return subset.rgb;<a name="line.62"></a>
+<span class="sourceLineNo">063</span>    }<a name="line.63"></a>
+<span class="sourceLineNo">064</span><a name="line.64"></a>
+<span class="sourceLineNo">065</span>    public int length() {<a name="line.65"></a>
+<span class="sourceLineNo">066</span>        return subsets.size();<a name="line.66"></a>
+<span class="sourceLineNo">067</span>    }<a name="line.67"></a>
+<span class="sourceLineNo">068</span>}<a name="line.68"></a>
 
 
 

Modified: websites/production/commons/content/proper/commons-imaging/apidocs/src-html/org/apache/commons/imaging/palette/SimplePalette.html
==============================================================================
--- websites/production/commons/content/proper/commons-imaging/apidocs/src-html/org/apache/commons/imaging/palette/SimplePalette.html
(original)
+++ websites/production/commons/content/proper/commons-imaging/apidocs/src-html/org/apache/commons/imaging/palette/SimplePalette.html
Sun Jan 11 12:33:25 2015
@@ -24,38 +24,31 @@
 <span class="sourceLineNo">016</span> */<a name="line.16"></a>
 <span class="sourceLineNo">017</span>package org.apache.commons.imaging.palette;<a
name="line.17"></a>
 <span class="sourceLineNo">018</span><a name="line.18"></a>
-<span class="sourceLineNo">019</span>public class SimplePalette extends Palette
{<a name="line.19"></a>
+<span class="sourceLineNo">019</span>public class SimplePalette implements Palette
{<a name="line.19"></a>
 <span class="sourceLineNo">020</span>    private final int[] palette;<a name="line.20"></a>
 <span class="sourceLineNo">021</span><a name="line.21"></a>
 <span class="sourceLineNo">022</span>    public SimplePalette(final int[] palette)
{<a name="line.22"></a>
 <span class="sourceLineNo">023</span>        this.palette = palette;<a name="line.23"></a>
 <span class="sourceLineNo">024</span>    }<a name="line.24"></a>
 <span class="sourceLineNo">025</span><a name="line.25"></a>
-<span class="sourceLineNo">026</span>    @Override<a name="line.26"></a>
-<span class="sourceLineNo">027</span>    public int getPaletteIndex(final int
rgb) {<a name="line.27"></a>
-<span class="sourceLineNo">028</span>        return getPaletteIndex(palette,
rgb);<a name="line.28"></a>
-<span class="sourceLineNo">029</span>    }<a name="line.29"></a>
-<span class="sourceLineNo">030</span><a name="line.30"></a>
-<span class="sourceLineNo">031</span>    @Override<a name="line.31"></a>
-<span class="sourceLineNo">032</span>    public int getEntry(final int index)
{<a name="line.32"></a>
-<span class="sourceLineNo">033</span>        return palette[index];<a name="line.33"></a>
+<span class="sourceLineNo">026</span>    public int getPaletteIndex(final int
rgb) {<a name="line.26"></a>
+<span class="sourceLineNo">027</span>        for (int i = 0; i &lt; palette.length;
i++) {<a name="line.27"></a>
+<span class="sourceLineNo">028</span>            if (palette[i] == rgb) {<a
name="line.28"></a>
+<span class="sourceLineNo">029</span>                return i;<a name="line.29"></a>
+<span class="sourceLineNo">030</span>            }<a name="line.30"></a>
+<span class="sourceLineNo">031</span>        }<a name="line.31"></a>
+<span class="sourceLineNo">032</span><a name="line.32"></a>
+<span class="sourceLineNo">033</span>        return -1;<a name="line.33"></a>
 <span class="sourceLineNo">034</span>    }<a name="line.34"></a>
 <span class="sourceLineNo">035</span><a name="line.35"></a>
-<span class="sourceLineNo">036</span>    private int getPaletteIndex(final int[]
palette, final int argb) {<a name="line.36"></a>
-<span class="sourceLineNo">037</span>        for (int i = 0; i &lt; palette.length;
i++) {<a name="line.37"></a>
-<span class="sourceLineNo">038</span>            if (palette[i] == argb) {<a
name="line.38"></a>
-<span class="sourceLineNo">039</span>                return i;<a name="line.39"></a>
-<span class="sourceLineNo">040</span>            }<a name="line.40"></a>
-<span class="sourceLineNo">041</span>        }<a name="line.41"></a>
-<span class="sourceLineNo">042</span><a name="line.42"></a>
-<span class="sourceLineNo">043</span>        return -1;<a name="line.43"></a>
-<span class="sourceLineNo">044</span>    }<a name="line.44"></a>
-<span class="sourceLineNo">045</span><a name="line.45"></a>
-<span class="sourceLineNo">046</span>    @Override<a name="line.46"></a>
-<span class="sourceLineNo">047</span>    public int length() {<a name="line.47"></a>
-<span class="sourceLineNo">048</span>        return palette.length;<a name="line.48"></a>
-<span class="sourceLineNo">049</span>    }<a name="line.49"></a>
-<span class="sourceLineNo">050</span>}<a name="line.50"></a>
+<span class="sourceLineNo">036</span>    public int getEntry(final int index)
{<a name="line.36"></a>
+<span class="sourceLineNo">037</span>        return palette[index];<a name="line.37"></a>
+<span class="sourceLineNo">038</span>    }<a name="line.38"></a>
+<span class="sourceLineNo">039</span><a name="line.39"></a>
+<span class="sourceLineNo">040</span>    public int length() {<a name="line.40"></a>
+<span class="sourceLineNo">041</span>        return palette.length;<a name="line.41"></a>
+<span class="sourceLineNo">042</span>    }<a name="line.42"></a>
+<span class="sourceLineNo">043</span>}<a name="line.43"></a>
 
 
 

Modified: websites/production/commons/content/proper/commons-imaging/changes-report.html
==============================================================================
--- websites/production/commons/content/proper/commons-imaging/changes-report.html (original)
+++ websites/production/commons/content/proper/commons-imaging/changes-report.html Sun Jan
11 12:33:25 2015
@@ -1,13 +1,13 @@
 <!DOCTYPE html>
 <!--
- | Generated by Apache Maven Doxia at 02 January 2015
+ | Generated by Apache Maven Doxia at 11 January 2015
  | Rendered using Apache Maven Fluido Skin 1.3.0
 -->
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
   <head>
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <meta name="Date-Revision-yyyymmdd" content="20150102" />
+    <meta name="Date-Revision-yyyymmdd" content="20150111" />
     <meta http-equiv="Content-Language" content="en" />
     <title>Commons Imaging &#x2013; Release Notes</title>
 
@@ -43,7 +43,7 @@
 					<a class="brand" href="http://commons.apache.org/proper/commons-imaging/">Apache
Commons Imaging &trade;</a>
 					<ul class="nav">      
                     
-            <li id="publishDate">Last Published: 02 January 2015</li>
+            <li id="publishDate">Last Published: 11 January 2015</li>
       <li class="divider">|</li> <li id="projectVersion">Version: 1.0-SNAPSHOT</li>
   </ul>
                     <div class="pull-right">	<ul class="nav">
@@ -307,6 +307,22 @@
 <th>By</th></tr>
 <tr class="b">
 <td><img src="images/fix.gif" alt="Fix" title="Fix" /></td>
+<td>TiffOutputSet.setGPSInDegrees should make sure, GPSVersionID is set Fixes <a
class="externalLink" href="http://issues.apache.org/jira/browse/IMAGING-144">IMAGING-144</a>.
Thanks to Paul Hartmann.</td>
+<td><a href="team-list.html#britter">britter</a></td></tr>
+<tr class="a">
+<td><img src="images/update.gif" alt="Update" title="Update" /></td>
+<td>TIFF and PNG images should not be bigger than the ones created by java ImageIO
Fixes <a class="externalLink" href="http://issues.apache.org/jira/browse/IMAGING-126">IMAGING-126</a>.
Thanks to Gary Lucas.</td>
+<td><a href="team-list.html#britter">britter</a></td></tr>
+<tr class="b">
+<td><img src="images/update.gif" alt="Update" title="Update" /></td>
+<td>Add color constants Fixes <a class="externalLink" href="http://issues.apache.org/jira/browse/IMAGING-147">IMAGING-147</a>.
Thanks to Stephan Koeninger.</td>
+<td><a href="team-list.html#britter">britter</a></td></tr>
+<tr class="a">
+<td><img src="images/update.gif" alt="Update" title="Update" /></td>
+<td>Implement equals and hashcode on color classes Fixes <a class="externalLink"
href="http://issues.apache.org/jira/browse/IMAGING-150">IMAGING-150</a>. Thanks to
Stephan Koeninger.</td>
+<td><a href="team-list.html#britter">britter</a></td></tr>
+<tr class="b">
+<td><img src="images/fix.gif" alt="Fix" title="Fix" /></td>
 <td>Classes should not expose mutable arrays Fixes <a class="externalLink" href="http://issues.apache.org/jira/browse/IMAGING-117">IMAGING-117</a>.</td>
 <td><a href="team-list.html#sebb">sebb</a></td></tr>
 <tr class="a">



Mime
View raw message