Dela via


ImagePoint Class

  • java.lang.Object
    • com.azure.ai.vision.imageanalysis.models.ImagePoint

Implements

public final class ImagePoint
implements JsonSerializable<ImagePoint>

Represents the coordinates of a single pixel in the image.

Method Summary

Modifier and Type Method and Description
static ImagePoint fromJson(JsonReader jsonReader)

Reads an instance of ImagePoint from the JsonReader.

int getX()

Get the x property: The horizontal x-coordinate of this point, in pixels.

int getY()

Get the y property: The vertical y-coordinate of this point, in pixels.

JsonWriter toJson(JsonWriter jsonWriter)
String toString()

Returns a compact string containing the image point values in a style suitable for printing.

Methods inherited from java.lang.Object

Method Details

fromJson

public static ImagePoint fromJson(JsonReader jsonReader)

Reads an instance of ImagePoint from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of ImagePoint if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

getX

public int getX()

Get the x property: The horizontal x-coordinate of this point, in pixels. Zero values corresponds to the left-most pixels in the image.

Returns:

the x value.

getY

public int getY()

Get the y property: The vertical y-coordinate of this point, in pixels. Zero values corresponds to the top-most pixels in the image.

Returns:

the y value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

toString

public String toString()

Returns a compact string containing the image point values in a style suitable for printing.

Overrides:

ImagePoint.toString()

Returns:

A string containing the image point values.

Applies to