Ignore:
Timestamp:
May 13, 2010, 10:21:05 PM (14 years ago)
Author:
grum
Message:

Improve algorythm for colors analysis + use GPCRequestBuilder interface instead of a local interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/ColorStat/cstat_aip_install.class.inc.php

    r6107 r6176  
    126126                dirname($this->getFileLocation()).'/admin/cstat_install_page.tpl');
    127127
    128     $smallColorTable=ColorStat::getColorTable($this->colorTableSize['small'][0],$this->colorTableSize['small'][1]);
    129     $largeColorTable=ColorStat::getColorTable($this->colorTableSize['large'][0],$this->colorTableSize['large'][1]);
    130     $template->assign('smallTableColor', $this->htmlColorTable($smallColorTable, 19, '', 'color0px'));
    131     $template->assign('largeTableColor', $this->htmlColorTable($largeColorTable, 10, '', 'color0px'));
     128    $smallColorTable=ColorStat::getColorTable(CStat_root::$colorTableSize['small'][0],CStat_root::$colorTableSize['small'][1]);
     129    $largeColorTable=ColorStat::getColorTable(CStat_root::$colorTableSize['large'][0],CStat_root::$colorTableSize['large'][1]);
     130    $template->assign('smallTableColor', CStat_functions::htmlColorTable($smallColorTable, 19, '', 'color0px'));
     131    $template->assign('largeTableColor', CStat_functions::htmlColorTable($largeColorTable, 10, '', 'color0px'));
    132132
    133133    $template->assign(
    134134      'smallColorList1',
    135       $this->htmlColorList(
     135      CStat_functions::htmlColorList(
    136136        ColorStat::getFileColors(dirname($this->getFileLocation()).'/image/sample1.png', $smallColorTable, Array('quality' => 8, 'numColors' => 16)),
    137137        16, 18, '', 'colorListSample color0px'
     
    142142    $template->assign(
    143143      'largeColorList1',
    144       $this->htmlColorList(
     144      CStat_functions::htmlColorList(
    145145        ColorStat::getFileColors(dirname($this->getFileLocation()).'/image/sample1.png', $largeColorTable, Array('quality' => 8, 'numColors' => 16)),
    146146        16, 18, '', 'colorListSample color0px'
     
    151151    $template->assign(
    152152      'smallColorList2',
    153       $this->htmlColorList(
     153      CStat_functions::htmlColorList(
    154154        ColorStat::getFileColors(dirname($this->getFileLocation()).'/image/sample2.png', $smallColorTable, Array('quality' => 8, 'numColors' => 16)),
    155155        16, 18, '', 'colorListSample color0px'
     
    160160    $template->assign(
    161161      'largeColorList2',
    162       $this->htmlColorList(
     162      CStat_functions::htmlColorList(
    163163        ColorStat::getFileColors(dirname($this->getFileLocation()).'/image/sample2.png', $largeColorTable, Array('quality' => 8, 'numColors' => 16)),
    164164        16, 18, '', 'colorListSample color0px'
     
    205205    $this->saveConfig();
    206206
    207     $colorTable=ColorStat::getColorTable($this->colorTableSize[$tableSize][0],$this->colorTableSize[$tableSize][1]);
    208 
    209     foreach($colorTable as $key => $val)
     207    $colorTable=ColorStat::getColorTable(CStat_root::$colorTableSize[$tableSize][0],CStat_root::$colorTableSize[$tableSize][1]);
     208
     209    foreach($colorTable as $key => $hue)
    210210    {
    211       foreach($val as $key2 => $val2)
     211      foreach($hue as $key2 => $saturation)
    212212      {
    213         $hsv=$val2->get();
    214         $sql.=(($sql=="")?"":", ")."('".$val2->getRGB()->getHexString()."',
    215                '".$hsv['H']."',
    216                '".$hsv['S']."',
    217                '".$hsv['V']."',
    218                0, 0)";
     213        foreach($saturation as $key3=>$value)
     214        {
     215          $hsv=$value->get();
     216          $sql.=(($sql=="")?"":", ")."('".$value->getRGB()->getHexString()."',
     217                 '".$hsv['H']."',
     218                 '".$hsv['S']."',
     219                 '".$hsv['V']."',
     220                 0, 0)";
     221        }
    219222      }
    220223    }
Note: See TracChangeset for help on using the changeset viewer.