จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เทนเซอร์โฟลว์:: ปฏิบัติการ:: เข้ารหัส JPEG:: คุณสมบัติ
#include <image_ops.h>
ตัวตั้งค่าแอตทริบิวต์เพิ่มเติมสำหรับ EncodeJpeg
สรุป
งานสาธารณะ |
---|
ChromaDownsampling (bool x) | |
DensityUnit (StringPiece x) | หน่วยที่ใช้ในการระบุ x_density และ y_density : พิกเซลต่อนิ้ว ( 'in' ) หรือเซนติเมตร ( 'cm' ) |
Format (StringPiece x) | รูปแบบภาพต่อพิกเซล |
OptimizeSize (bool x) | หากเป็น True ให้ใช้ CPU/RAM เพื่อลดขนาดโดยไม่มีการเปลี่ยนแปลงคุณภาพ |
Progressive (bool x) | หากเป็นจริง ให้สร้าง JPEG ที่โหลดอย่างต่อเนื่อง (หยาบถึงละเอียด) |
Quality (int64 x) | คุณภาพของการบีบอัดตั้งแต่ 0 ถึง 100 (ยิ่งสูงยิ่งดีและช้าลง) |
XDensity (int64 x) | พิกเซลแนวนอนต่อหน่วยความหนาแน่น |
XmpMetadata (StringPiece x) | หากไม่ว่างเปล่า ให้ฝังข้อมูลเมตา XMP นี้ในส่วนหัวของรูปภาพ |
YDensity (int64 x) | พิกเซลแนวตั้งต่อหน่วยความหนาแน่น |
คุณลักษณะสาธารณะ
chroma_downsampling_
bool tensorflow::ops::EncodeJpeg::Attrs::chroma_downsampling_ = true
ความหนาแน่น_หน่วย_
StringPiece tensorflow::ops::EncodeJpeg::Attrs::density_unit_ = "in"
StringPiece tensorflow::ops::EncodeJpeg::Attrs::format_ = ""
ปรับให้เหมาะสม_ขนาด_
bool tensorflow::ops::EncodeJpeg::Attrs::optimize_size_ = false
ก้าวหน้า_
bool tensorflow::ops::EncodeJpeg::Attrs::progressive_ = false
คุณภาพ_
int64 tensorflow::ops::EncodeJpeg::Attrs::quality_ = 95
x_ความหนาแน่น_
int64 tensorflow::ops::EncodeJpeg::Attrs::x_density_ = 300
StringPiece tensorflow::ops::EncodeJpeg::Attrs::xmp_metadata_ = ""
y_ความหนาแน่น_
int64 tensorflow::ops::EncodeJpeg::Attrs::y_density_ = 300
งานสาธารณะ
การสุ่มตัวอย่างโครมา
TF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::ChromaDownsampling(
bool x
)
หน่วยความหนาแน่น
TF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::DensityUnit(
StringPiece x
)
หน่วยที่ใช้ในการระบุ x_density
และ y_density
: พิกเซลต่อนิ้ว ( 'in'
) หรือเซนติเมตร ( 'cm'
)
ค่าเริ่มต้นเป็น "ใน"
TF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::Format(
StringPiece x
)
รูปแบบภาพต่อพิกเซล
ค่าเริ่มต้นเป็น ""
ปรับขนาดให้เหมาะสม
TF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::OptimizeSize(
bool x
)
หากเป็น True ให้ใช้ CPU/RAM เพื่อลดขนาดโดยไม่มีการเปลี่ยนแปลงคุณภาพ
ค่าเริ่มต้นเป็นเท็จ
ก้าวหน้า
TF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::Progressive(
bool x
)
หากเป็นจริง ให้สร้าง JPEG ที่โหลดอย่างต่อเนื่อง (หยาบถึงละเอียด)
ค่าเริ่มต้นเป็นเท็จ
คุณภาพ
TF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::Quality(
int64 x
)
คุณภาพของการบีบอัดตั้งแต่ 0 ถึง 100 (ยิ่งสูงยิ่งดีและช้าลง)
ค่าเริ่มต้นคือ 95
Xความหนาแน่น
TF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::XDensity(
int64 x
)
พิกเซลแนวนอนต่อหน่วยความหนาแน่น
ค่าเริ่มต้นคือ 300
TF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::XmpMetadata(
StringPiece x
)
หากไม่ว่างเปล่า ให้ฝังข้อมูลเมตา XMP นี้ในส่วนหัวของรูปภาพ
ค่าเริ่มต้นเป็น ""
Yความหนาแน่น
TF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::YDensity(
int64 x
)
พิกเซลแนวตั้งต่อหน่วยความหนาแน่น
ค่าเริ่มต้นคือ 300
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 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.0/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.0/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.0/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.0/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.0/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.0/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.0/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.0/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.0/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.0/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"]]