chromium/components/lens/lens_metadata.mojom

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module lens.mojom;

import "mojo/public/mojom/base/time.mojom";
import "ui/gfx/geometry/mojom/geometry.mojom";

enum ImageFormat {
  JPEG,
  PNG,
  WEBP,
  // ORIGINAL means request basic image formats, JPG/PNG/GIF, if the original
  // image format is not one of them, encode the image to JPG and return.
  ORIGINAL,
};

enum Phase {
    OVERALL_START,
    DOWNSCALE_START,
    DOWNSCALE_END,
    ENCODE_START,
    ENCODE_END,
};

struct LatencyLog {
    Phase phase;
    gfx.mojom.Size original_size;
    gfx.mojom.Size downscaled_size;
    ImageFormat image_format;
    mojo_base.mojom.Time time;
    uint32 encoded_bytes_size;
};