src/BaiduBce/Services/Lss/LssClient.php
public function createTimestampWatermark($name, $options = array())
    {
        list($config, $timezone, $alpha, $fontFamily, $fontSizeInPoint,
            $fontColor, $backgroundColor, $verticalAlignment, $horizontalAlignment,
            $verticalOffsetInPixel, $horizontalOffsetInPixel) = $this->parseOptions(
            $options,
            'config',
            'timezone',
            'alpha',
            'fontFamily',
            'fontSizeInPoint',
            'fontColor',
            'backgroundColor',
            'verticalAlignment',
            'horizontalAlignment',
            'verticalOffsetInPixel',
            'horizontalOffsetInPixel'
        );

        if (empty($name)) {
            throw new BceClientException("The parameter name "
                . "should NOT be null or empty string");
        }

        $body = array(
            'name' => $name,
        );

        if ($timezone !== null) {
            $body['timezone'] = $timezone;
        }
        if ($alpha !== null) {
            $body['alpha'] = $alpha;
        }

        $font = array();
        if ($fontFamily !== null) {
            $font['family'] = $fontFamily;
        }
        if ($fontSizeInPoint !== null) {
            $font['sizeInPoint'] = $fontSizeInPoint;
        }
        if ($fontColor !== null) {
            $font['color'] = $fontColor;
        }
        if (count($font) > 0) {
            $body['font'] = $font;
        }

        $background = array();
        if ($backgroundColor !== null) {
            $background['color'] = $backgroundColor;
            $body['background'] = $background;
        }

        $position = array();
        if ($verticalAlignment !== null) {
            $position['verticalAlignment'] = $verticalAlignment;
        }
        if ($horizontalAlignment !== null) {
            $position['horizontalAlignment'] = $horizontalAlignment;
        }
        if ($verticalOffsetInPixel !== null) {
            $position['verticalOffsetInPixel'] = $verticalOffsetInPixel;
        }
        if ($horizontalOffsetInPixel !== null) {
            $position['horizontalOffsetInPixel'] = $horizontalOffsetInPixel;
        }
        if (count($position) > 0) {
            $body['position'] = $position;
        }

        return $this->sendRequest(
            HttpMethod::POST,
            array(
                'config' => $config,
                'body' => json_encode($body, JSON_FORCE_OBJECT),
            ),
            "/watermark/timestamp"
        );
    }
public function createTimestampWatermark($name, $options = array())
    {
        list($config, $timezone, $alpha, $fontFamily, $fontSizeInPoint,
            $fontColor, $backgroundColor, $verticalAlignment, $horizontalAlignment,
            $verticalOffsetInPixel, $horizontalOffsetInPixel) = $this->parseOptions(
            $options,
            'config',
            'timezone',
            'alpha',
            'fontFamily',
            'fontSizeInPoint',
            'fontColor',
            'backgroundColor',
            'verticalAlignment',
            'horizontalAlignment',
            'verticalOffsetInPixel',
            'horizontalOffsetInPixel'
        );

        if (empty($name)) {
            throw new BceClientException("The parameter name "
                . "should NOT be null or empty string");
        }

        $body = array(
            'name' => $name,
        );

        if ($timezone !== null) {
            $body['timezone'] = $timezone;
        }
        if ($alpha !== null) {
            $body['alpha'] = $alpha;
        }

        $font = array();
        if ($fontFamily !== null) {
            $font['family'] = $fontFamily;
        }
        if ($fontSizeInPoint !== null) {
            $font['sizeInPoint'] = $fontSizeInPoint;
        }
        if ($fontColor !== null) {
            $font['color'] = $fontColor;
        }
        if (count($font) > 0) {
            $body['font'] = $font;
        }

        $background = array();
        if ($backgroundColor !== null) {
            $background['color'] = $backgroundColor;
            $body['background'] = $background;
        }

        $position = array();
        if ($verticalAlignment !== null) {
            $position['verticalAlignment'] = $verticalAlignment;
        }
        if ($horizontalAlignment !== null) {
            $position['horizontalAlignment'] = $horizontalAlignment;
        }
        if ($verticalOffsetInPixel !== null) {
            $position['verticalOffsetInPixel'] = $verticalOffsetInPixel;
        }
        if ($horizontalOffsetInPixel !== null) {
            $position['horizontalOffsetInPixel'] = $horizontalOffsetInPixel;
        }
        if (count($position) > 0) {
            $body['position'] = $position;
        }

        return $this->sendRequest(
            HttpMethod::POST,
            array(
                'config' => $config,
                'body' => json_encode($body, JSON_FORCE_OBJECT),
            ),
            "/watermark/timestamp"
        );
    }
public function createTimestampWatermark ( $ name , $ options = array ( ) ) { list ( $ config , $ timezone , $ alpha , $ fontFamily , $ fontSizeInPoint , $ fontColor , $ backgroundColor , $ verticalAlignment , $ horizontalAlignment , $ verticalOffsetInPixel , $ horizontalOffsetInPixel ) = $ this -> parseOptions ( $ options , 'config' , 'timezone' , 'alpha' , 'fontFamily' , 'fontSizeInPoint' , 'fontColor' , 'backgroundColor' , 'verticalAlignment' , 'horizontalAlignment' , 'verticalOffsetInPixel' , 'horizontalOffsetInPixel' ) ; if ( empty ( $ name ) ) { throw new BceClientException ( "The parameter name " . "should NOT be null or empty string" ) ; } $ body = array ( 'name' => $ name , ) ; if ( $ timezone !== null ) { $ body [ 'timezone' ] = $ timezone ; } if ( $ alpha !== null ) { $ body [ 'alpha' ] = $ alpha ; } $ font = array ( ) ; if ( $ fontFamily !== null ) { $ font [ 'family' ] = $ fontFamily ; } if ( $ fontSizeInPoint !== null ) { $ font [ 'sizeInPoint' ] = $ fontSizeInPoint ; } if ( $ fontColor !== null ) { $ font [ 'color' ] = $ fontColor ; } if ( count ( $ font ) > 0 ) { $ body [ 'font' ] = $ font ; } $ background = array ( ) ; if ( $ backgroundColor !== null ) { $ background [ 'color' ] = $ backgroundColor ; $ body [ 'background' ] = $ background ; } $ position = array ( ) ; if ( $ verticalAlignment !== null ) { $ position [ 'verticalAlignment' ] = $ verticalAlignment ; } if ( $ horizontalAlignment !== null ) { $ position [ 'horizontalAlignment' ] = $ horizontalAlignment ; } if ( $ verticalOffsetInPixel !== null ) { $ position [ 'verticalOffsetInPixel' ] = $ verticalOffsetInPixel ; } if ( $ horizontalOffsetInPixel !== null ) { $ position [ 'horizontalOffsetInPixel' ] = $ horizontalOffsetInPixel ; } if ( count ( $ position ) > 0 ) { $ body [ 'position' ] = $ position ; } return $ this -> sendRequest ( HttpMethod :: POST , array ( 'config' => $ config , 'body' => json_encode ( $ body , JSON_FORCE_OBJECT ) , ) , "/watermark/timestamp" ) ; }
Create a timestamp watermark.

@param $name string, image watermark name
@param array $options Supported options:
{
config: the optional bce configuration, which will overwrite the
default client configuration that was passed in constructor.
timezone: string, timestamp time zone
alpha: number, timestamp watermark transparency
fontFamily: string, timestamp watermark fonts
fontSizeInPoint: number, font size in point
fontColor: string, timestamp watermark font color
backgroundColor: string, background color
verticalAlignment: string, vertically aligned manner
horizontalAlignment: string, horizontal aligned manner
verticalOffsetInPixel: number, vertical offset in pixel
horizontalOffsetInPixel: number, horizontal offset in pixel
}
@return mixed
@throws BceClientException
Create a timestamp watermark .