Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
przepływ tensorowy:: ops:: Zakoduj JPEG:: Atrybuty
#include <image_ops.h>
Opcjonalne moduły ustawiające atrybuty dla EncodeJpeg .
Streszczenie
Funkcje publiczne |
---|
ChromaDownsampling (bool x) | |
DensityUnit (StringPiece x) | Jednostka używana do określenia x_density i y_density : piksele na cal ( 'in' ) lub centymetr ( 'cm' ). |
Format (StringPiece x) | Format obrazu według pikseli. |
OptimizeSize (bool x) | Jeśli ma wartość True, wydaj procesor/RAM, aby zmniejszyć rozmiar bez zmiany jakości. |
Progressive (bool x) | Jeśli ma wartość True, utwórz plik JPEG, który ładuje się stopniowo (od zgrubnego do dokładnego). |
Quality (int64 x) | Jakość kompresji od 0 do 100 (im wyższa, tym lepsza i wolniejsza). |
XDensity (int64 x) | Poziome piksele na jednostkę gęstości. |
XmpMetadata (StringPiece x) | Jeśli nie jest pusty, osadź te metadane XMP w nagłówku obrazu. |
YDensity (int64 x) | Pionowe piksele na jednostkę gęstości. |
Atrybuty publiczne
chroma_downsampling_
bool tensorflow::ops::EncodeJpeg::Attrs::chroma_downsampling_ = true
jednostka_gęstości_
StringPiece tensorflow::ops::EncodeJpeg::Attrs::density_unit_ = "in"
StringPiece tensorflow::ops::EncodeJpeg::Attrs::format_ = ""
optymalizacja_rozmiar_
bool tensorflow::ops::EncodeJpeg::Attrs::optimize_size_ = false
progresywny_
bool tensorflow::ops::EncodeJpeg::Attrs::progressive_ = false
jakość_
int64 tensorflow::ops::EncodeJpeg::Attrs::quality_ = 95
x_gęstość_
int64 tensorflow::ops::EncodeJpeg::Attrs::x_density_ = 300
StringPiece tensorflow::ops::EncodeJpeg::Attrs::xmp_metadata_ = ""
y_gęstość_
int64 tensorflow::ops::EncodeJpeg::Attrs::y_density_ = 300
Funkcje publiczne
Próbkowanie Chroma
TF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::ChromaDownsampling(
bool x
)
Jednostka gęstości
TF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::DensityUnit(
StringPiece x
)
Jednostka używana do określenia x_density
i y_density
: piksele na cal ( 'in'
) lub centymetr ( 'cm'
).
Domyślnie „w”
TF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::Format(
StringPiece x
)
Format obrazu według pikseli.
Domyślnie „”
Optymalizujrozmiar
TF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::OptimizeSize(
bool x
)
Jeśli ma wartość True, wydaj procesor/RAM, aby zmniejszyć rozmiar bez zmiany jakości.
Domyślnie jest to fałsz
Progresywny
TF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::Progressive(
bool x
)
Jeśli ma wartość True, utwórz plik JPEG, który ładuje się stopniowo (od zgrubnego do dokładnego).
Domyślnie jest to fałsz
Jakość
TF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::Quality(
int64 x
)
Jakość kompresji od 0 do 100 (im wyższa, tym lepsza i wolniejsza).
Domyślnie 95
XDęstość
TF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::XDensity(
int64 x
)
Poziome piksele na jednostkę gęstości.
Domyślnie jest to 300
TF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::XmpMetadata(
StringPiece x
)
Jeśli nie jest pusty, osadź te metadane XMP w nagłówku obrazu.
Domyślnie „”
YGęstość
TF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::YDensity(
int64 x
)
Pionowe piksele na jednostkę gęstości.
Domyślnie jest to 300
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-26 UTC.
[null,null,["Ostatnia aktualizacja: 2025-07-26 UTC."],[],[],null,["# tensorflow::ops::EncodeJpeg::Attrs Struct Reference\n\ntensorflow::ops::EncodeJpeg::Attrs\n==================================\n\n`#include \u003cimage_ops.h\u003e`\n\nOptional attribute setters for [EncodeJpeg](/versions/r2.3/api_docs/cc/class/tensorflow/ops/encode-jpeg#classtensorflow_1_1ops_1_1_encode_jpeg).\n\nSummary\n-------\n\n| ### Public attributes ||\n|------------------------------------------------------------------------------------------------------------------------|---------------|\n| [chroma_downsampling_](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1a3bb34c71aefd52e42a9b1aa4b432e6f7)` = true` | `bool` |\n| [density_unit_](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1ad473f931a23a1df4840975896b684184)` = \"in\"` | `StringPiece` |\n| [format_](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1a5ceef55471c0fad353271762846f6e78)` = \"\"` | `StringPiece` |\n| [optimize_size_](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1a65568fb0962da850389a89098f550966)` = false` | `bool` |\n| [progressive_](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1ac759c38a17868cbc2af1ae8778b29bd8)` = false` | `bool` |\n| [quality_](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1a4281376a8af08b15d19bc2764daf126a)` = 95` | `int64` |\n| [x_density_](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1ac2a312998c63610c614fa0394b41dc53)` = 300` | `int64` |\n| [xmp_metadata_](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1ac679a3e0a3e768adc7538f5b2aa4d319)` = \"\"` | `StringPiece` |\n| [y_density_](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1a3ef30dc71da3a445598d940e9609c192)` = 300` | `int64` |\n\n| ### Public functions ||\n|-----------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ChromaDownsampling](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1a13b9ec4a7bab1d72fd3c0b57b7056f2b)`(bool x)` | `TF_MUST_USE_RESULT `[Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/encode-jpeg/attrs#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs) See \u003chttp://en.wikipedia.org/wiki/Chroma_subsampling\u003e. |\n| [DensityUnit](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1a6290e4f8249e42e91deea2f7e0a2111e)`(StringPiece x)` | `TF_MUST_USE_RESULT `[Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/encode-jpeg/attrs#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs) Unit used to specify `x_density` and `y_density`: pixels per inch (`'in'`) or centimeter (`'cm'`). |\n| [Format](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1ae0b58eaebd511e6c6375c1e0f7821bd8)`(StringPiece x)` | `TF_MUST_USE_RESULT `[Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/encode-jpeg/attrs#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs) Per pixel image format. |\n| [OptimizeSize](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1a27a061d0e31415fd10027bc490ed2631)`(bool x)` | `TF_MUST_USE_RESULT `[Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/encode-jpeg/attrs#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs) If True, spend CPU/RAM to reduce size with no quality change. |\n| [Progressive](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1a4957bb2decc4e5e7e7cf9d20af36205e)`(bool x)` | `TF_MUST_USE_RESULT `[Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/encode-jpeg/attrs#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs) If True, create a JPEG that loads progressively (coarse to fine). |\n| [Quality](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1ac835e75cc50848e902fc1ba2b240a162)`(int64 x)` | `TF_MUST_USE_RESULT `[Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/encode-jpeg/attrs#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs) Quality of the compression from 0 to 100 (higher is better and slower). |\n| [XDensity](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1abd11bc13eae4b694f40ecd4d670eee8e)`(int64 x)` | `TF_MUST_USE_RESULT `[Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/encode-jpeg/attrs#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs) Horizontal pixels per density unit. |\n| [XmpMetadata](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1ae0b968290e4b22a90fda1612b09313c6)`(StringPiece x)` | `TF_MUST_USE_RESULT `[Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/encode-jpeg/attrs#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs) If not empty, embed this XMP metadata in the image header. |\n| [YDensity](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1aba76539bfbaf2e7361710f632a630555)`(int64 x)` | `TF_MUST_USE_RESULT `[Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/encode-jpeg/attrs#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs) Vertical pixels per density unit. |\n\nPublic attributes\n-----------------\n\n### chroma_downsampling_\n\n```scdoc\nbool tensorflow::ops::EncodeJpeg::Attrs::chroma_downsampling_ = true\n``` \n\n### density_unit_\n\n```scdoc\nStringPiece tensorflow::ops::EncodeJpeg::Attrs::density_unit_ = \"in\"\n``` \n\n### format_\n\n```scdoc\nStringPiece tensorflow::ops::EncodeJpeg::Attrs::format_ = \"\"\n``` \n\n### optimize_size_\n\n```scdoc\nbool tensorflow::ops::EncodeJpeg::Attrs::optimize_size_ = false\n``` \n\n### progressive_\n\n```scdoc\nbool tensorflow::ops::EncodeJpeg::Attrs::progressive_ = false\n``` \n\n### quality_\n\n```scdoc\nint64 tensorflow::ops::EncodeJpeg::Attrs::quality_ = 95\n``` \n\n### x_density_\n\n```scdoc\nint64 tensorflow::ops::EncodeJpeg::Attrs::x_density_ = 300\n``` \n\n### xmp_metadata_\n\n```scdoc\nStringPiece tensorflow::ops::EncodeJpeg::Attrs::xmp_metadata_ = \"\"\n``` \n\n### y_density_\n\n```scdoc\nint64 tensorflow::ops::EncodeJpeg::Attrs::y_density_ = 300\n``` \n\nPublic functions\n----------------\n\n### ChromaDownsampling\n\n```scdoc\nTF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::ChromaDownsampling(\n bool x\n)\n``` \nSee \u003chttp://en.wikipedia.org/wiki/Chroma_subsampling\u003e.\n\nDefaults to true \n\n### DensityUnit\n\n```scdoc\nTF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::DensityUnit(\n StringPiece x\n)\n``` \nUnit used to specify `x_density` and `y_density`: pixels per inch (`'in'`) or centimeter (`'cm'`).\n\nDefaults to \"in\" \n\n### Format\n\n```scdoc\nTF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::Format(\n StringPiece x\n)\n``` \nPer pixel image format.\n\nDefaults to \"\" \n\n### OptimizeSize\n\n```scdoc\nTF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::OptimizeSize(\n bool x\n)\n``` \nIf True, spend CPU/RAM to reduce size with no quality change.\n\nDefaults to false \n\n### Progressive\n\n```scdoc\nTF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::Progressive(\n bool x\n)\n``` \nIf True, create a JPEG that loads progressively (coarse to fine).\n\nDefaults to false \n\n### Quality\n\n```scdoc\nTF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::Quality(\n int64 x\n)\n``` \nQuality of the compression from 0 to 100 (higher is better and slower).\n\nDefaults to 95 \n\n### XDensity\n\n```scdoc\nTF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::XDensity(\n int64 x\n)\n``` \nHorizontal pixels per density unit.\n\nDefaults to 300 \n\n### XmpMetadata\n\n```scdoc\nTF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::XmpMetadata(\n StringPiece x\n)\n``` \nIf not empty, embed this XMP metadata in the image header.\n\nDefaults to \"\" \n\n### YDensity\n\n```scdoc\nTF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::YDensity(\n int64 x\n)\n``` \nVertical pixels per density unit.\n\nDefaults to 300"]]