google-cloud-document_ai-v1beta3 0.6.0 → 0.9.1
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/AUTHENTICATION.md +8 -8
- data/README.md +1 -1
- data/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb +468 -16
- data/lib/google/cloud/document_ai/v1beta3/document_processor_service/operations.rb +6 -6
- data/lib/google/cloud/document_ai/v1beta3/document_processor_service/paths.rb +17 -0
- data/lib/google/cloud/document_ai/v1beta3/version.rb +1 -1
- data/lib/google/cloud/documentai/v1beta3/document_pb.rb +5 -0
- data/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb +64 -16
- data/lib/google/cloud/documentai/v1beta3/document_processor_service_services_pb.rb +14 -0
- data/lib/google/cloud/documentai/v1beta3/operation_metadata_pb.rb +36 -0
- data/lib/google/cloud/documentai/v1beta3/processor_pb.rb +45 -0
- data/lib/google/cloud/documentai/v1beta3/processor_type_pb.rb +32 -0
- data/proto_docs/google/api/field_behavior.rb +7 -1
- data/proto_docs/google/cloud/documentai/v1beta3/document.rb +30 -20
- data/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb +149 -39
- data/proto_docs/google/cloud/documentai/v1beta3/geometry.rb +2 -2
- data/proto_docs/google/cloud/documentai/v1beta3/operation_metadata.rb +65 -0
- data/proto_docs/google/cloud/documentai/v1beta3/processor.rb +86 -0
- data/proto_docs/google/cloud/documentai/v1beta3/processor_type.rb +59 -0
- data/proto_docs/google/type/color.rb +16 -11
- data/proto_docs/google/type/date.rb +14 -11
- data/proto_docs/google/type/datetime.rb +9 -1
- data/proto_docs/google/type/money.rb +1 -1
- metadata +19 -7
@@ -229,7 +229,140 @@ module Google
|
|
229
229
|
end
|
230
230
|
end
|
231
231
|
|
232
|
+
# Request message for fetch processor types.
|
233
|
+
# @!attribute [rw] parent
|
234
|
+
# @return [::String]
|
235
|
+
# Required. The project of processor type to list.
|
236
|
+
# Format: projects/\\{project}/locations/\\{location}
|
237
|
+
class FetchProcessorTypesRequest
|
238
|
+
include ::Google::Protobuf::MessageExts
|
239
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
240
|
+
end
|
241
|
+
|
242
|
+
# Response message for fetch processor types.
|
243
|
+
# @!attribute [rw] processor_types
|
244
|
+
# @return [::Array<::Google::Cloud::DocumentAI::V1beta3::ProcessorType>]
|
245
|
+
# The list of processor types.
|
246
|
+
class FetchProcessorTypesResponse
|
247
|
+
include ::Google::Protobuf::MessageExts
|
248
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
249
|
+
end
|
250
|
+
|
251
|
+
# Request message for list all processors belongs to a project.
|
252
|
+
# @!attribute [rw] parent
|
253
|
+
# @return [::String]
|
254
|
+
# Required. The parent (project and location) which owns this collection of Processors.
|
255
|
+
# Format: projects/\\{project}/locations/\\{location}
|
256
|
+
# @!attribute [rw] page_size
|
257
|
+
# @return [::Integer]
|
258
|
+
# The maximum number of processors to return.
|
259
|
+
# If unspecified, at most 50 processors will be returned.
|
260
|
+
# The maximum value is 100; values above 100 will be coerced to 100.
|
261
|
+
# @!attribute [rw] page_token
|
262
|
+
# @return [::String]
|
263
|
+
# We will return the processors sorted by creation time. The page token
|
264
|
+
# will point to the next processor.
|
265
|
+
class ListProcessorsRequest
|
266
|
+
include ::Google::Protobuf::MessageExts
|
267
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
268
|
+
end
|
269
|
+
|
270
|
+
# Response message for list processors.
|
271
|
+
# @!attribute [rw] processors
|
272
|
+
# @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Processor>]
|
273
|
+
# The list of processors.
|
274
|
+
# @!attribute [rw] next_page_token
|
275
|
+
# @return [::String]
|
276
|
+
# Points to the next processor, otherwise empty.
|
277
|
+
class ListProcessorsResponse
|
278
|
+
include ::Google::Protobuf::MessageExts
|
279
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
280
|
+
end
|
281
|
+
|
282
|
+
# Request message for create a processor. Notice this request is sent to
|
283
|
+
# a regionalized backend service, and if the processor type is not available
|
284
|
+
# on that region, the creation will fail.
|
285
|
+
# @!attribute [rw] parent
|
286
|
+
# @return [::String]
|
287
|
+
# Required. The parent (project and location) under which to create the processor.
|
288
|
+
# Format: projects/\\{project}/locations/\\{location}
|
289
|
+
# @!attribute [rw] processor
|
290
|
+
# @return [::Google::Cloud::DocumentAI::V1beta3::Processor]
|
291
|
+
# Required. The processor to be created, requires [processor_type] and [display_name]
|
292
|
+
# to be set. Also, the processor is under CMEK if CMEK fields are set.
|
293
|
+
class CreateProcessorRequest
|
294
|
+
include ::Google::Protobuf::MessageExts
|
295
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
296
|
+
end
|
297
|
+
|
298
|
+
# Request message for the delete processor method.
|
299
|
+
# @!attribute [rw] name
|
300
|
+
# @return [::String]
|
301
|
+
# Required. The processor resource name to be deleted.
|
302
|
+
class DeleteProcessorRequest
|
303
|
+
include ::Google::Protobuf::MessageExts
|
304
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
305
|
+
end
|
306
|
+
|
307
|
+
# The long running operation metadata for delete processor method.
|
308
|
+
# @!attribute [rw] common_metadata
|
309
|
+
# @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata]
|
310
|
+
# The basic metadata of the long running operation.
|
311
|
+
class DeleteProcessorMetadata
|
312
|
+
include ::Google::Protobuf::MessageExts
|
313
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
314
|
+
end
|
315
|
+
|
316
|
+
# Request message for the enable processor method.
|
317
|
+
# @!attribute [rw] name
|
318
|
+
# @return [::String]
|
319
|
+
# Required. The processor resource name to be enabled.
|
320
|
+
class EnableProcessorRequest
|
321
|
+
include ::Google::Protobuf::MessageExts
|
322
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
323
|
+
end
|
324
|
+
|
325
|
+
# Response message for the enable processor method.
|
326
|
+
class EnableProcessorResponse
|
327
|
+
include ::Google::Protobuf::MessageExts
|
328
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
329
|
+
end
|
330
|
+
|
331
|
+
# The long running operation metadata for enable processor method.
|
332
|
+
# @!attribute [rw] common_metadata
|
333
|
+
# @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata]
|
334
|
+
# The basic metadata of the long running operation.
|
335
|
+
class EnableProcessorMetadata
|
336
|
+
include ::Google::Protobuf::MessageExts
|
337
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
338
|
+
end
|
339
|
+
|
340
|
+
# Request message for the disable processor method.
|
341
|
+
# @!attribute [rw] name
|
342
|
+
# @return [::String]
|
343
|
+
# Required. The processor resource name to be disabled.
|
344
|
+
class DisableProcessorRequest
|
345
|
+
include ::Google::Protobuf::MessageExts
|
346
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
347
|
+
end
|
348
|
+
|
349
|
+
# Response message for the disable processor method.
|
350
|
+
class DisableProcessorResponse
|
351
|
+
include ::Google::Protobuf::MessageExts
|
352
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
353
|
+
end
|
354
|
+
|
355
|
+
# The long running operation metadata for disable processor method.
|
356
|
+
# @!attribute [rw] common_metadata
|
357
|
+
# @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata]
|
358
|
+
# The basic metadata of the long running operation.
|
359
|
+
class DisableProcessorMetadata
|
360
|
+
include ::Google::Protobuf::MessageExts
|
361
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
362
|
+
end
|
363
|
+
|
232
364
|
# Request message for review document method.
|
365
|
+
# Next Id: 6.
|
233
366
|
# @!attribute [rw] inline_document
|
234
367
|
# @return [::Google::Cloud::DocumentAI::V1beta3::Document]
|
235
368
|
# An inline document proto.
|
@@ -240,9 +373,25 @@ module Google
|
|
240
373
|
# @!attribute [rw] document
|
241
374
|
# @return [::Google::Cloud::DocumentAI::V1beta3::Document]
|
242
375
|
# The document that needs human review.
|
376
|
+
# @!attribute [rw] enable_schema_validation
|
377
|
+
# @return [::Boolean]
|
378
|
+
# Whether the validation should be performed on the ad-hoc review request.
|
379
|
+
# @!attribute [rw] priority
|
380
|
+
# @return [::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest::Priority]
|
381
|
+
# The priority of the human review task.
|
243
382
|
class ReviewDocumentRequest
|
244
383
|
include ::Google::Protobuf::MessageExts
|
245
384
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
385
|
+
|
386
|
+
# The priority level of the human review task.
|
387
|
+
module Priority
|
388
|
+
# The default priority level.
|
389
|
+
DEFAULT = 0
|
390
|
+
|
391
|
+
# The urgent priority level. The labeling manager should allocate labeler
|
392
|
+
# resource to the urgent task queue to respect this priority level.
|
393
|
+
URGENT = 1
|
394
|
+
end
|
246
395
|
end
|
247
396
|
|
248
397
|
# Response message for review document method.
|
@@ -296,45 +445,6 @@ module Google
|
|
296
445
|
CANCELLED = 5
|
297
446
|
end
|
298
447
|
end
|
299
|
-
|
300
|
-
# The common metadata for long running operations.
|
301
|
-
# @!attribute [rw] state
|
302
|
-
# @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata::State]
|
303
|
-
# The state of the operation.
|
304
|
-
# @!attribute [rw] state_message
|
305
|
-
# @return [::String]
|
306
|
-
# A message providing more details about the current state of processing.
|
307
|
-
# @!attribute [rw] create_time
|
308
|
-
# @return [::Google::Protobuf::Timestamp]
|
309
|
-
# The creation time of the operation.
|
310
|
-
# @!attribute [rw] update_time
|
311
|
-
# @return [::Google::Protobuf::Timestamp]
|
312
|
-
# The last update time of the operation.
|
313
|
-
class CommonOperationMetadata
|
314
|
-
include ::Google::Protobuf::MessageExts
|
315
|
-
extend ::Google::Protobuf::MessageExts::ClassMethods
|
316
|
-
|
317
|
-
# State of the longrunning operation.
|
318
|
-
module State
|
319
|
-
# Unspecified state.
|
320
|
-
STATE_UNSPECIFIED = 0
|
321
|
-
|
322
|
-
# Operation is still running.
|
323
|
-
RUNNING = 1
|
324
|
-
|
325
|
-
# Operation is being cancelled.
|
326
|
-
CANCELLING = 2
|
327
|
-
|
328
|
-
# Operation succeeded.
|
329
|
-
SUCCEEDED = 3
|
330
|
-
|
331
|
-
# Operation failed.
|
332
|
-
FAILED = 4
|
333
|
-
|
334
|
-
# Operation is cancelled.
|
335
|
-
CANCELLED = 5
|
336
|
-
end
|
337
|
-
end
|
338
448
|
end
|
339
449
|
end
|
340
450
|
end
|
@@ -28,7 +28,7 @@ module Google
|
|
28
28
|
# X coordinate.
|
29
29
|
# @!attribute [rw] y
|
30
30
|
# @return [::Integer]
|
31
|
-
# Y coordinate.
|
31
|
+
# Y coordinate (starts from the top of the image).
|
32
32
|
class Vertex
|
33
33
|
include ::Google::Protobuf::MessageExts
|
34
34
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -42,7 +42,7 @@ module Google
|
|
42
42
|
# X coordinate.
|
43
43
|
# @!attribute [rw] y
|
44
44
|
# @return [::Float]
|
45
|
-
# Y coordinate.
|
45
|
+
# Y coordinate (starts from the top of the image).
|
46
46
|
class NormalizedVertex
|
47
47
|
include ::Google::Protobuf::MessageExts
|
48
48
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Cloud
|
22
|
+
module DocumentAI
|
23
|
+
module V1beta3
|
24
|
+
# The common metadata for long running operations.
|
25
|
+
# @!attribute [rw] state
|
26
|
+
# @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata::State]
|
27
|
+
# The state of the operation.
|
28
|
+
# @!attribute [rw] state_message
|
29
|
+
# @return [::String]
|
30
|
+
# A message providing more details about the current state of processing.
|
31
|
+
# @!attribute [rw] create_time
|
32
|
+
# @return [::Google::Protobuf::Timestamp]
|
33
|
+
# The creation time of the operation.
|
34
|
+
# @!attribute [rw] update_time
|
35
|
+
# @return [::Google::Protobuf::Timestamp]
|
36
|
+
# The last update time of the operation.
|
37
|
+
class CommonOperationMetadata
|
38
|
+
include ::Google::Protobuf::MessageExts
|
39
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
40
|
+
|
41
|
+
# State of the longrunning operation.
|
42
|
+
module State
|
43
|
+
# Unspecified state.
|
44
|
+
STATE_UNSPECIFIED = 0
|
45
|
+
|
46
|
+
# Operation is still running.
|
47
|
+
RUNNING = 1
|
48
|
+
|
49
|
+
# Operation is being cancelled.
|
50
|
+
CANCELLING = 2
|
51
|
+
|
52
|
+
# Operation succeeded.
|
53
|
+
SUCCEEDED = 3
|
54
|
+
|
55
|
+
# Operation failed.
|
56
|
+
FAILED = 4
|
57
|
+
|
58
|
+
# Operation is cancelled.
|
59
|
+
CANCELLED = 5
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Cloud
|
22
|
+
module DocumentAI
|
23
|
+
module V1beta3
|
24
|
+
# The first-class citizen for DocumentAI. Each processor defines how to extract
|
25
|
+
# structural information from a document.
|
26
|
+
# @!attribute [r] name
|
27
|
+
# @return [::String]
|
28
|
+
# Output only. Immutable. The resource name of the processor.
|
29
|
+
# Format: projects/\\{project}/locations/\\{location}/processors/\\{processor}
|
30
|
+
# @!attribute [rw] type
|
31
|
+
# @return [::String]
|
32
|
+
# The processor type.
|
33
|
+
# @!attribute [rw] display_name
|
34
|
+
# @return [::String]
|
35
|
+
# The display name of the processor.
|
36
|
+
# @!attribute [r] state
|
37
|
+
# @return [::Google::Cloud::DocumentAI::V1beta3::Processor::State]
|
38
|
+
# Output only. The state of the processor.
|
39
|
+
# @!attribute [rw] default_processor_version
|
40
|
+
# @return [::String]
|
41
|
+
# The default processor version.
|
42
|
+
# @!attribute [r] process_endpoint
|
43
|
+
# @return [::String]
|
44
|
+
# Output only. Immutable. The http endpoint that can be called to invoke processing.
|
45
|
+
# @!attribute [rw] create_time
|
46
|
+
# @return [::Google::Protobuf::Timestamp]
|
47
|
+
# The time the processor was created.
|
48
|
+
# @!attribute [rw] kms_key_name
|
49
|
+
# @return [::String]
|
50
|
+
# The KMS key used for encryption/decryption in CMEK scenarios.
|
51
|
+
# See https://cloud.google.com/security-key-management.
|
52
|
+
class Processor
|
53
|
+
include ::Google::Protobuf::MessageExts
|
54
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
55
|
+
|
56
|
+
# The possible states of the processor.
|
57
|
+
module State
|
58
|
+
# The processor is in an unspecified state.
|
59
|
+
STATE_UNSPECIFIED = 0
|
60
|
+
|
61
|
+
# The processor is enabled.
|
62
|
+
ENABLED = 1
|
63
|
+
|
64
|
+
# The processor is disabled.
|
65
|
+
DISABLED = 2
|
66
|
+
|
67
|
+
# The processor is being enabled, will become ENABLED if successful.
|
68
|
+
ENABLING = 3
|
69
|
+
|
70
|
+
# The processor is being disabled, will become DISABLED if successful.
|
71
|
+
DISABLING = 4
|
72
|
+
|
73
|
+
# The processor is being created.
|
74
|
+
CREATING = 5
|
75
|
+
|
76
|
+
# The processor failed during creation.
|
77
|
+
FAILED = 6
|
78
|
+
|
79
|
+
# The processor is being deleted, will be removed if successful.
|
80
|
+
DELETING = 7
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Cloud
|
22
|
+
module DocumentAI
|
23
|
+
module V1beta3
|
24
|
+
# A processor type is responsible for performing a certain document
|
25
|
+
# understanding task on a certain type of document.
|
26
|
+
# @!attribute [rw] name
|
27
|
+
# @return [::String]
|
28
|
+
# The resource name of the processor type.
|
29
|
+
# @!attribute [rw] type
|
30
|
+
# @return [::String]
|
31
|
+
# The type of the processor.
|
32
|
+
# @!attribute [rw] category
|
33
|
+
# @return [::String]
|
34
|
+
# The processor category.
|
35
|
+
# @!attribute [rw] available_locations
|
36
|
+
# @return [::Array<::Google::Cloud::DocumentAI::V1beta3::ProcessorType::LocationInfo>]
|
37
|
+
# The locations in which this processor is available.
|
38
|
+
# @!attribute [rw] allow_creation
|
39
|
+
# @return [::Boolean]
|
40
|
+
# Whether the processor type allows creation. If yes, user can create a
|
41
|
+
# processor of this processor type. Otherwise, user needs to require for
|
42
|
+
# whitelisting.
|
43
|
+
class ProcessorType
|
44
|
+
include ::Google::Protobuf::MessageExts
|
45
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
46
|
+
|
47
|
+
# The location information about where the processor is available.
|
48
|
+
# @!attribute [rw] location_id
|
49
|
+
# @return [::String]
|
50
|
+
# The location id.
|
51
|
+
class LocationInfo
|
52
|
+
include ::Google::Protobuf::MessageExts
|
53
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -21,17 +21,22 @@ module Google
|
|
21
21
|
module Type
|
22
22
|
# Represents a color in the RGBA color space. This representation is designed
|
23
23
|
# for simplicity of conversion to/from color representations in various
|
24
|
-
# languages over compactness
|
25
|
-
# can be trivially provided to the constructor of
|
26
|
-
# can also be trivially provided to UIColor's
|
24
|
+
# languages over compactness. For example, the fields of this representation
|
25
|
+
# can be trivially provided to the constructor of `java.awt.Color` in Java; it
|
26
|
+
# can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha`
|
27
27
|
# method in iOS; and, with just a little work, it can be easily formatted into
|
28
|
-
# a CSS
|
28
|
+
# a CSS `rgba()` string in JavaScript.
|
29
29
|
#
|
30
|
-
#
|
30
|
+
# This reference page doesn't carry information about the absolute color
|
31
|
+
# space
|
31
32
|
# that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
|
32
|
-
# DCI-P3, BT.2020, etc.). By default, applications
|
33
|
+
# DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color
|
33
34
|
# space.
|
34
35
|
#
|
36
|
+
# When color equality needs to be decided, implementations, unless
|
37
|
+
# documented otherwise, treat two colors as equal if all their red,
|
38
|
+
# green, blue, and alpha values each differ by at most 1e-5.
|
39
|
+
#
|
35
40
|
# Example (Java):
|
36
41
|
#
|
37
42
|
# import com.google.type.Color;
|
@@ -117,7 +122,7 @@ module Google
|
|
117
122
|
# var blue = Math.floor(blueFrac * 255);
|
118
123
|
#
|
119
124
|
# if (!('alpha' in rgb_color)) {
|
120
|
-
# return
|
125
|
+
# return rgbToCssColor(red, green, blue);
|
121
126
|
# }
|
122
127
|
#
|
123
128
|
# var alphaFrac = rgb_color.alpha.value || 0.0;
|
@@ -125,7 +130,7 @@ module Google
|
|
125
130
|
# return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
|
126
131
|
# };
|
127
132
|
#
|
128
|
-
# var
|
133
|
+
# var rgbToCssColor = function(red, green, blue) {
|
129
134
|
# var rgbNumber = new Number((red << 16) | (green << 8) | blue);
|
130
135
|
# var hexString = rgbNumber.toString(16);
|
131
136
|
# var missingZeros = 6 - hexString.length;
|
@@ -152,14 +157,14 @@ module Google
|
|
152
157
|
# The fraction of this color that should be applied to the pixel. That is,
|
153
158
|
# the final pixel color is defined by the equation:
|
154
159
|
#
|
155
|
-
# pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
|
160
|
+
# `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)`
|
156
161
|
#
|
157
162
|
# This means that a value of 1.0 corresponds to a solid color, whereas
|
158
163
|
# a value of 0.0 corresponds to a completely transparent color. This
|
159
164
|
# uses a wrapper message rather than a simple float scalar so that it is
|
160
165
|
# possible to distinguish between a default value and the value being unset.
|
161
|
-
# If omitted, this color object is
|
162
|
-
# (as if the alpha value had been explicitly given
|
166
|
+
# If omitted, this color object is rendered as a solid color
|
167
|
+
# (as if the alpha value had been explicitly given a value of 1.0).
|
163
168
|
class Color
|
164
169
|
include ::Google::Protobuf::MessageExts
|
165
170
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|