Extract calendar event's rect dimensions
This commit is contained in:
parent
e693cd088e
commit
e977ef04c8
|
@ -151,9 +151,6 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (3) Remove last */
|
|
||||||
unset( $col_ind[count($col_ind)-1] );
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,7 +160,9 @@
|
||||||
=========================================================*/ {
|
=========================================================*/ {
|
||||||
|
|
||||||
/* (1) For each day */
|
/* (1) For each day */
|
||||||
foreach($col_ind as $day_n=>$col_x){
|
for( $day_n = 0 ; $day_n <= count($col_ind) ; $day_n++ ){
|
||||||
|
$col_x = $col_ind[$day_n];
|
||||||
|
|
||||||
|
|
||||||
/* (2) For each y pixel -> exctract event */
|
/* (2) For each y pixel -> exctract event */
|
||||||
for( $y = self::$start_y ; $y < self::$stop_y ; $y++ ){
|
for( $y = self::$start_y ; $y < self::$stop_y ; $y++ ){
|
||||||
|
@ -177,7 +176,8 @@
|
||||||
if( $p == 0 && $p1 != 0xffffff ){
|
if( $p == 0 && $p1 != 0xffffff ){
|
||||||
|
|
||||||
// {1} calculate time //
|
// {1} calculate time //
|
||||||
$time = $this->yToTime($day_n, $y);
|
$start_y = $y;
|
||||||
|
$time = $this->yToTime($day_n, $start_y);
|
||||||
|
|
||||||
// {2} Store default event name if not already set //
|
// {2} Store default event name if not already set //
|
||||||
if( !isset($d_db[$p1e]) )
|
if( !isset($d_db[$p1e]) )
|
||||||
|
@ -194,6 +194,10 @@
|
||||||
// {5} If end reached //
|
// {5} If end reached //
|
||||||
$this->event[$p1e][$time] = $this->yToTime($day_n, $y);
|
$this->event[$p1e][$time] = $this->yToTime($day_n, $y);
|
||||||
|
|
||||||
|
// {6} Exctract event's image //
|
||||||
|
$this->extractEvent([$col_x, $start_y+1], [$col_ind[$day_n+1]-1, $y]);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -222,6 +226,17 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* (3) Exctracts an event
|
||||||
|
*
|
||||||
|
* @start<Array> Start rect (x, y)
|
||||||
|
* @stop<Array> Stop rect (x, y)
|
||||||
|
*
|
||||||
|
---------------------------------------------------------*/
|
||||||
|
public function extractEvent($start=null, $stop=null){
|
||||||
|
var_dump("from (${start[0]}, ${start[1]}) to (${stop[0]}, ${stop[1]})");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* (3) Get a pixel's color
|
/* (3) Get a pixel's color
|
||||||
*
|
*
|
||||||
* @x<int> X coordinate
|
* @x<int> X coordinate
|
||||||
|
|
Loading…
Reference in New Issue