Lines Matching refs:im

91 class im {  class
92 private $im; variable in im
94 public function im($max_x = 1, $max_y = 1) function in im
97 $im = imagecreatetruecolor($max_x, $max_y);
98 imagesavealpha($im, true);
99 $trans = imagecolorallocatealpha($im, 0, 0, 0, 127);
100 imagefill($im, 0, 0, $trans);
102 $this->grey = imagecolorallocate($im, 210, 210, 210);
103 $this->white = imagecolorallocate($im, 255, 255, 255);
104 $this->black = imagecolorallocate($im, 0, 0, 0);
106 $this->im = $im;
107 return $im;
112 $oldsx = imagesx($this->im);
113 $oldsy = imagesy($this->im);
121 $oldim = $this->im;
122 $this->im($newsx, $newsy);
123 imagecopy($this->im, $oldim, 0, 0, 0, 0, $oldsx, $oldsy);
128 return imagepng($this->im, $filename, 9);
132 return imagedestroy($this->im);
140 imagerectangle($this->im, $x, $y, $w, $h, $col);
142 imagefilledrectangle($this->im, $x, $y, $w, $h, $col);
149 imageline($this->im, $x1, $y1, $x2, $y2, $this->black);
185 return imagettftext($this->im, $this->font_sizes[$fontidx], $angle, $x,
246 $im = new im();
247 $bitdim = $im->font_height(FONT_BITS, "01X") * 3;
257 $im->text($x, $y, FONT_TITLE, $text);
258 $ymin = $im->font_height(FONT_TITLE);
262 $im->text($x, $y + $ymin, FONT_DESC, " ".$register->sub_desc);
276 $mmrsx = $im->font_width(FONT_LABELS, $mmr_disp);
277 $resetsx = $im->font_width(FONT_LABELS, $reset_disp);
281 $im->text($xmin - $mmrsx, $y, FONT_LABELS, $mmr_disp);
283 $y += $im->font_height(FONT_LABELS);
284 $im->text($xmin - $resetsx, $y, FONT_LABELS, $reset_disp);
292 $xmin = max($xmin, $im->font_width(FONT_LABELS, $bit->format_name()) + $bitdim);
320 $im->line($x, $y-$bitdim*0.2, $x, $y+$bitdim*1.2);
321 $im->line($x+1, $y-$bitdim*0.2, $x+1, $y+$bitdim*1.2);
324 $bc = ($register->bit_defined($b) ? $im->white : $im->grey);
325 $im->rect($x, $y, $x+$bitdim, $y+$bitdim, $bc, "fill");
326 $im->rect($x, $y, $x+$bitdim, $y+$bitdim, $im->black);
329 $im->line($x+$bitdim, $y-$bitdim*0.2, $x+$bitdim, $y+$bitdim*1.2);
330 $im->line($x+$bitdim+1, $y-$bitdim*0.2, $x+$bitdim+1, $y+$bitdim*1.2);
334 $fw = $im->font_width(FONT_BITS, $b);
336 $yoff = $im->font_height(FONT_BITS) * 1.25;
337 $im->text($x+$xoff, $y-$yoff, FONT_BITS, $b);
344 $xoff = ($bitdim - $im->font_width(FONT_BIT_LABELS, $bit_disp)) / 2;
345 $yoff = ($bitdim - $im->font_height(FONT_BIT_LABELS, $bit_disp)) / 2;
346 $im->exact_text($x+$xoff, $y+$yoff, FONT_BIT_LABELS, $bit_disp);
356 $yoff = ($bitdim - $im->font_height(FONT_BIT_LABELS, $bit_disp)) / 2;
357 $im->exact_text($x+$xoff, $y+$yoff-1, FONT_LABELS, $bit_disp);
377 $desc_adjust = max($desc_adjust, $im->font_width(FONT_LABELS, $text." "));
384 $desc_adjust = $im->font_width(FONT_LABELS, " ");
404 $im->line($cx1_l, $y, $cx1_l, $cy1); /* left bar */
407 $im->line($cx1_r, $y, $cx1_r, $cy1); /* right bar */
408 $im->line($cx1_l, $cy1, $cx1_r, $cy1); /* lower bar */
414 $im->line($cx1, $y, $cx1, $cy1);
422 $cx2_indent = $desc_adjust - $im->font_width(FONT_LABELS, $text." ");
427 $im->line($cx1, $cy1, $cx1, $cy2); /* vert */
428 $im->line($cx1, $cy2, $cx2 - $cx2_indent, $cy2); /* horiz */
431 $fh = $im->font_height(FONT_LABELS) / 2;
432 $im->text($cx2+$fw, $cy2-$fh, FONT_LABELS, $text);
439 $fw += $im->font_width(FONT_DESC, " ");
442 $im->text($cx2+$fw, $cy2+$fh, FONT_DESC, $t);
443 $fh += $im->font_height(FONT_DESC);
458 $ret = $im->output($output_file);
459 $im->destroy();