Class: Google::Apis::DocsV1::ImageProperties

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/docs_v1/classes.rb,
generated/google/apis/docs_v1/representations.rb,
generated/google/apis/docs_v1/representations.rb

Overview

The properties of an image.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ ImageProperties

Returns a new instance of ImageProperties



1763
1764
1765
# File 'generated/google/apis/docs_v1/classes.rb', line 1763

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#angleFloat

The clockwise rotation angle of the image, in radians. Corresponds to the JSON property angle

Returns:

  • (Float)


1717
1718
1719
# File 'generated/google/apis/docs_v1/classes.rb', line 1717

def angle
  @angle
end

#brightnessFloat

The brightness effect of the image. The value should be in the interval [-1.0, 1.0], where 0 means no effect. Corresponds to the JSON property brightness

Returns:

  • (Float)


1723
1724
1725
# File 'generated/google/apis/docs_v1/classes.rb', line 1723

def brightness
  @brightness
end

#content_uriString

A URI to the image with a default lifetime of 30 minutes. This URI is tagged with the account of the requester. Anyone with the URI effectively accesses the image as the original requester. Access to the image may be lost if the document's sharing settings change. Corresponds to the JSON property contentUri

Returns:

  • (String)


1731
1732
1733
# File 'generated/google/apis/docs_v1/classes.rb', line 1731

def content_uri
  @content_uri
end

#contrastFloat

The contrast effect of the image. The value should be in the interval [-1.0, 1.0], where 0 means no effect. Corresponds to the JSON property contrast

Returns:

  • (Float)


1737
1738
1739
# File 'generated/google/apis/docs_v1/classes.rb', line 1737

def contrast
  @contrast
end

#crop_propertiesGoogle::Apis::DocsV1::CropProperties

The crop properties of an image. The crop rectangle is represented using fractional offsets from the original content's four edges.

  • If the offset is in the interval (0, 1), the corresponding edge of crop rectangle is positioned inside of the image's original bounding rectangle.
  • If the offset is negative or greater than 1, the corresponding edge of crop rectangle is positioned outside of the image's original bounding rectangle.
  • If all offsets and rotation angle are 0, the image is not cropped. Corresponds to the JSON property cropProperties


1749
1750
1751
# File 'generated/google/apis/docs_v1/classes.rb', line 1749

def crop_properties
  @crop_properties
end

#source_uriString

The source URI is the URI used to insert the image. The source URI can be empty. Corresponds to the JSON property sourceUri

Returns:

  • (String)


1755
1756
1757
# File 'generated/google/apis/docs_v1/classes.rb', line 1755

def source_uri
  @source_uri
end

#transparencyFloat

The transparency effect of the image. The value should be in the interval [0.0, 1.0], where 0 means no effect and 1 means completely transparent. Corresponds to the JSON property transparency

Returns:

  • (Float)


1761
1762
1763
# File 'generated/google/apis/docs_v1/classes.rb', line 1761

def transparency
  @transparency
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1768
1769
1770
1771
1772
1773
1774
1775
1776
# File 'generated/google/apis/docs_v1/classes.rb', line 1768

def update!(**args)
  @angle = args[:angle] if args.key?(:angle)
  @brightness = args[:brightness] if args.key?(:brightness)
  @content_uri = args[:content_uri] if args.key?(:content_uri)
  @contrast = args[:contrast] if args.key?(:contrast)
  @crop_properties = args[:crop_properties] if args.key?(:crop_properties)
  @source_uri = args[:source_uri] if args.key?(:source_uri)
  @transparency = args[:transparency] if args.key?(:transparency)
end