syntax = "proto3";

package biopb.image;

option java_package = "biopb.image";
option java_multiple_files = true;


import "google/protobuf/field_mask.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/struct.proto";

import "biopb/image/image_data.proto";
import "biopb/image/op_schema.proto";

message ProcessRequest {

    // Input image for processing
    ImageData image_data = 1;

    // Specify a operator name because the server may implement multiple operations.
    string op_name = 2;

    // A field_mask to indicate the requested fields in the reply. Default is to
    // return the full response. May be ignored by the server.
    google.protobuf.FieldMask field_mask = 3;

    // Optional kwargs for endpoint-specific parameters.
    // Arbitrary key-value pairs that can be passed to the server.
    google.protobuf.Struct kwargs = 4;

}

message ProcessResponse {

    // Output image after processing
    ImageData image_data = 1;

    // Additonal information the server may return as a text string
    string annotation = 2;
}


// A generic image process protocol that returns a new image. Examples include
// denoising, super-resolution, and semantic segmentation.
//
service ProcessImage {

    // Process the input image
    rpc Run(ProcessRequest) returns (ProcessResponse) ;

    // Streaming version 
    rpc RunStream(stream ProcessRequest) returns (stream ProcessResponse) ;

    // Query operation names. Server with a single op may not implement this
    // call.
    rpc GetOpNames(google.protobuf.Empty) returns (OpNames) ;

}

