# Cloud Vision V1 Client - Class Image (2.2.1)

2.2.1 (latest) 2.2.0 2.1.3 2.0.3 1.10.3 1.9.4 1.8.0 1.7.6 1.6.8 Reference documentation and code samples for the Cloud Vision V1 Client class Image.

Client image to perform Google Cloud Vision API tasks over.

Generated from protobuf message `google.cloud.vision.v1.Image`

## Namespace

Google \\ Cloud \\ Vision \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ content` | `string` Image content, represented as a stream of bytes. Note: As with all `bytes` fields, protobuffers use a pure binary representation, whereas JSON representations use base64. Currently, this field only works for BatchAnnotateImages requests. It does not work for AsyncBatchAnnotateImages requests. |
| `↳ source` | `https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.ImageSource` Google Cloud Storage image location, or publicly-accessible image URL. If both `content` and `source` are provided for an image, `content` takes precedence and is used to perform the image annotation request. |

### getContent

Image content, represented as a stream of bytes.

Note: As with all `bytes` fields, protobuffers use a pure binary
representation, whereas JSON representations use base64.
Currently, this field only works for BatchAnnotateImages requests. It does
not work for AsyncBatchAnnotateImages requests.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setContent

Image content, represented as a stream of bytes.

Note: As with all `bytes` fields, protobuffers use a pure binary
representation, whereas JSON representations use base64.
Currently, this field only works for BatchAnnotateImages requests. It does
not work for AsyncBatchAnnotateImages requests.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSource

Google Cloud Storage image location, or publicly-accessible image
URL. If both `content` and `source` are provided for an image, `content`
takes precedence and is used to perform the image annotation request.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.ImageSource|null` |   |

### hasSource

### clearSource

### setSource

Google Cloud Storage image location, or publicly-accessible image
URL. If both `content` and `source` are provided for an image, `content`
takes precedence and is used to perform the image annotation request.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.ImageSource` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |