246
261
def has_height(self): return self.has_height_
263
def crop_to_fit(self): return self.crop_to_fit_
265
def set_crop_to_fit(self, x):
266
self.has_crop_to_fit_ = 1
267
self.crop_to_fit_ = x
269
def clear_crop_to_fit(self):
270
if self.has_crop_to_fit_:
271
self.has_crop_to_fit_ = 0
272
self.crop_to_fit_ = 0
274
def has_crop_to_fit(self): return self.has_crop_to_fit_
276
def crop_offset_x(self): return self.crop_offset_x_
278
def set_crop_offset_x(self, x):
279
self.has_crop_offset_x_ = 1
280
self.crop_offset_x_ = x
282
def clear_crop_offset_x(self):
283
if self.has_crop_offset_x_:
284
self.has_crop_offset_x_ = 0
285
self.crop_offset_x_ = 0.5
287
def has_crop_offset_x(self): return self.has_crop_offset_x_
289
def crop_offset_y(self): return self.crop_offset_y_
291
def set_crop_offset_y(self, x):
292
self.has_crop_offset_y_ = 1
293
self.crop_offset_y_ = x
295
def clear_crop_offset_y(self):
296
if self.has_crop_offset_y_:
297
self.has_crop_offset_y_ = 0
298
self.crop_offset_y_ = 0.5
300
def has_crop_offset_y(self): return self.has_crop_offset_y_
248
302
def rotate(self): return self.rotate_
250
304
def set_rotate(self, x):
589
697
8: ProtocolBuffer.Encoder.FLOAT,
590
698
9: ProtocolBuffer.Encoder.FLOAT,
591
699
10: ProtocolBuffer.Encoder.NUMERIC,
592
}, 10, ProtocolBuffer.Encoder.MAX_TYPE)
700
11: ProtocolBuffer.Encoder.NUMERIC,
701
12: ProtocolBuffer.Encoder.FLOAT,
702
13: ProtocolBuffer.Encoder.FLOAT,
703
}, 13, ProtocolBuffer.Encoder.MAX_TYPE)
596
707
_STYLE_CONTENT_TYPE = """"""
708
_PROTO_DESCRIPTOR_NAME = 'apphosting.Transform'
597
709
class ImageData(ProtocolBuffer.ProtocolMessage):
729
841
_STYLE_CONTENT_TYPE = """"""
842
_PROTO_DESCRIPTOR_NAME = 'apphosting.ImageData'
843
class InputSettings(ProtocolBuffer.ProtocolMessage):
846
UNCHANGED_ORIENTATION = 0
847
CORRECT_ORIENTATION = 1
849
_ORIENTATION_CORRECTION_TYPE_NAMES = {
850
0: "UNCHANGED_ORIENTATION",
851
1: "CORRECT_ORIENTATION",
854
def ORIENTATION_CORRECTION_TYPE_Name(cls, x): return cls._ORIENTATION_CORRECTION_TYPE_NAMES.get(x, "")
855
ORIENTATION_CORRECTION_TYPE_Name = classmethod(ORIENTATION_CORRECTION_TYPE_Name)
857
has_correct_exif_orientation_ = 0
858
correct_exif_orientation_ = 0
859
has_parse_metadata_ = 0
862
def __init__(self, contents=None):
863
if contents is not None: self.MergeFromString(contents)
865
def correct_exif_orientation(self): return self.correct_exif_orientation_
867
def set_correct_exif_orientation(self, x):
868
self.has_correct_exif_orientation_ = 1
869
self.correct_exif_orientation_ = x
871
def clear_correct_exif_orientation(self):
872
if self.has_correct_exif_orientation_:
873
self.has_correct_exif_orientation_ = 0
874
self.correct_exif_orientation_ = 0
876
def has_correct_exif_orientation(self): return self.has_correct_exif_orientation_
878
def parse_metadata(self): return self.parse_metadata_
880
def set_parse_metadata(self, x):
881
self.has_parse_metadata_ = 1
882
self.parse_metadata_ = x
884
def clear_parse_metadata(self):
885
if self.has_parse_metadata_:
886
self.has_parse_metadata_ = 0
887
self.parse_metadata_ = 0
889
def has_parse_metadata(self): return self.has_parse_metadata_
892
def MergeFrom(self, x):
894
if (x.has_correct_exif_orientation()): self.set_correct_exif_orientation(x.correct_exif_orientation())
895
if (x.has_parse_metadata()): self.set_parse_metadata(x.parse_metadata())
898
if x is self: return 1
899
if self.has_correct_exif_orientation_ != x.has_correct_exif_orientation_: return 0
900
if self.has_correct_exif_orientation_ and self.correct_exif_orientation_ != x.correct_exif_orientation_: return 0
901
if self.has_parse_metadata_ != x.has_parse_metadata_: return 0
902
if self.has_parse_metadata_ and self.parse_metadata_ != x.parse_metadata_: return 0
905
def IsInitialized(self, debug_strs=None):
911
if (self.has_correct_exif_orientation_): n += 1 + self.lengthVarInt64(self.correct_exif_orientation_)
912
if (self.has_parse_metadata_): n += 2
915
def ByteSizePartial(self):
917
if (self.has_correct_exif_orientation_): n += 1 + self.lengthVarInt64(self.correct_exif_orientation_)
918
if (self.has_parse_metadata_): n += 2
922
self.clear_correct_exif_orientation()
923
self.clear_parse_metadata()
925
def OutputUnchecked(self, out):
926
if (self.has_correct_exif_orientation_):
928
out.putVarInt32(self.correct_exif_orientation_)
929
if (self.has_parse_metadata_):
931
out.putBoolean(self.parse_metadata_)
933
def OutputPartial(self, out):
934
if (self.has_correct_exif_orientation_):
936
out.putVarInt32(self.correct_exif_orientation_)
937
if (self.has_parse_metadata_):
939
out.putBoolean(self.parse_metadata_)
941
def TryMerge(self, d):
945
self.set_correct_exif_orientation(d.getVarInt32())
948
self.set_parse_metadata(d.getBoolean())
952
if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
956
def __str__(self, prefix="", printElemNumber=0):
958
if self.has_correct_exif_orientation_: res+=prefix+("correct_exif_orientation: %s\n" % self.DebugFormatInt32(self.correct_exif_orientation_))
959
if self.has_parse_metadata_: res+=prefix+("parse_metadata: %s\n" % self.DebugFormatBool(self.parse_metadata_))
963
def _BuildTagLookupTable(sparse, maxtag, default=None):
964
return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
966
kcorrect_exif_orientation = 1
969
_TEXT = _BuildTagLookupTable({
971
1: "correct_exif_orientation",
975
_TYPES = _BuildTagLookupTable({
976
0: ProtocolBuffer.Encoder.NUMERIC,
977
1: ProtocolBuffer.Encoder.NUMERIC,
978
2: ProtocolBuffer.Encoder.NUMERIC,
979
}, 2, ProtocolBuffer.Encoder.MAX_TYPE)
983
_STYLE_CONTENT_TYPE = """"""
984
_PROTO_DESCRIPTOR_NAME = 'apphosting.InputSettings'
730
985
class OutputSettings(ProtocolBuffer.ProtocolMessage):
736
992
_MIME_TYPE_NAMES = {
741
998
def MIME_TYPE_Name(cls, x): return cls._MIME_TYPE_NAMES.get(x, "")
1053
1359
_TEXT = _BuildTagLookupTable({
1054
1360
0: "ErrorCode",
1056
1362
2: "transform",
1060
1367
_TYPES = _BuildTagLookupTable({
1061
1368
0: ProtocolBuffer.Encoder.NUMERIC,
1062
1369
1: ProtocolBuffer.Encoder.STRING,
1063
1370
2: ProtocolBuffer.Encoder.STRING,
1064
1371
3: ProtocolBuffer.Encoder.STRING,
1065
}, 3, ProtocolBuffer.Encoder.MAX_TYPE)
1372
4: ProtocolBuffer.Encoder.STRING,
1373
}, 4, ProtocolBuffer.Encoder.MAX_TYPE)
1068
1376
_STYLE = """"""
1069
1377
_STYLE_CONTENT_TYPE = """"""
1378
_PROTO_DESCRIPTOR_NAME = 'apphosting.ImagesTransformRequest'
1070
1379
class ImagesTransformResponse(ProtocolBuffer.ProtocolMessage):
1381
has_source_metadata_ = 0
1382
source_metadata_ = ""
1073
1384
def __init__(self, contents=None):
1074
1385
self.image_ = ImageData()
1083
1394
def has_image(self): return self.has_image_
1396
def source_metadata(self): return self.source_metadata_
1398
def set_source_metadata(self, x):
1399
self.has_source_metadata_ = 1
1400
self.source_metadata_ = x
1402
def clear_source_metadata(self):
1403
if self.has_source_metadata_:
1404
self.has_source_metadata_ = 0
1405
self.source_metadata_ = ""
1407
def has_source_metadata(self): return self.has_source_metadata_
1086
1410
def MergeFrom(self, x):
1087
1411
assert x is not self
1088
1412
if (x.has_image()): self.mutable_image().MergeFrom(x.image())
1413
if (x.has_source_metadata()): self.set_source_metadata(x.source_metadata())
1090
1415
def Equals(self, x):
1091
1416
if x is self: return 1
1092
1417
if self.has_image_ != x.has_image_: return 0
1093
1418
if self.has_image_ and self.image_ != x.image_: return 0
1419
if self.has_source_metadata_ != x.has_source_metadata_: return 0
1420
if self.has_source_metadata_ and self.source_metadata_ != x.source_metadata_: return 0
1096
1423
def IsInitialized(self, debug_strs=None):
1112
1440
if (self.has_image_):
1114
1442
n += self.lengthString(self.image_.ByteSizePartial())
1443
if (self.has_source_metadata_): n += 1 + self.lengthString(len(self.source_metadata_))
1117
1446
def Clear(self):
1118
1447
self.clear_image()
1448
self.clear_source_metadata()
1120
1450
def OutputUnchecked(self, out):
1121
1451
out.putVarInt32(10)
1122
1452
out.putVarInt32(self.image_.ByteSize())
1123
1453
self.image_.OutputUnchecked(out)
1454
if (self.has_source_metadata_):
1456
out.putPrefixedString(self.source_metadata_)
1125
1458
def OutputPartial(self, out):
1126
1459
if (self.has_image_):
1127
1460
out.putVarInt32(10)
1128
1461
out.putVarInt32(self.image_.ByteSizePartial())
1129
1462
self.image_.OutputPartial(out)
1463
if (self.has_source_metadata_):
1465
out.putPrefixedString(self.source_metadata_)
1131
1467
def TryMerge(self, d):
1132
1468
while d.avail() > 0:
1156
1496
return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
1499
ksource_metadata = 2
1160
1501
_TEXT = _BuildTagLookupTable({
1161
1502
0: "ErrorCode",
1504
2: "source_metadata",
1165
1507
_TYPES = _BuildTagLookupTable({
1166
1508
0: ProtocolBuffer.Encoder.NUMERIC,
1167
1509
1: ProtocolBuffer.Encoder.STRING,
1168
}, 1, ProtocolBuffer.Encoder.MAX_TYPE)
1510
2: ProtocolBuffer.Encoder.STRING,
1511
}, 2, ProtocolBuffer.Encoder.MAX_TYPE)
1171
1514
_STYLE = """"""
1172
1515
_STYLE_CONTENT_TYPE = """"""
1516
_PROTO_DESCRIPTOR_NAME = 'apphosting.ImagesTransformResponse'
1173
1517
class CompositeImageOptions(ProtocolBuffer.ProtocolMessage):
2571
2923
_STYLE = """"""
2572
2924
_STYLE_CONTENT_TYPE = """"""
2925
_PROTO_DESCRIPTOR_NAME = 'apphosting.ImagesGetUrlBaseResponse'
2926
if _extension_runtime:
2574
__all__ = ['ImagesServiceError','ImagesServiceTransform','Transform','ImageData','OutputSettings','ImagesTransformRequest','ImagesTransformResponse','CompositeImageOptions','ImagesCanvas','ImagesCompositeRequest','ImagesCompositeResponse','ImagesHistogramRequest','ImagesHistogram','ImagesHistogramResponse','ImagesGetUrlBaseRequest','ImagesGetUrlBaseResponse']
2929
__all__ = ['ImagesServiceError','ImagesServiceTransform','Transform','ImageData','InputSettings','OutputSettings','ImagesTransformRequest','ImagesTransformResponse','CompositeImageOptions','ImagesCanvas','ImagesCompositeRequest','ImagesCompositeResponse','ImagesHistogramRequest','ImagesHistogram','ImagesHistogramResponse','ImagesGetUrlBaseRequest','ImagesGetUrlBaseResponse']