Lines Matching full:segment
39 const JpegSegment& segment) { in Process() argument
42 JpegMarker marker = segment.GetMarker(); in Process()
49 DataRange(segment.GetBegin(), segment.GetBegin() + JpegMarker::kLength); in Process()
53 segment.GetBegin() + JpegMarker::kLength); in Process()
70 if (image_count_ > 0 && IsJfifSegment(segment)) { in Process()
71 const auto& data_range = segment.GetDataRange(); in Process()
73 MaybeCaptureSegmentBytes(kJfif, segment, segment_info.GetMutableBytes()); in Process()
78 // segment in the primary (first) image of the file, but note their presence in Process()
80 if (image_count_ > 0 && IsMpfSegment(segment)) { in Process()
82 const auto& data_range = segment.GetDataRange(); in Process()
84 MaybeCaptureSegmentBytes(kMpf, segment, segment_info.GetMutableBytes()); in Process()
93 if (IsPrimaryXmpSegment(segment)) { in Process()
94 // The primary XMP segment in a non-primary image (i.e., not the first in Process()
96 if (image_count_ > 1 && HasId(segment, kXmpAppleDepthId)) { in Process()
98 } else if (image_count_ > 1 && HasId(segment, kXmpAppleMatteId)) { in Process()
100 } else if (image_count_ == 1 && (HasId(segment, kXmpGDepthV1Id) || in Process()
101 HasId(segment, kXmpGImageV1Id))) { in Process()
102 // The primary XMP segment in the primary image may contain GDepthV1 in Process()
104 SetPrimaryXmpGuid(segment); in Process()
105 SetXmpMimeType(segment, JpegXmpInfo::kGDepthInfoType); in Process()
106 SetXmpMimeType(segment, JpegXmpInfo::kGImageInfoType); in Process()
108 } else if (image_count_ == 1 && IsExtendedXmpSegment(segment)) { in Process()
109 // The extended XMP segment in the primary image may contain GDepth and/or in Process()
111 if (HasMatchingExtendedXmpGuid(segment)) { in Process()
112 gdepth_info_builder_.ProcessSegment(segment); in Process()
113 gimage_info_builder_.ProcessSegment(segment); in Process()
115 } else if (image_count_ > 0 && IsExifSegment(segment)) { in Process()
116 const auto& data_range = segment.GetDataRange(); in Process()
118 MaybeCaptureSegmentBytes(kExif, segment, segment_info.GetMutableBytes()); in Process()
157 bool JpegInfoBuilder::IsPrimaryXmpSegment(const JpegSegment& segment) const { in IsPrimaryXmpSegment()
158 size_t location = segment.GetPayloadDataLocation(); in IsPrimaryXmpSegment()
159 return segment.BytesAtLocationStartWith(location, kXmpId); in IsPrimaryXmpSegment()
162 bool JpegInfoBuilder::IsExtendedXmpSegment(const JpegSegment& segment) const { in IsExtendedXmpSegment()
163 size_t location = segment.GetPayloadDataLocation(); in IsExtendedXmpSegment()
164 return segment.BytesAtLocationStartWith(location, kXmpExtendedId); in IsExtendedXmpSegment()
167 bool JpegInfoBuilder::IsMpfSegment(const JpegSegment& segment) const { in IsMpfSegment()
168 size_t payload_data_location = segment.GetPayloadDataLocation(); in IsMpfSegment()
169 return segment.BytesAtLocationStartWith(payload_data_location, kMpf); in IsMpfSegment()
172 bool JpegInfoBuilder::IsExifSegment(const JpegSegment& segment) const { in IsExifSegment()
173 size_t payload_data_location = segment.GetPayloadDataLocation(); in IsExifSegment()
174 return segment.BytesAtLocationStartWith(payload_data_location, kExif); in IsExifSegment()
177 bool JpegInfoBuilder::IsJfifSegment(const JpegSegment& segment) const { in IsJfifSegment()
178 size_t payload_data_location = segment.GetPayloadDataLocation(); in IsJfifSegment()
179 return segment.BytesAtLocationStartWith(payload_data_location, kJfif); in IsJfifSegment()
183 const JpegSegment& segment, in MaybeCaptureSegmentBytes() argument
189 bytes->reserve(segment.GetLength()); in MaybeCaptureSegmentBytes()
190 size_t segment_begin = segment.GetBegin(); in MaybeCaptureSegmentBytes()
191 size_t segment_end = segment.GetEnd(); in MaybeCaptureSegmentBytes()
193 ValidatedByte validated_byte = segment.GetValidatedByte(location); in MaybeCaptureSegmentBytes()
203 const JpegSegment& segment) const { in HasMatchingExtendedXmpGuid()
207 if (segment.GetLength() <= kXmpExtendedHeaderSize) { in HasMatchingExtendedXmpGuid()
210 size_t start = segment.GetPayloadDataLocation() + sizeof(kXmpExtendedId); in HasMatchingExtendedXmpGuid()
211 return segment.BytesAtLocationStartWith(start, primary_xmp_guid_.c_str()); in HasMatchingExtendedXmpGuid()
214 bool JpegInfoBuilder::HasId(const JpegSegment& segment, const char* id) const { in HasId() argument
215 return segment.BytesAtLocationContain(segment.GetPayloadDataLocation(), id); in HasId()
218 void JpegInfoBuilder::SetPrimaryXmpGuid(const JpegSegment& segment) { in SetPrimaryXmpGuid() argument
219 primary_xmp_guid_ = segment.ExtractXmpPropertyValue( in SetPrimaryXmpGuid()
220 segment.GetPayloadDataLocation(), kXmpHasExtendedId); in SetPrimaryXmpGuid()
223 void JpegInfoBuilder::SetXmpMimeType(const JpegSegment& segment, in SetXmpMimeType() argument
226 jpeg_info_.SetMimeType(xmp_info_type, segment.ExtractXmpPropertyValue( in SetXmpMimeType()
227 segment.GetPayloadDataLocation(), in SetXmpMimeType()