google-apis-documentai_v1beta3 0.7.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/lib/google/apis/documentai_v1beta3.rb +1 -1
- data/lib/google/apis/documentai_v1beta3/classes.rb +659 -282
- data/lib/google/apis/documentai_v1beta3/gem_version.rb +2 -2
- data/lib/google/apis/documentai_v1beta3/representations.rb +165 -14
- data/lib/google/apis/documentai_v1beta3/service.rb +288 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0d9f23688289774b0302f492ef3e77abc84b6b11ebb8092eb5161ffcbf8adae
|
4
|
+
data.tar.gz: 9d96727aba37b152dbafe454489decb3790f8c51fd2baa61b2e5bab70adb96cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d166d8572f0f375496c58dfcd037a0411c1ac7a49f14bd6bba07e60981b4a97517975e6b9070f63ed10d3490585b9138bbd278faa06c040ec68199e5afdcffb
|
7
|
+
data.tar.gz: ce9c0ff579fbb1ab87fd47f282cf4fd09dfc6b9e55f57a591705ec99cc190e6a2fa72b6bd75ed35b8efeac32061ce4916bb1b45924012c7e7f4828d21c858541
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,25 @@
|
|
1
1
|
# Release history for google-apis-documentai_v1beta3
|
2
2
|
|
3
|
+
### v0.12.0 (2021-05-25)
|
4
|
+
|
5
|
+
* Regenerated from discovery document revision 20210520
|
6
|
+
|
7
|
+
### v0.11.0 (2021-05-19)
|
8
|
+
|
9
|
+
* Unspecified changes
|
10
|
+
|
11
|
+
### v0.10.0 (2021-05-12)
|
12
|
+
|
13
|
+
* Regenerated from discovery document revision 20210507
|
14
|
+
|
15
|
+
### v0.9.0 (2021-03-31)
|
16
|
+
|
17
|
+
* Regenerated from discovery document revision 20210329
|
18
|
+
|
19
|
+
### v0.8.0 (2021-03-24)
|
20
|
+
|
21
|
+
* Regenerated from discovery document revision 20210320
|
22
|
+
|
3
23
|
### v0.7.0 (2021-03-16)
|
4
24
|
|
5
25
|
* Regenerated from discovery document revision 20210312
|
@@ -31,7 +31,7 @@ module Google
|
|
31
31
|
# This is NOT the gem version.
|
32
32
|
VERSION = 'V1beta3'
|
33
33
|
|
34
|
-
#
|
34
|
+
# See, edit, configure, and delete your Google Cloud Platform data
|
35
35
|
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
|
36
36
|
end
|
37
37
|
end
|
@@ -271,25 +271,6 @@ module Google
|
|
271
271
|
end
|
272
272
|
end
|
273
273
|
|
274
|
-
# The long running operation metadata for SampleDataset.
|
275
|
-
class GoogleCloudDocumentaiUiv1beta3SampleDatasetMetadata
|
276
|
-
include Google::Apis::Core::Hashable
|
277
|
-
|
278
|
-
# The common metadata for long running operations.
|
279
|
-
# Corresponds to the JSON property `commonMetadata`
|
280
|
-
# @return [Google::Apis::DocumentaiV1beta3::GoogleCloudDocumentaiUiv1beta3CommonOperationMetadata]
|
281
|
-
attr_accessor :common_metadata
|
282
|
-
|
283
|
-
def initialize(**args)
|
284
|
-
update!(**args)
|
285
|
-
end
|
286
|
-
|
287
|
-
# Update properties of this object
|
288
|
-
def update!(**args)
|
289
|
-
@common_metadata = args[:common_metadata] if args.key?(:common_metadata)
|
290
|
-
end
|
291
|
-
end
|
292
|
-
|
293
274
|
# The long running operation metadata for set default processor version method.
|
294
275
|
class GoogleCloudDocumentaiUiv1beta3SetDefaultProcessorVersionMetadata
|
295
276
|
include Google::Apis::Core::Hashable
|
@@ -360,12 +341,22 @@ module Google
|
|
360
341
|
class GoogleCloudDocumentaiUiv1beta3TrainProcessorVersionMetadataDatasetValidation
|
361
342
|
include Google::Apis::Core::Hashable
|
362
343
|
|
344
|
+
# The total number of dataset errors.
|
345
|
+
# Corresponds to the JSON property `datasetErrorCount`
|
346
|
+
# @return [Fixnum]
|
347
|
+
attr_accessor :dataset_error_count
|
348
|
+
|
363
349
|
# Error information for the dataset as a whole. A maximum of 10 dataset errors
|
364
350
|
# will be returned. A single dataset error is terminal for training.
|
365
351
|
# Corresponds to the JSON property `datasetErrors`
|
366
352
|
# @return [Array<Google::Apis::DocumentaiV1beta3::GoogleRpcStatus>]
|
367
353
|
attr_accessor :dataset_errors
|
368
354
|
|
355
|
+
# The total number of document errors.
|
356
|
+
# Corresponds to the JSON property `documentErrorCount`
|
357
|
+
# @return [Fixnum]
|
358
|
+
attr_accessor :document_error_count
|
359
|
+
|
369
360
|
# Error information pertaining to specific documents. A maximum of 10 document
|
370
361
|
# errors will be returned. Any document with errors will not be used throughout
|
371
362
|
# training.
|
@@ -379,7 +370,9 @@ module Google
|
|
379
370
|
|
380
371
|
# Update properties of this object
|
381
372
|
def update!(**args)
|
373
|
+
@dataset_error_count = args[:dataset_error_count] if args.key?(:dataset_error_count)
|
382
374
|
@dataset_errors = args[:dataset_errors] if args.key?(:dataset_errors)
|
375
|
+
@document_error_count = args[:document_error_count] if args.key?(:document_error_count)
|
383
376
|
@document_errors = args[:document_errors] if args.key?(:document_errors)
|
384
377
|
end
|
385
378
|
end
|
@@ -1165,6 +1158,11 @@ module Google
|
|
1165
1158
|
# @return [Google::Apis::DocumentaiV1beta3::GoogleCloudDocumentaiV1beta1BoundingPoly]
|
1166
1159
|
attr_accessor :bounding_poly
|
1167
1160
|
|
1161
|
+
# Optional. Confidence of detected page element, if applicable. Range [0, 1].
|
1162
|
+
# Corresponds to the JSON property `confidence`
|
1163
|
+
# @return [Float]
|
1164
|
+
attr_accessor :confidence
|
1165
|
+
|
1168
1166
|
# Optional. Deprecated. Use PageRef.bounding_poly instead.
|
1169
1167
|
# Corresponds to the JSON property `layoutId`
|
1170
1168
|
# @return [String]
|
@@ -1188,6 +1186,7 @@ module Google
|
|
1188
1186
|
# Update properties of this object
|
1189
1187
|
def update!(**args)
|
1190
1188
|
@bounding_poly = args[:bounding_poly] if args.key?(:bounding_poly)
|
1189
|
+
@confidence = args[:confidence] if args.key?(:confidence)
|
1191
1190
|
@layout_id = args[:layout_id] if args.key?(:layout_id)
|
1192
1191
|
@layout_type = args[:layout_type] if args.key?(:layout_type)
|
1193
1192
|
@page = args[:page] if args.key?(:page)
|
@@ -1742,6 +1741,12 @@ module Google
|
|
1742
1741
|
# @return [Fixnum]
|
1743
1742
|
attr_accessor :id
|
1744
1743
|
|
1744
|
+
# The index of the parent revisions corresponding collection of items (eg. list
|
1745
|
+
# of entities, properties within entities, etc.)
|
1746
|
+
# Corresponds to the JSON property `index`
|
1747
|
+
# @return [Fixnum]
|
1748
|
+
attr_accessor :index
|
1749
|
+
|
1745
1750
|
# The index of the [Document.revisions] identifying the parent revision.
|
1746
1751
|
# Corresponds to the JSON property `revision`
|
1747
1752
|
# @return [Fixnum]
|
@@ -1754,6 +1759,7 @@ module Google
|
|
1754
1759
|
# Update properties of this object
|
1755
1760
|
def update!(**args)
|
1756
1761
|
@id = args[:id] if args.key?(:id)
|
1762
|
+
@index = args[:index] if args.key?(:index)
|
1757
1763
|
@revision = args[:revision] if args.key?(:revision)
|
1758
1764
|
end
|
1759
1765
|
end
|
@@ -1876,98 +1882,98 @@ module Google
|
|
1876
1882
|
|
1877
1883
|
# Represents a color in the RGBA color space. This representation is designed
|
1878
1884
|
# for simplicity of conversion to/from color representations in various
|
1879
|
-
# languages over compactness
|
1880
|
-
# be trivially provided to the constructor of
|
1881
|
-
# also be trivially provided to UIColor's
|
1885
|
+
# languages over compactness. For example, the fields of this representation can
|
1886
|
+
# be trivially provided to the constructor of `java.awt.Color` in Java; it can
|
1887
|
+
# also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha`
|
1882
1888
|
# method in iOS; and, with just a little work, it can be easily formatted into a
|
1883
|
-
# CSS
|
1889
|
+
# CSS `rgba()` string in JavaScript. This reference page doesn't carry
|
1884
1890
|
# information about the absolute color space that should be used to interpret
|
1885
1891
|
# the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default,
|
1886
|
-
# applications
|
1887
|
-
#
|
1888
|
-
#
|
1889
|
-
#
|
1890
|
-
#
|
1891
|
-
# protocolor.
|
1892
|
-
#
|
1893
|
-
#
|
1894
|
-
# float
|
1895
|
-
# float
|
1896
|
-
#
|
1897
|
-
#
|
1898
|
-
#
|
1899
|
-
#
|
1900
|
-
#
|
1901
|
-
#
|
1902
|
-
#
|
1903
|
-
#
|
1904
|
-
#
|
1905
|
-
#
|
1906
|
-
#
|
1907
|
-
#
|
1908
|
-
#
|
1909
|
-
#
|
1910
|
-
#
|
1892
|
+
# applications should assume the sRGB color space. When color equality needs to
|
1893
|
+
# be decided, implementations, unless documented otherwise, treat two colors as
|
1894
|
+
# equal if all their red, green, blue, and alpha values each differ by at most
|
1895
|
+
# 1e-5. Example (Java): import com.google.type.Color; // ... public static java.
|
1896
|
+
# awt.Color fromProto(Color protocolor) ` float alpha = protocolor.hasAlpha() ?
|
1897
|
+
# protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.
|
1898
|
+
# getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); ` public static
|
1899
|
+
# Color toProto(java.awt.Color color) ` float red = (float) color.getRed();
|
1900
|
+
# float green = (float) color.getGreen(); float blue = (float) color.getBlue();
|
1901
|
+
# float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .
|
1902
|
+
# setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue /
|
1903
|
+
# denominator); int alpha = color.getAlpha(); if (alpha != 255) ` result.
|
1904
|
+
# setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .
|
1905
|
+
# build()); ` return resultBuilder.build(); ` // ... Example (iOS / Obj-C): // ..
|
1906
|
+
# . static UIColor* fromProto(Color* protocolor) ` float red = [protocolor red];
|
1907
|
+
# float green = [protocolor green]; float blue = [protocolor blue]; FloatValue*
|
1908
|
+
# alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper !=
|
1909
|
+
# nil) ` alpha = [alpha_wrapper value]; ` return [UIColor colorWithRed:red green:
|
1910
|
+
# green blue:blue alpha:alpha]; ` static Color* toProto(UIColor* color) `
|
1911
|
+
# CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&
|
1912
|
+
# blue alpha:&alpha]) ` return nil; ` Color* result = [[Color alloc] init]; [
|
1913
|
+
# result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <
|
1914
|
+
# = 0.9999) ` [result setAlpha:floatWrapperWithValue(alpha)]; ` [result
|
1915
|
+
# autorelease]; return result; ` // ... Example (JavaScript): // ... var
|
1916
|
+
# protoToCssColor = function(rgb_color) ` var redFrac = rgb_color.red || 0.0;
|
1911
1917
|
# var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0;
|
1912
1918
|
# var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255);
|
1913
1919
|
# var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) ` return
|
1914
|
-
#
|
1920
|
+
# rgbToCssColor(red, green, blue); ` var alphaFrac = rgb_color.alpha.value || 0.
|
1915
1921
|
# 0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',
|
1916
|
-
# ', alphaFrac, ')'].join(''); `; var
|
1917
|
-
# ` var rgbNumber = new Number((red << 16) | (green << 8) | blue); var
|
1918
|
-
#
|
1919
|
-
#
|
1920
|
-
#
|
1921
|
-
#
|
1922
|
+
# ', alphaFrac, ')'].join(''); `; var rgbToCssColor = function(red, green, blue)
|
1923
|
+
# ` var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString
|
1924
|
+
# = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var
|
1925
|
+
# resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) ` resultBuilder.
|
1926
|
+
# push('0'); ` resultBuilder.push(hexString); return resultBuilder.join(''); `; /
|
1927
|
+
# / ...
|
1922
1928
|
# Corresponds to the JSON property `backgroundColor`
|
1923
1929
|
# @return [Google::Apis::DocumentaiV1beta3::GoogleTypeColor]
|
1924
1930
|
attr_accessor :background_color
|
1925
1931
|
|
1926
1932
|
# Represents a color in the RGBA color space. This representation is designed
|
1927
1933
|
# for simplicity of conversion to/from color representations in various
|
1928
|
-
# languages over compactness
|
1929
|
-
# be trivially provided to the constructor of
|
1930
|
-
# also be trivially provided to UIColor's
|
1934
|
+
# languages over compactness. For example, the fields of this representation can
|
1935
|
+
# be trivially provided to the constructor of `java.awt.Color` in Java; it can
|
1936
|
+
# also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha`
|
1931
1937
|
# method in iOS; and, with just a little work, it can be easily formatted into a
|
1932
|
-
# CSS
|
1938
|
+
# CSS `rgba()` string in JavaScript. This reference page doesn't carry
|
1933
1939
|
# information about the absolute color space that should be used to interpret
|
1934
1940
|
# the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default,
|
1935
|
-
# applications
|
1936
|
-
#
|
1937
|
-
#
|
1938
|
-
#
|
1939
|
-
#
|
1940
|
-
# protocolor.
|
1941
|
-
#
|
1942
|
-
#
|
1943
|
-
# float
|
1944
|
-
# float
|
1945
|
-
#
|
1946
|
-
#
|
1947
|
-
#
|
1948
|
-
#
|
1949
|
-
#
|
1950
|
-
#
|
1951
|
-
#
|
1952
|
-
#
|
1953
|
-
#
|
1954
|
-
#
|
1955
|
-
#
|
1956
|
-
#
|
1957
|
-
#
|
1958
|
-
#
|
1959
|
-
#
|
1941
|
+
# applications should assume the sRGB color space. When color equality needs to
|
1942
|
+
# be decided, implementations, unless documented otherwise, treat two colors as
|
1943
|
+
# equal if all their red, green, blue, and alpha values each differ by at most
|
1944
|
+
# 1e-5. Example (Java): import com.google.type.Color; // ... public static java.
|
1945
|
+
# awt.Color fromProto(Color protocolor) ` float alpha = protocolor.hasAlpha() ?
|
1946
|
+
# protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.
|
1947
|
+
# getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); ` public static
|
1948
|
+
# Color toProto(java.awt.Color color) ` float red = (float) color.getRed();
|
1949
|
+
# float green = (float) color.getGreen(); float blue = (float) color.getBlue();
|
1950
|
+
# float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .
|
1951
|
+
# setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue /
|
1952
|
+
# denominator); int alpha = color.getAlpha(); if (alpha != 255) ` result.
|
1953
|
+
# setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .
|
1954
|
+
# build()); ` return resultBuilder.build(); ` // ... Example (iOS / Obj-C): // ..
|
1955
|
+
# . static UIColor* fromProto(Color* protocolor) ` float red = [protocolor red];
|
1956
|
+
# float green = [protocolor green]; float blue = [protocolor blue]; FloatValue*
|
1957
|
+
# alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper !=
|
1958
|
+
# nil) ` alpha = [alpha_wrapper value]; ` return [UIColor colorWithRed:red green:
|
1959
|
+
# green blue:blue alpha:alpha]; ` static Color* toProto(UIColor* color) `
|
1960
|
+
# CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&
|
1961
|
+
# blue alpha:&alpha]) ` return nil; ` Color* result = [[Color alloc] init]; [
|
1962
|
+
# result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <
|
1963
|
+
# = 0.9999) ` [result setAlpha:floatWrapperWithValue(alpha)]; ` [result
|
1964
|
+
# autorelease]; return result; ` // ... Example (JavaScript): // ... var
|
1965
|
+
# protoToCssColor = function(rgb_color) ` var redFrac = rgb_color.red || 0.0;
|
1960
1966
|
# var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0;
|
1961
1967
|
# var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255);
|
1962
1968
|
# var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) ` return
|
1963
|
-
#
|
1969
|
+
# rgbToCssColor(red, green, blue); ` var alphaFrac = rgb_color.alpha.value || 0.
|
1964
1970
|
# 0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',
|
1965
|
-
# ', alphaFrac, ')'].join(''); `; var
|
1966
|
-
# ` var rgbNumber = new Number((red << 16) | (green << 8) | blue); var
|
1967
|
-
#
|
1968
|
-
#
|
1969
|
-
#
|
1970
|
-
#
|
1971
|
+
# ', alphaFrac, ')'].join(''); `; var rgbToCssColor = function(red, green, blue)
|
1972
|
+
# ` var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString
|
1973
|
+
# = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var
|
1974
|
+
# resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) ` resultBuilder.
|
1975
|
+
# push('0'); ` resultBuilder.push(hexString); return resultBuilder.join(''); `; /
|
1976
|
+
# / ...
|
1971
1977
|
# Corresponds to the JSON property `color`
|
1972
1978
|
# @return [Google::Apis::DocumentaiV1beta3::GoogleTypeColor]
|
1973
1979
|
attr_accessor :color
|
@@ -2201,7 +2207,7 @@ module Google
|
|
2201
2207
|
# @return [Float]
|
2202
2208
|
attr_accessor :x
|
2203
2209
|
|
2204
|
-
# Y coordinate.
|
2210
|
+
# Y coordinate (starts from the top of the image).
|
2205
2211
|
# Corresponds to the JSON property `y`
|
2206
2212
|
# @return [Float]
|
2207
2213
|
attr_accessor :y
|
@@ -2322,7 +2328,7 @@ module Google
|
|
2322
2328
|
# @return [Fixnum]
|
2323
2329
|
attr_accessor :x
|
2324
2330
|
|
2325
|
-
# Y coordinate.
|
2331
|
+
# Y coordinate (starts from the top of the image).
|
2326
2332
|
# Corresponds to the JSON property `y`
|
2327
2333
|
# @return [Fixnum]
|
2328
2334
|
attr_accessor :y
|
@@ -2860,6 +2866,11 @@ module Google
|
|
2860
2866
|
# @return [Google::Apis::DocumentaiV1beta3::GoogleCloudDocumentaiV1beta2BoundingPoly]
|
2861
2867
|
attr_accessor :bounding_poly
|
2862
2868
|
|
2869
|
+
# Optional. Confidence of detected page element, if applicable. Range [0, 1].
|
2870
|
+
# Corresponds to the JSON property `confidence`
|
2871
|
+
# @return [Float]
|
2872
|
+
attr_accessor :confidence
|
2873
|
+
|
2863
2874
|
# Optional. Deprecated. Use PageRef.bounding_poly instead.
|
2864
2875
|
# Corresponds to the JSON property `layoutId`
|
2865
2876
|
# @return [String]
|
@@ -2883,6 +2894,7 @@ module Google
|
|
2883
2894
|
# Update properties of this object
|
2884
2895
|
def update!(**args)
|
2885
2896
|
@bounding_poly = args[:bounding_poly] if args.key?(:bounding_poly)
|
2897
|
+
@confidence = args[:confidence] if args.key?(:confidence)
|
2886
2898
|
@layout_id = args[:layout_id] if args.key?(:layout_id)
|
2887
2899
|
@layout_type = args[:layout_type] if args.key?(:layout_type)
|
2888
2900
|
@page = args[:page] if args.key?(:page)
|
@@ -3437,6 +3449,12 @@ module Google
|
|
3437
3449
|
# @return [Fixnum]
|
3438
3450
|
attr_accessor :id
|
3439
3451
|
|
3452
|
+
# The index of the parent revisions corresponding collection of items (eg. list
|
3453
|
+
# of entities, properties within entities, etc.)
|
3454
|
+
# Corresponds to the JSON property `index`
|
3455
|
+
# @return [Fixnum]
|
3456
|
+
attr_accessor :index
|
3457
|
+
|
3440
3458
|
# The index of the [Document.revisions] identifying the parent revision.
|
3441
3459
|
# Corresponds to the JSON property `revision`
|
3442
3460
|
# @return [Fixnum]
|
@@ -3449,6 +3467,7 @@ module Google
|
|
3449
3467
|
# Update properties of this object
|
3450
3468
|
def update!(**args)
|
3451
3469
|
@id = args[:id] if args.key?(:id)
|
3470
|
+
@index = args[:index] if args.key?(:index)
|
3452
3471
|
@revision = args[:revision] if args.key?(:revision)
|
3453
3472
|
end
|
3454
3473
|
end
|
@@ -3571,98 +3590,98 @@ module Google
|
|
3571
3590
|
|
3572
3591
|
# Represents a color in the RGBA color space. This representation is designed
|
3573
3592
|
# for simplicity of conversion to/from color representations in various
|
3574
|
-
# languages over compactness
|
3575
|
-
# be trivially provided to the constructor of
|
3576
|
-
# also be trivially provided to UIColor's
|
3593
|
+
# languages over compactness. For example, the fields of this representation can
|
3594
|
+
# be trivially provided to the constructor of `java.awt.Color` in Java; it can
|
3595
|
+
# also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha`
|
3577
3596
|
# method in iOS; and, with just a little work, it can be easily formatted into a
|
3578
|
-
# CSS
|
3597
|
+
# CSS `rgba()` string in JavaScript. This reference page doesn't carry
|
3579
3598
|
# information about the absolute color space that should be used to interpret
|
3580
3599
|
# the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default,
|
3581
|
-
# applications
|
3582
|
-
#
|
3583
|
-
#
|
3584
|
-
#
|
3585
|
-
#
|
3586
|
-
# protocolor.
|
3587
|
-
#
|
3588
|
-
#
|
3589
|
-
# float
|
3590
|
-
# float
|
3591
|
-
#
|
3592
|
-
#
|
3593
|
-
#
|
3594
|
-
#
|
3595
|
-
#
|
3596
|
-
#
|
3597
|
-
#
|
3598
|
-
#
|
3599
|
-
#
|
3600
|
-
#
|
3601
|
-
#
|
3602
|
-
#
|
3603
|
-
#
|
3604
|
-
#
|
3605
|
-
#
|
3600
|
+
# applications should assume the sRGB color space. When color equality needs to
|
3601
|
+
# be decided, implementations, unless documented otherwise, treat two colors as
|
3602
|
+
# equal if all their red, green, blue, and alpha values each differ by at most
|
3603
|
+
# 1e-5. Example (Java): import com.google.type.Color; // ... public static java.
|
3604
|
+
# awt.Color fromProto(Color protocolor) ` float alpha = protocolor.hasAlpha() ?
|
3605
|
+
# protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.
|
3606
|
+
# getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); ` public static
|
3607
|
+
# Color toProto(java.awt.Color color) ` float red = (float) color.getRed();
|
3608
|
+
# float green = (float) color.getGreen(); float blue = (float) color.getBlue();
|
3609
|
+
# float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .
|
3610
|
+
# setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue /
|
3611
|
+
# denominator); int alpha = color.getAlpha(); if (alpha != 255) ` result.
|
3612
|
+
# setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .
|
3613
|
+
# build()); ` return resultBuilder.build(); ` // ... Example (iOS / Obj-C): // ..
|
3614
|
+
# . static UIColor* fromProto(Color* protocolor) ` float red = [protocolor red];
|
3615
|
+
# float green = [protocolor green]; float blue = [protocolor blue]; FloatValue*
|
3616
|
+
# alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper !=
|
3617
|
+
# nil) ` alpha = [alpha_wrapper value]; ` return [UIColor colorWithRed:red green:
|
3618
|
+
# green blue:blue alpha:alpha]; ` static Color* toProto(UIColor* color) `
|
3619
|
+
# CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&
|
3620
|
+
# blue alpha:&alpha]) ` return nil; ` Color* result = [[Color alloc] init]; [
|
3621
|
+
# result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <
|
3622
|
+
# = 0.9999) ` [result setAlpha:floatWrapperWithValue(alpha)]; ` [result
|
3623
|
+
# autorelease]; return result; ` // ... Example (JavaScript): // ... var
|
3624
|
+
# protoToCssColor = function(rgb_color) ` var redFrac = rgb_color.red || 0.0;
|
3606
3625
|
# var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0;
|
3607
3626
|
# var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255);
|
3608
3627
|
# var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) ` return
|
3609
|
-
#
|
3628
|
+
# rgbToCssColor(red, green, blue); ` var alphaFrac = rgb_color.alpha.value || 0.
|
3610
3629
|
# 0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',
|
3611
|
-
# ', alphaFrac, ')'].join(''); `; var
|
3612
|
-
# ` var rgbNumber = new Number((red << 16) | (green << 8) | blue); var
|
3613
|
-
#
|
3614
|
-
#
|
3615
|
-
#
|
3616
|
-
#
|
3630
|
+
# ', alphaFrac, ')'].join(''); `; var rgbToCssColor = function(red, green, blue)
|
3631
|
+
# ` var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString
|
3632
|
+
# = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var
|
3633
|
+
# resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) ` resultBuilder.
|
3634
|
+
# push('0'); ` resultBuilder.push(hexString); return resultBuilder.join(''); `; /
|
3635
|
+
# / ...
|
3617
3636
|
# Corresponds to the JSON property `backgroundColor`
|
3618
3637
|
# @return [Google::Apis::DocumentaiV1beta3::GoogleTypeColor]
|
3619
3638
|
attr_accessor :background_color
|
3620
3639
|
|
3621
3640
|
# Represents a color in the RGBA color space. This representation is designed
|
3622
3641
|
# for simplicity of conversion to/from color representations in various
|
3623
|
-
# languages over compactness
|
3624
|
-
# be trivially provided to the constructor of
|
3625
|
-
# also be trivially provided to UIColor's
|
3642
|
+
# languages over compactness. For example, the fields of this representation can
|
3643
|
+
# be trivially provided to the constructor of `java.awt.Color` in Java; it can
|
3644
|
+
# also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha`
|
3626
3645
|
# method in iOS; and, with just a little work, it can be easily formatted into a
|
3627
|
-
# CSS
|
3646
|
+
# CSS `rgba()` string in JavaScript. This reference page doesn't carry
|
3628
3647
|
# information about the absolute color space that should be used to interpret
|
3629
3648
|
# the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default,
|
3630
|
-
# applications
|
3631
|
-
#
|
3632
|
-
#
|
3633
|
-
#
|
3634
|
-
#
|
3635
|
-
# protocolor.
|
3636
|
-
#
|
3637
|
-
#
|
3638
|
-
# float
|
3639
|
-
# float
|
3640
|
-
#
|
3641
|
-
#
|
3642
|
-
#
|
3643
|
-
#
|
3644
|
-
#
|
3645
|
-
#
|
3646
|
-
#
|
3647
|
-
#
|
3648
|
-
#
|
3649
|
-
#
|
3650
|
-
#
|
3651
|
-
#
|
3652
|
-
#
|
3653
|
-
#
|
3654
|
-
#
|
3649
|
+
# applications should assume the sRGB color space. When color equality needs to
|
3650
|
+
# be decided, implementations, unless documented otherwise, treat two colors as
|
3651
|
+
# equal if all their red, green, blue, and alpha values each differ by at most
|
3652
|
+
# 1e-5. Example (Java): import com.google.type.Color; // ... public static java.
|
3653
|
+
# awt.Color fromProto(Color protocolor) ` float alpha = protocolor.hasAlpha() ?
|
3654
|
+
# protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.
|
3655
|
+
# getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); ` public static
|
3656
|
+
# Color toProto(java.awt.Color color) ` float red = (float) color.getRed();
|
3657
|
+
# float green = (float) color.getGreen(); float blue = (float) color.getBlue();
|
3658
|
+
# float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .
|
3659
|
+
# setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue /
|
3660
|
+
# denominator); int alpha = color.getAlpha(); if (alpha != 255) ` result.
|
3661
|
+
# setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .
|
3662
|
+
# build()); ` return resultBuilder.build(); ` // ... Example (iOS / Obj-C): // ..
|
3663
|
+
# . static UIColor* fromProto(Color* protocolor) ` float red = [protocolor red];
|
3664
|
+
# float green = [protocolor green]; float blue = [protocolor blue]; FloatValue*
|
3665
|
+
# alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper !=
|
3666
|
+
# nil) ` alpha = [alpha_wrapper value]; ` return [UIColor colorWithRed:red green:
|
3667
|
+
# green blue:blue alpha:alpha]; ` static Color* toProto(UIColor* color) `
|
3668
|
+
# CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&
|
3669
|
+
# blue alpha:&alpha]) ` return nil; ` Color* result = [[Color alloc] init]; [
|
3670
|
+
# result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <
|
3671
|
+
# = 0.9999) ` [result setAlpha:floatWrapperWithValue(alpha)]; ` [result
|
3672
|
+
# autorelease]; return result; ` // ... Example (JavaScript): // ... var
|
3673
|
+
# protoToCssColor = function(rgb_color) ` var redFrac = rgb_color.red || 0.0;
|
3655
3674
|
# var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0;
|
3656
3675
|
# var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255);
|
3657
3676
|
# var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) ` return
|
3658
|
-
#
|
3677
|
+
# rgbToCssColor(red, green, blue); ` var alphaFrac = rgb_color.alpha.value || 0.
|
3659
3678
|
# 0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',
|
3660
|
-
# ', alphaFrac, ')'].join(''); `; var
|
3661
|
-
# ` var rgbNumber = new Number((red << 16) | (green << 8) | blue); var
|
3662
|
-
#
|
3663
|
-
#
|
3664
|
-
#
|
3665
|
-
#
|
3679
|
+
# ', alphaFrac, ')'].join(''); `; var rgbToCssColor = function(red, green, blue)
|
3680
|
+
# ` var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString
|
3681
|
+
# = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var
|
3682
|
+
# resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) ` resultBuilder.
|
3683
|
+
# push('0'); ` resultBuilder.push(hexString); return resultBuilder.join(''); `; /
|
3684
|
+
# / ...
|
3666
3685
|
# Corresponds to the JSON property `color`
|
3667
3686
|
# @return [Google::Apis::DocumentaiV1beta3::GoogleTypeColor]
|
3668
3687
|
attr_accessor :color
|
@@ -3906,7 +3925,7 @@ module Google
|
|
3906
3925
|
# @return [Float]
|
3907
3926
|
attr_accessor :x
|
3908
3927
|
|
3909
|
-
# Y coordinate.
|
3928
|
+
# Y coordinate (starts from the top of the image).
|
3910
3929
|
# Corresponds to the JSON property `y`
|
3911
3930
|
# @return [Float]
|
3912
3931
|
attr_accessor :y
|
@@ -4027,7 +4046,7 @@ module Google
|
|
4027
4046
|
# @return [Fixnum]
|
4028
4047
|
attr_accessor :x
|
4029
4048
|
|
4030
|
-
# Y coordinate.
|
4049
|
+
# Y coordinate (starts from the top of the image).
|
4031
4050
|
# Corresponds to the JSON property `y`
|
4032
4051
|
# @return [Fixnum]
|
4033
4052
|
attr_accessor :y
|
@@ -4334,6 +4353,19 @@ module Google
|
|
4334
4353
|
end
|
4335
4354
|
end
|
4336
4355
|
|
4356
|
+
# Request message for the disable processor method.
|
4357
|
+
class GoogleCloudDocumentaiV1beta3DisableProcessorRequest
|
4358
|
+
include Google::Apis::Core::Hashable
|
4359
|
+
|
4360
|
+
def initialize(**args)
|
4361
|
+
update!(**args)
|
4362
|
+
end
|
4363
|
+
|
4364
|
+
# Update properties of this object
|
4365
|
+
def update!(**args)
|
4366
|
+
end
|
4367
|
+
end
|
4368
|
+
|
4337
4369
|
# Document represents the canonical document resource in Document Understanding
|
4338
4370
|
# AI. It is an interchange format that provides insights into documents and
|
4339
4371
|
# allows for collaboration between users and Document Understanding AI to
|
@@ -4807,6 +4839,11 @@ module Google
|
|
4807
4839
|
# @return [Google::Apis::DocumentaiV1beta3::GoogleCloudDocumentaiV1beta3BoundingPoly]
|
4808
4840
|
attr_accessor :bounding_poly
|
4809
4841
|
|
4842
|
+
# Optional. Confidence of detected page element, if applicable. Range [0, 1].
|
4843
|
+
# Corresponds to the JSON property `confidence`
|
4844
|
+
# @return [Float]
|
4845
|
+
attr_accessor :confidence
|
4846
|
+
|
4810
4847
|
# Optional. Deprecated. Use PageRef.bounding_poly instead.
|
4811
4848
|
# Corresponds to the JSON property `layoutId`
|
4812
4849
|
# @return [String]
|
@@ -4830,6 +4867,7 @@ module Google
|
|
4830
4867
|
# Update properties of this object
|
4831
4868
|
def update!(**args)
|
4832
4869
|
@bounding_poly = args[:bounding_poly] if args.key?(:bounding_poly)
|
4870
|
+
@confidence = args[:confidence] if args.key?(:confidence)
|
4833
4871
|
@layout_id = args[:layout_id] if args.key?(:layout_id)
|
4834
4872
|
@layout_type = args[:layout_type] if args.key?(:layout_type)
|
4835
4873
|
@page = args[:page] if args.key?(:page)
|
@@ -5384,6 +5422,12 @@ module Google
|
|
5384
5422
|
# @return [Fixnum]
|
5385
5423
|
attr_accessor :id
|
5386
5424
|
|
5425
|
+
# The index of the parent revisions corresponding collection of items (eg. list
|
5426
|
+
# of entities, properties within entities, etc.)
|
5427
|
+
# Corresponds to the JSON property `index`
|
5428
|
+
# @return [Fixnum]
|
5429
|
+
attr_accessor :index
|
5430
|
+
|
5387
5431
|
# The index of the [Document.revisions] identifying the parent revision.
|
5388
5432
|
# Corresponds to the JSON property `revision`
|
5389
5433
|
# @return [Fixnum]
|
@@ -5396,6 +5440,7 @@ module Google
|
|
5396
5440
|
# Update properties of this object
|
5397
5441
|
def update!(**args)
|
5398
5442
|
@id = args[:id] if args.key?(:id)
|
5443
|
+
@index = args[:index] if args.key?(:index)
|
5399
5444
|
@revision = args[:revision] if args.key?(:revision)
|
5400
5445
|
end
|
5401
5446
|
end
|
@@ -5518,98 +5563,98 @@ module Google
|
|
5518
5563
|
|
5519
5564
|
# Represents a color in the RGBA color space. This representation is designed
|
5520
5565
|
# for simplicity of conversion to/from color representations in various
|
5521
|
-
# languages over compactness
|
5522
|
-
# be trivially provided to the constructor of
|
5523
|
-
# also be trivially provided to UIColor's
|
5566
|
+
# languages over compactness. For example, the fields of this representation can
|
5567
|
+
# be trivially provided to the constructor of `java.awt.Color` in Java; it can
|
5568
|
+
# also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha`
|
5524
5569
|
# method in iOS; and, with just a little work, it can be easily formatted into a
|
5525
|
-
# CSS
|
5570
|
+
# CSS `rgba()` string in JavaScript. This reference page doesn't carry
|
5526
5571
|
# information about the absolute color space that should be used to interpret
|
5527
5572
|
# the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default,
|
5528
|
-
# applications
|
5529
|
-
#
|
5530
|
-
#
|
5531
|
-
#
|
5532
|
-
#
|
5533
|
-
# protocolor.
|
5534
|
-
#
|
5535
|
-
#
|
5536
|
-
# float
|
5537
|
-
# float
|
5538
|
-
#
|
5539
|
-
#
|
5540
|
-
#
|
5541
|
-
#
|
5542
|
-
#
|
5543
|
-
#
|
5544
|
-
#
|
5545
|
-
#
|
5546
|
-
#
|
5547
|
-
#
|
5548
|
-
#
|
5549
|
-
#
|
5550
|
-
#
|
5551
|
-
#
|
5552
|
-
#
|
5573
|
+
# applications should assume the sRGB color space. When color equality needs to
|
5574
|
+
# be decided, implementations, unless documented otherwise, treat two colors as
|
5575
|
+
# equal if all their red, green, blue, and alpha values each differ by at most
|
5576
|
+
# 1e-5. Example (Java): import com.google.type.Color; // ... public static java.
|
5577
|
+
# awt.Color fromProto(Color protocolor) ` float alpha = protocolor.hasAlpha() ?
|
5578
|
+
# protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.
|
5579
|
+
# getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); ` public static
|
5580
|
+
# Color toProto(java.awt.Color color) ` float red = (float) color.getRed();
|
5581
|
+
# float green = (float) color.getGreen(); float blue = (float) color.getBlue();
|
5582
|
+
# float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .
|
5583
|
+
# setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue /
|
5584
|
+
# denominator); int alpha = color.getAlpha(); if (alpha != 255) ` result.
|
5585
|
+
# setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .
|
5586
|
+
# build()); ` return resultBuilder.build(); ` // ... Example (iOS / Obj-C): // ..
|
5587
|
+
# . static UIColor* fromProto(Color* protocolor) ` float red = [protocolor red];
|
5588
|
+
# float green = [protocolor green]; float blue = [protocolor blue]; FloatValue*
|
5589
|
+
# alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper !=
|
5590
|
+
# nil) ` alpha = [alpha_wrapper value]; ` return [UIColor colorWithRed:red green:
|
5591
|
+
# green blue:blue alpha:alpha]; ` static Color* toProto(UIColor* color) `
|
5592
|
+
# CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&
|
5593
|
+
# blue alpha:&alpha]) ` return nil; ` Color* result = [[Color alloc] init]; [
|
5594
|
+
# result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <
|
5595
|
+
# = 0.9999) ` [result setAlpha:floatWrapperWithValue(alpha)]; ` [result
|
5596
|
+
# autorelease]; return result; ` // ... Example (JavaScript): // ... var
|
5597
|
+
# protoToCssColor = function(rgb_color) ` var redFrac = rgb_color.red || 0.0;
|
5553
5598
|
# var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0;
|
5554
5599
|
# var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255);
|
5555
5600
|
# var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) ` return
|
5556
|
-
#
|
5601
|
+
# rgbToCssColor(red, green, blue); ` var alphaFrac = rgb_color.alpha.value || 0.
|
5557
5602
|
# 0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',
|
5558
|
-
# ', alphaFrac, ')'].join(''); `; var
|
5559
|
-
# ` var rgbNumber = new Number((red << 16) | (green << 8) | blue); var
|
5560
|
-
#
|
5561
|
-
#
|
5562
|
-
#
|
5563
|
-
#
|
5603
|
+
# ', alphaFrac, ')'].join(''); `; var rgbToCssColor = function(red, green, blue)
|
5604
|
+
# ` var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString
|
5605
|
+
# = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var
|
5606
|
+
# resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) ` resultBuilder.
|
5607
|
+
# push('0'); ` resultBuilder.push(hexString); return resultBuilder.join(''); `; /
|
5608
|
+
# / ...
|
5564
5609
|
# Corresponds to the JSON property `backgroundColor`
|
5565
5610
|
# @return [Google::Apis::DocumentaiV1beta3::GoogleTypeColor]
|
5566
5611
|
attr_accessor :background_color
|
5567
5612
|
|
5568
5613
|
# Represents a color in the RGBA color space. This representation is designed
|
5569
5614
|
# for simplicity of conversion to/from color representations in various
|
5570
|
-
# languages over compactness
|
5571
|
-
# be trivially provided to the constructor of
|
5572
|
-
# also be trivially provided to UIColor's
|
5615
|
+
# languages over compactness. For example, the fields of this representation can
|
5616
|
+
# be trivially provided to the constructor of `java.awt.Color` in Java; it can
|
5617
|
+
# also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha`
|
5573
5618
|
# method in iOS; and, with just a little work, it can be easily formatted into a
|
5574
|
-
# CSS
|
5619
|
+
# CSS `rgba()` string in JavaScript. This reference page doesn't carry
|
5575
5620
|
# information about the absolute color space that should be used to interpret
|
5576
5621
|
# the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default,
|
5577
|
-
# applications
|
5578
|
-
#
|
5579
|
-
#
|
5580
|
-
#
|
5581
|
-
#
|
5582
|
-
# protocolor.
|
5583
|
-
#
|
5584
|
-
#
|
5585
|
-
# float
|
5586
|
-
# float
|
5587
|
-
#
|
5588
|
-
#
|
5589
|
-
#
|
5590
|
-
#
|
5591
|
-
#
|
5592
|
-
#
|
5593
|
-
#
|
5594
|
-
#
|
5595
|
-
#
|
5596
|
-
#
|
5597
|
-
#
|
5598
|
-
#
|
5599
|
-
#
|
5600
|
-
#
|
5601
|
-
#
|
5622
|
+
# applications should assume the sRGB color space. When color equality needs to
|
5623
|
+
# be decided, implementations, unless documented otherwise, treat two colors as
|
5624
|
+
# equal if all their red, green, blue, and alpha values each differ by at most
|
5625
|
+
# 1e-5. Example (Java): import com.google.type.Color; // ... public static java.
|
5626
|
+
# awt.Color fromProto(Color protocolor) ` float alpha = protocolor.hasAlpha() ?
|
5627
|
+
# protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.
|
5628
|
+
# getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); ` public static
|
5629
|
+
# Color toProto(java.awt.Color color) ` float red = (float) color.getRed();
|
5630
|
+
# float green = (float) color.getGreen(); float blue = (float) color.getBlue();
|
5631
|
+
# float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .
|
5632
|
+
# setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue /
|
5633
|
+
# denominator); int alpha = color.getAlpha(); if (alpha != 255) ` result.
|
5634
|
+
# setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .
|
5635
|
+
# build()); ` return resultBuilder.build(); ` // ... Example (iOS / Obj-C): // ..
|
5636
|
+
# . static UIColor* fromProto(Color* protocolor) ` float red = [protocolor red];
|
5637
|
+
# float green = [protocolor green]; float blue = [protocolor blue]; FloatValue*
|
5638
|
+
# alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper !=
|
5639
|
+
# nil) ` alpha = [alpha_wrapper value]; ` return [UIColor colorWithRed:red green:
|
5640
|
+
# green blue:blue alpha:alpha]; ` static Color* toProto(UIColor* color) `
|
5641
|
+
# CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&
|
5642
|
+
# blue alpha:&alpha]) ` return nil; ` Color* result = [[Color alloc] init]; [
|
5643
|
+
# result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <
|
5644
|
+
# = 0.9999) ` [result setAlpha:floatWrapperWithValue(alpha)]; ` [result
|
5645
|
+
# autorelease]; return result; ` // ... Example (JavaScript): // ... var
|
5646
|
+
# protoToCssColor = function(rgb_color) ` var redFrac = rgb_color.red || 0.0;
|
5602
5647
|
# var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0;
|
5603
5648
|
# var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255);
|
5604
5649
|
# var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) ` return
|
5605
|
-
#
|
5650
|
+
# rgbToCssColor(red, green, blue); ` var alphaFrac = rgb_color.alpha.value || 0.
|
5606
5651
|
# 0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',
|
5607
|
-
# ', alphaFrac, ')'].join(''); `; var
|
5608
|
-
# ` var rgbNumber = new Number((red << 16) | (green << 8) | blue); var
|
5609
|
-
#
|
5610
|
-
#
|
5611
|
-
#
|
5612
|
-
#
|
5652
|
+
# ', alphaFrac, ')'].join(''); `; var rgbToCssColor = function(red, green, blue)
|
5653
|
+
# ` var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString
|
5654
|
+
# = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var
|
5655
|
+
# resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) ` resultBuilder.
|
5656
|
+
# push('0'); ` resultBuilder.push(hexString); return resultBuilder.join(''); `; /
|
5657
|
+
# / ...
|
5613
5658
|
# Corresponds to the JSON property `color`
|
5614
5659
|
# @return [Google::Apis::DocumentaiV1beta3::GoogleTypeColor]
|
5615
5660
|
attr_accessor :color
|
@@ -5767,6 +5812,38 @@ module Google
|
|
5767
5812
|
end
|
5768
5813
|
end
|
5769
5814
|
|
5815
|
+
# Request message for the enable processor method.
|
5816
|
+
class GoogleCloudDocumentaiV1beta3EnableProcessorRequest
|
5817
|
+
include Google::Apis::Core::Hashable
|
5818
|
+
|
5819
|
+
def initialize(**args)
|
5820
|
+
update!(**args)
|
5821
|
+
end
|
5822
|
+
|
5823
|
+
# Update properties of this object
|
5824
|
+
def update!(**args)
|
5825
|
+
end
|
5826
|
+
end
|
5827
|
+
|
5828
|
+
# Response message for fetch processor types.
|
5829
|
+
class GoogleCloudDocumentaiV1beta3FetchProcessorTypesResponse
|
5830
|
+
include Google::Apis::Core::Hashable
|
5831
|
+
|
5832
|
+
# The list of processor types.
|
5833
|
+
# Corresponds to the JSON property `processorTypes`
|
5834
|
+
# @return [Array<Google::Apis::DocumentaiV1beta3::GoogleCloudDocumentaiV1beta3ProcessorType>]
|
5835
|
+
attr_accessor :processor_types
|
5836
|
+
|
5837
|
+
def initialize(**args)
|
5838
|
+
update!(**args)
|
5839
|
+
end
|
5840
|
+
|
5841
|
+
# Update properties of this object
|
5842
|
+
def update!(**args)
|
5843
|
+
@processor_types = args[:processor_types] if args.key?(:processor_types)
|
5844
|
+
end
|
5845
|
+
end
|
5846
|
+
|
5770
5847
|
# Specifies a document stored on Cloud Storage.
|
5771
5848
|
class GoogleCloudDocumentaiV1beta3GcsDocument
|
5772
5849
|
include Google::Apis::Core::Hashable
|
@@ -5864,6 +5941,31 @@ module Google
|
|
5864
5941
|
end
|
5865
5942
|
end
|
5866
5943
|
|
5944
|
+
# Response message for list processors.
|
5945
|
+
class GoogleCloudDocumentaiV1beta3ListProcessorsResponse
|
5946
|
+
include Google::Apis::Core::Hashable
|
5947
|
+
|
5948
|
+
# Points to the next processor, otherwise empty.
|
5949
|
+
# Corresponds to the JSON property `nextPageToken`
|
5950
|
+
# @return [String]
|
5951
|
+
attr_accessor :next_page_token
|
5952
|
+
|
5953
|
+
# The list of processors.
|
5954
|
+
# Corresponds to the JSON property `processors`
|
5955
|
+
# @return [Array<Google::Apis::DocumentaiV1beta3::GoogleCloudDocumentaiV1beta3Processor>]
|
5956
|
+
attr_accessor :processors
|
5957
|
+
|
5958
|
+
def initialize(**args)
|
5959
|
+
update!(**args)
|
5960
|
+
end
|
5961
|
+
|
5962
|
+
# Update properties of this object
|
5963
|
+
def update!(**args)
|
5964
|
+
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
|
5965
|
+
@processors = args[:processors] if args.key?(:processors)
|
5966
|
+
end
|
5967
|
+
end
|
5968
|
+
|
5867
5969
|
# A vertex represents a 2D point in the image. NOTE: the normalized vertex
|
5868
5970
|
# coordinates are relative to the original image and range from 0 to 1.
|
5869
5971
|
class GoogleCloudDocumentaiV1beta3NormalizedVertex
|
@@ -5874,7 +5976,7 @@ module Google
|
|
5874
5976
|
# @return [Float]
|
5875
5977
|
attr_accessor :x
|
5876
5978
|
|
5877
|
-
# Y coordinate.
|
5979
|
+
# Y coordinate (starts from the top of the image).
|
5878
5980
|
# Corresponds to the JSON property `y`
|
5879
5981
|
# @return [Float]
|
5880
5982
|
attr_accessor :y
|
@@ -5972,6 +6074,158 @@ module Google
|
|
5972
6074
|
end
|
5973
6075
|
end
|
5974
6076
|
|
6077
|
+
# The first-class citizen for DAI. Each processor defines how to extract
|
6078
|
+
# structural information from a document.
|
6079
|
+
class GoogleCloudDocumentaiV1beta3Processor
|
6080
|
+
include Google::Apis::Core::Hashable
|
6081
|
+
|
6082
|
+
# The time the processor was created.
|
6083
|
+
# Corresponds to the JSON property `createTime`
|
6084
|
+
# @return [String]
|
6085
|
+
attr_accessor :create_time
|
6086
|
+
|
6087
|
+
# The default processor version.
|
6088
|
+
# Corresponds to the JSON property `defaultProcessorVersion`
|
6089
|
+
# @return [String]
|
6090
|
+
attr_accessor :default_processor_version
|
6091
|
+
|
6092
|
+
# The display name of the processor.
|
6093
|
+
# Corresponds to the JSON property `displayName`
|
6094
|
+
# @return [String]
|
6095
|
+
attr_accessor :display_name
|
6096
|
+
|
6097
|
+
# The KMS key used for encryption/decryption in CMEK scenarios. See https://
|
6098
|
+
# cloud.google.com/security-key-management.
|
6099
|
+
# Corresponds to the JSON property `kmsKeyName`
|
6100
|
+
# @return [String]
|
6101
|
+
attr_accessor :kms_key_name
|
6102
|
+
|
6103
|
+
# Output only. Immutable. The resource name of the processor. Format: projects/`
|
6104
|
+
# project`/locations/`location`/processors/`processor`
|
6105
|
+
# Corresponds to the JSON property `name`
|
6106
|
+
# @return [String]
|
6107
|
+
attr_accessor :name
|
6108
|
+
|
6109
|
+
# Output only. Immutable. The http endpoint that can be called to invoke
|
6110
|
+
# processing.
|
6111
|
+
# Corresponds to the JSON property `processEndpoint`
|
6112
|
+
# @return [String]
|
6113
|
+
attr_accessor :process_endpoint
|
6114
|
+
|
6115
|
+
# Output only. The state of the processor.
|
6116
|
+
# Corresponds to the JSON property `state`
|
6117
|
+
# @return [String]
|
6118
|
+
attr_accessor :state
|
6119
|
+
|
6120
|
+
# The processor type, e.g., INVOICE_PARSING, W2_PARSING, etc.
|
6121
|
+
# Corresponds to the JSON property `type`
|
6122
|
+
# @return [String]
|
6123
|
+
attr_accessor :type
|
6124
|
+
|
6125
|
+
def initialize(**args)
|
6126
|
+
update!(**args)
|
6127
|
+
end
|
6128
|
+
|
6129
|
+
# Update properties of this object
|
6130
|
+
def update!(**args)
|
6131
|
+
@create_time = args[:create_time] if args.key?(:create_time)
|
6132
|
+
@default_processor_version = args[:default_processor_version] if args.key?(:default_processor_version)
|
6133
|
+
@display_name = args[:display_name] if args.key?(:display_name)
|
6134
|
+
@kms_key_name = args[:kms_key_name] if args.key?(:kms_key_name)
|
6135
|
+
@name = args[:name] if args.key?(:name)
|
6136
|
+
@process_endpoint = args[:process_endpoint] if args.key?(:process_endpoint)
|
6137
|
+
@state = args[:state] if args.key?(:state)
|
6138
|
+
@type = args[:type] if args.key?(:type)
|
6139
|
+
end
|
6140
|
+
end
|
6141
|
+
|
6142
|
+
# A processor type is responsible for performing a certain document
|
6143
|
+
# understanding task on a certain type of document. All processor types are
|
6144
|
+
# created by the documentai service internally. User will only list all
|
6145
|
+
# available processor types via UI. For different users (projects), the
|
6146
|
+
# available processor types may be different since we'll expose the access of
|
6147
|
+
# some types via EAP whitelisting. We make the ProcessorType a resource under
|
6148
|
+
# location so we have a unified API and keep the possibility that UI will load
|
6149
|
+
# different available processor types from different regions. But for alpha the
|
6150
|
+
# behavior is that the user will always get the union of all available processor
|
6151
|
+
# types among all regions no matter which regionalized endpoint is called, and
|
6152
|
+
# then we use the 'available_locations' field to show under which regions a
|
6153
|
+
# processor type is available. For example, users can call either the 'US' or '
|
6154
|
+
# EU' endpoint to feach processor types. In the return, we will have an 'invoice
|
6155
|
+
# parsing' processor with 'available_locations' field only containing 'US'. So
|
6156
|
+
# the user can try to create an 'invoice parsing' processor under the location '
|
6157
|
+
# US'. Such attempt of creating under the location 'EU' will fail. Next ID: 7.
|
6158
|
+
class GoogleCloudDocumentaiV1beta3ProcessorType
|
6159
|
+
include Google::Apis::Core::Hashable
|
6160
|
+
|
6161
|
+
# Whether the processor type allows creation. If yes, user can create a
|
6162
|
+
# processor of this processor type. Otherwise, user needs to require for
|
6163
|
+
# whitelisting.
|
6164
|
+
# Corresponds to the JSON property `allowCreation`
|
6165
|
+
# @return [Boolean]
|
6166
|
+
attr_accessor :allow_creation
|
6167
|
+
alias_method :allow_creation?, :allow_creation
|
6168
|
+
|
6169
|
+
# The locations in which this processor is available.
|
6170
|
+
# Corresponds to the JSON property `availableLocations`
|
6171
|
+
# @return [Array<Google::Apis::DocumentaiV1beta3::GoogleCloudDocumentaiV1beta3ProcessorTypeLocationInfo>]
|
6172
|
+
attr_accessor :available_locations
|
6173
|
+
|
6174
|
+
# The processor category, used by UI to group processor types.
|
6175
|
+
# Corresponds to the JSON property `category`
|
6176
|
+
# @return [String]
|
6177
|
+
attr_accessor :category
|
6178
|
+
|
6179
|
+
# The resource name of the processor type. Format: projects/`project`/
|
6180
|
+
# processorTypes/`processor_type`
|
6181
|
+
# Corresponds to the JSON property `name`
|
6182
|
+
# @return [String]
|
6183
|
+
attr_accessor :name
|
6184
|
+
|
6185
|
+
# The schema defines the output of the processed document by a processor.
|
6186
|
+
# Corresponds to the JSON property `schema`
|
6187
|
+
# @return [Google::Apis::DocumentaiV1beta3::GoogleCloudDocumentaiV1beta3Schema]
|
6188
|
+
attr_accessor :schema
|
6189
|
+
|
6190
|
+
# The type of the processor, e.g, "invoice_parsing".
|
6191
|
+
# Corresponds to the JSON property `type`
|
6192
|
+
# @return [String]
|
6193
|
+
attr_accessor :type
|
6194
|
+
|
6195
|
+
def initialize(**args)
|
6196
|
+
update!(**args)
|
6197
|
+
end
|
6198
|
+
|
6199
|
+
# Update properties of this object
|
6200
|
+
def update!(**args)
|
6201
|
+
@allow_creation = args[:allow_creation] if args.key?(:allow_creation)
|
6202
|
+
@available_locations = args[:available_locations] if args.key?(:available_locations)
|
6203
|
+
@category = args[:category] if args.key?(:category)
|
6204
|
+
@name = args[:name] if args.key?(:name)
|
6205
|
+
@schema = args[:schema] if args.key?(:schema)
|
6206
|
+
@type = args[:type] if args.key?(:type)
|
6207
|
+
end
|
6208
|
+
end
|
6209
|
+
|
6210
|
+
# The location information about where the processor is available.
|
6211
|
+
class GoogleCloudDocumentaiV1beta3ProcessorTypeLocationInfo
|
6212
|
+
include Google::Apis::Core::Hashable
|
6213
|
+
|
6214
|
+
# The location id, currently must be one of [us, eu].
|
6215
|
+
# Corresponds to the JSON property `locationId`
|
6216
|
+
# @return [String]
|
6217
|
+
attr_accessor :location_id
|
6218
|
+
|
6219
|
+
def initialize(**args)
|
6220
|
+
update!(**args)
|
6221
|
+
end
|
6222
|
+
|
6223
|
+
# Update properties of this object
|
6224
|
+
def update!(**args)
|
6225
|
+
@location_id = args[:location_id] if args.key?(:location_id)
|
6226
|
+
end
|
6227
|
+
end
|
6228
|
+
|
5975
6229
|
# Payload message of raw document content (bytes).
|
5976
6230
|
class GoogleCloudDocumentaiV1beta3RawDocument
|
5977
6231
|
include Google::Apis::Core::Hashable
|
@@ -6092,6 +6346,105 @@ module Google
|
|
6092
6346
|
end
|
6093
6347
|
end
|
6094
6348
|
|
6349
|
+
# The schema defines the output of the processed document by a processor.
|
6350
|
+
class GoogleCloudDocumentaiV1beta3Schema
|
6351
|
+
include Google::Apis::Core::Hashable
|
6352
|
+
|
6353
|
+
# Description of the schema.
|
6354
|
+
# Corresponds to the JSON property `description`
|
6355
|
+
# @return [String]
|
6356
|
+
attr_accessor :description
|
6357
|
+
|
6358
|
+
# Display name to show to users.
|
6359
|
+
# Corresponds to the JSON property `displayName`
|
6360
|
+
# @return [String]
|
6361
|
+
attr_accessor :display_name
|
6362
|
+
|
6363
|
+
# Entity types of the schema.
|
6364
|
+
# Corresponds to the JSON property `entityTypes`
|
6365
|
+
# @return [Array<Google::Apis::DocumentaiV1beta3::GoogleCloudDocumentaiV1beta3SchemaEntityType>]
|
6366
|
+
attr_accessor :entity_types
|
6367
|
+
|
6368
|
+
def initialize(**args)
|
6369
|
+
update!(**args)
|
6370
|
+
end
|
6371
|
+
|
6372
|
+
# Update properties of this object
|
6373
|
+
def update!(**args)
|
6374
|
+
@description = args[:description] if args.key?(:description)
|
6375
|
+
@display_name = args[:display_name] if args.key?(:display_name)
|
6376
|
+
@entity_types = args[:entity_types] if args.key?(:entity_types)
|
6377
|
+
end
|
6378
|
+
end
|
6379
|
+
|
6380
|
+
# EntityType is the wrapper of a label of the corresponding model with detailed
|
6381
|
+
# attributes and limitations for entity-based processors. Multiple types can
|
6382
|
+
# also compose a dependency tree to represent nested types.
|
6383
|
+
class GoogleCloudDocumentaiV1beta3SchemaEntityType
|
6384
|
+
include Google::Apis::Core::Hashable
|
6385
|
+
|
6386
|
+
# Type of the entity. It must be one of the following: `document` - the entity
|
6387
|
+
# represents a classification of a logical document. `object` - if the entity
|
6388
|
+
# has properties it is likely an object (or or a document.) `datetime` - the
|
6389
|
+
# entity is a date or time value. `money` - the entity represents a money value
|
6390
|
+
# amount. `number` - the entity is a number - integer or floating point. `string`
|
6391
|
+
# - the entity is a string value. `boolean` - the entity is a boolean value. `
|
6392
|
+
# address` - the entity is a location address.
|
6393
|
+
# Corresponds to the JSON property `baseType`
|
6394
|
+
# @return [String]
|
6395
|
+
attr_accessor :base_type
|
6396
|
+
|
6397
|
+
# Description of the entity type.
|
6398
|
+
# Corresponds to the JSON property `description`
|
6399
|
+
# @return [String]
|
6400
|
+
attr_accessor :description
|
6401
|
+
|
6402
|
+
# If specified, lists all the possible values for this entity.
|
6403
|
+
# Corresponds to the JSON property `enumValues`
|
6404
|
+
# @return [Array<String>]
|
6405
|
+
attr_accessor :enum_values
|
6406
|
+
|
6407
|
+
# Occurrence type limits the number of times an entity type appears in the
|
6408
|
+
# document.
|
6409
|
+
# Corresponds to the JSON property `occurrenceType`
|
6410
|
+
# @return [String]
|
6411
|
+
attr_accessor :occurrence_type
|
6412
|
+
|
6413
|
+
# Describing the nested structure of an entity. An EntityType may consist of
|
6414
|
+
# several other EntityTypes. For example, in a document there can be an
|
6415
|
+
# EntityType 'ID', which consists of EntityType 'name' and 'address', with
|
6416
|
+
# corresponding attributes, such as TEXT for both types and ONCE for occurrence
|
6417
|
+
# types.
|
6418
|
+
# Corresponds to the JSON property `properties`
|
6419
|
+
# @return [Array<Google::Apis::DocumentaiV1beta3::GoogleCloudDocumentaiV1beta3SchemaEntityType>]
|
6420
|
+
attr_accessor :properties
|
6421
|
+
|
6422
|
+
# Source of this entity type.
|
6423
|
+
# Corresponds to the JSON property `source`
|
6424
|
+
# @return [String]
|
6425
|
+
attr_accessor :source
|
6426
|
+
|
6427
|
+
# Name of the type. It must be unique within the set of same level types.
|
6428
|
+
# Corresponds to the JSON property `type`
|
6429
|
+
# @return [String]
|
6430
|
+
attr_accessor :type
|
6431
|
+
|
6432
|
+
def initialize(**args)
|
6433
|
+
update!(**args)
|
6434
|
+
end
|
6435
|
+
|
6436
|
+
# Update properties of this object
|
6437
|
+
def update!(**args)
|
6438
|
+
@base_type = args[:base_type] if args.key?(:base_type)
|
6439
|
+
@description = args[:description] if args.key?(:description)
|
6440
|
+
@enum_values = args[:enum_values] if args.key?(:enum_values)
|
6441
|
+
@occurrence_type = args[:occurrence_type] if args.key?(:occurrence_type)
|
6442
|
+
@properties = args[:properties] if args.key?(:properties)
|
6443
|
+
@source = args[:source] if args.key?(:source)
|
6444
|
+
@type = args[:type] if args.key?(:type)
|
6445
|
+
end
|
6446
|
+
end
|
6447
|
+
|
6095
6448
|
# A vertex represents a 2D point in the image. NOTE: the vertex coordinates are
|
6096
6449
|
# in the same scale as the original image.
|
6097
6450
|
class GoogleCloudDocumentaiV1beta3Vertex
|
@@ -6102,7 +6455,7 @@ module Google
|
|
6102
6455
|
# @return [Fixnum]
|
6103
6456
|
attr_accessor :x
|
6104
6457
|
|
6105
|
-
# Y coordinate.
|
6458
|
+
# Y coordinate (starts from the top of the image).
|
6106
6459
|
# Corresponds to the JSON property `y`
|
6107
6460
|
# @return [Fixnum]
|
6108
6461
|
attr_accessor :y
|
@@ -6190,6 +6543,31 @@ module Google
|
|
6190
6543
|
end
|
6191
6544
|
end
|
6192
6545
|
|
6546
|
+
# The response message for Operations.ListOperations.
|
6547
|
+
class GoogleLongrunningListOperationsResponse
|
6548
|
+
include Google::Apis::Core::Hashable
|
6549
|
+
|
6550
|
+
# The standard List next-page token.
|
6551
|
+
# Corresponds to the JSON property `nextPageToken`
|
6552
|
+
# @return [String]
|
6553
|
+
attr_accessor :next_page_token
|
6554
|
+
|
6555
|
+
# A list of operations that matches the specified filter in the request.
|
6556
|
+
# Corresponds to the JSON property `operations`
|
6557
|
+
# @return [Array<Google::Apis::DocumentaiV1beta3::GoogleLongrunningOperation>]
|
6558
|
+
attr_accessor :operations
|
6559
|
+
|
6560
|
+
def initialize(**args)
|
6561
|
+
update!(**args)
|
6562
|
+
end
|
6563
|
+
|
6564
|
+
# Update properties of this object
|
6565
|
+
def update!(**args)
|
6566
|
+
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
|
6567
|
+
@operations = args[:operations] if args.key?(:operations)
|
6568
|
+
end
|
6569
|
+
end
|
6570
|
+
|
6193
6571
|
# This resource represents a long-running operation that is the result of a
|
6194
6572
|
# network API call.
|
6195
6573
|
class GoogleLongrunningOperation
|
@@ -6310,61 +6688,60 @@ module Google
|
|
6310
6688
|
|
6311
6689
|
# Represents a color in the RGBA color space. This representation is designed
|
6312
6690
|
# for simplicity of conversion to/from color representations in various
|
6313
|
-
# languages over compactness
|
6314
|
-
# be trivially provided to the constructor of
|
6315
|
-
# also be trivially provided to UIColor's
|
6691
|
+
# languages over compactness. For example, the fields of this representation can
|
6692
|
+
# be trivially provided to the constructor of `java.awt.Color` in Java; it can
|
6693
|
+
# also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha`
|
6316
6694
|
# method in iOS; and, with just a little work, it can be easily formatted into a
|
6317
|
-
# CSS
|
6695
|
+
# CSS `rgba()` string in JavaScript. This reference page doesn't carry
|
6318
6696
|
# information about the absolute color space that should be used to interpret
|
6319
6697
|
# the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default,
|
6320
|
-
# applications
|
6321
|
-
#
|
6322
|
-
#
|
6323
|
-
#
|
6324
|
-
#
|
6325
|
-
# protocolor.
|
6326
|
-
#
|
6327
|
-
#
|
6328
|
-
# float
|
6329
|
-
# float
|
6330
|
-
#
|
6331
|
-
#
|
6332
|
-
#
|
6333
|
-
#
|
6334
|
-
#
|
6335
|
-
#
|
6336
|
-
#
|
6337
|
-
#
|
6338
|
-
#
|
6339
|
-
#
|
6340
|
-
#
|
6341
|
-
#
|
6342
|
-
#
|
6343
|
-
#
|
6344
|
-
#
|
6698
|
+
# applications should assume the sRGB color space. When color equality needs to
|
6699
|
+
# be decided, implementations, unless documented otherwise, treat two colors as
|
6700
|
+
# equal if all their red, green, blue, and alpha values each differ by at most
|
6701
|
+
# 1e-5. Example (Java): import com.google.type.Color; // ... public static java.
|
6702
|
+
# awt.Color fromProto(Color protocolor) ` float alpha = protocolor.hasAlpha() ?
|
6703
|
+
# protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.
|
6704
|
+
# getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); ` public static
|
6705
|
+
# Color toProto(java.awt.Color color) ` float red = (float) color.getRed();
|
6706
|
+
# float green = (float) color.getGreen(); float blue = (float) color.getBlue();
|
6707
|
+
# float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .
|
6708
|
+
# setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue /
|
6709
|
+
# denominator); int alpha = color.getAlpha(); if (alpha != 255) ` result.
|
6710
|
+
# setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .
|
6711
|
+
# build()); ` return resultBuilder.build(); ` // ... Example (iOS / Obj-C): // ..
|
6712
|
+
# . static UIColor* fromProto(Color* protocolor) ` float red = [protocolor red];
|
6713
|
+
# float green = [protocolor green]; float blue = [protocolor blue]; FloatValue*
|
6714
|
+
# alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper !=
|
6715
|
+
# nil) ` alpha = [alpha_wrapper value]; ` return [UIColor colorWithRed:red green:
|
6716
|
+
# green blue:blue alpha:alpha]; ` static Color* toProto(UIColor* color) `
|
6717
|
+
# CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&
|
6718
|
+
# blue alpha:&alpha]) ` return nil; ` Color* result = [[Color alloc] init]; [
|
6719
|
+
# result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <
|
6720
|
+
# = 0.9999) ` [result setAlpha:floatWrapperWithValue(alpha)]; ` [result
|
6721
|
+
# autorelease]; return result; ` // ... Example (JavaScript): // ... var
|
6722
|
+
# protoToCssColor = function(rgb_color) ` var redFrac = rgb_color.red || 0.0;
|
6345
6723
|
# var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0;
|
6346
6724
|
# var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255);
|
6347
6725
|
# var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) ` return
|
6348
|
-
#
|
6726
|
+
# rgbToCssColor(red, green, blue); ` var alphaFrac = rgb_color.alpha.value || 0.
|
6349
6727
|
# 0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',
|
6350
|
-
# ', alphaFrac, ')'].join(''); `; var
|
6351
|
-
# ` var rgbNumber = new Number((red << 16) | (green << 8) | blue); var
|
6352
|
-
#
|
6353
|
-
#
|
6354
|
-
#
|
6355
|
-
#
|
6728
|
+
# ', alphaFrac, ')'].join(''); `; var rgbToCssColor = function(red, green, blue)
|
6729
|
+
# ` var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString
|
6730
|
+
# = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var
|
6731
|
+
# resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) ` resultBuilder.
|
6732
|
+
# push('0'); ` resultBuilder.push(hexString); return resultBuilder.join(''); `; /
|
6733
|
+
# / ...
|
6356
6734
|
class GoogleTypeColor
|
6357
6735
|
include Google::Apis::Core::Hashable
|
6358
6736
|
|
6359
6737
|
# The fraction of this color that should be applied to the pixel. That is, the
|
6360
|
-
# final pixel color is defined by the equation: pixel color = alpha * (this
|
6361
|
-
# color) + (1.0 - alpha) * (background color) This means that a value of 1.0
|
6738
|
+
# final pixel color is defined by the equation: `pixel color = alpha * (this
|
6739
|
+
# color) + (1.0 - alpha) * (background color)` This means that a value of 1.0
|
6362
6740
|
# corresponds to a solid color, whereas a value of 0.0 corresponds to a
|
6363
6741
|
# completely transparent color. This uses a wrapper message rather than a simple
|
6364
6742
|
# float scalar so that it is possible to distinguish between a default value and
|
6365
|
-
# the value being unset. If omitted, this color object is
|
6366
|
-
#
|
6367
|
-
# 0).
|
6743
|
+
# the value being unset. If omitted, this color object is rendered as a solid
|
6744
|
+
# color (as if the alpha value had been explicitly given a value of 1.0).
|
6368
6745
|
# Corresponds to the JSON property `alpha`
|
6369
6746
|
# @return [Float]
|
6370
6747
|
attr_accessor :alpha
|