vendor/khanamiryan/qrcode-detector-decoder/lib/GDLuminanceSource.php

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php


namespace Zxing;

/**
 * This class is used to help decode images from files which arrive as GD Resource
 * It does not support rotation.
 *
 *
 *
 */
final class GDLuminanceSource extends LuminanceSource {

    public   $luminances;
    private  $dataWidth;
    private  $dataHeight;
    private  $left;
    private  $top;
    private  $gdImage;



    public function __construct($gdImage,
                                $dataWidth,
                                $dataHeight,
                                $left=null,
                                $top=null,
                                $width=null,
                                $height=null) {
        if(!$left&&!$top&&!$width&&!$height){
            $this->GDLuminanceSource($gdImage,$dataWidth,$dataHeight);
            return;
        }
        parent::__construct($width, $height);
        if ($left + $width > $dataWidth || $top + $height > $dataHeight) {
            throw new \InvalidArgumentException("Crop rectangle does not fit within image data.");
        }
        $this->luminances = $gdImage;
        $this->dataWidth = $dataWidth;
        $this->dataHeight = $dataHeight;
        $this->left = $left;
        $this->top = $top;
    }

    public function GDLuminanceSource($gdImage, $width, $height)
    {
        parent::__construct($width, $height);

        $this->dataWidth = $width;
        $this->dataHeight = $height;
        $this->left = 0;
        $this->top = 0;
        $this->$gdImage = $gdImage;


// In order to measure pure decoding speed, we convert the entire image to a greyscale array
// up front, which is the same as the Y channel of the YUVLuminanceSource in the real app.
        $this->luminances = array();
        //$this->luminances = $this->grayScaleToBitmap($this->grayscale());

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。