294
static size_t GetBytesPerRow(size_t columns,
295
size_t samples_per_pixel,size_t bits_per_pixel,
294
static size_t GetBytesPerRow(unsigned long columns,
295
unsigned long samples_per_pixel,unsigned long bits_per_pixel,
296
296
MagickBooleanType pad)
582
582
Image origination information.
584
cin.origination.x_offset=(ssize_t) ReadBlobLong(image);
586
if ((size_t) cin.origination.x_offset != ~0UL)
587
(void) FormatImageProperty(image,"cin:origination.x_offset","%.20g",
588
(double) cin.origination.x_offset);
589
cin.origination.y_offset=(ssize_t) ReadBlobLong(image);
591
if ((size_t) cin.origination.y_offset != ~0UL)
592
(void) FormatImageProperty(image,"cin:origination.y_offset","%.20g",
593
(double) cin.origination.y_offset);
584
cin.origination.x_offset=(long) ReadBlobLong(image);
586
if ((unsigned long) cin.origination.x_offset != ~0UL)
587
(void) FormatImageProperty(image,"cin:origination.x_offset","%ld",
588
cin.origination.x_offset);
589
cin.origination.y_offset=(long) ReadBlobLong(image);
591
if ((unsigned long) cin.origination.y_offset != ~0UL)
592
(void) FormatImageProperty(image,"cin:origination.y_offset","%ld",
593
cin.origination.y_offset);
594
594
offset+=ReadBlob(image,sizeof(cin.origination.filename),(unsigned char *)
595
595
cin.origination.filename);
596
596
(void) SetImageProperty(image,"cin:origination.filename",
632
632
cin.film.id=ReadBlobByte(image);
634
if (((size_t) cin.film.id) != ~0UL)
634
if ((unsigned long) cin.film.id != ~0UL)
635
635
(void) FormatImageProperty(image,"cin:film.id","%d",cin.film.id);
636
636
cin.film.type=ReadBlobByte(image);
638
if (((size_t) cin.film.type) != ~0UL)
638
if ((unsigned long) cin.film.type != ~0UL)
639
639
(void) FormatImageProperty(image,"cin:film.type","%d",cin.film.type);
640
640
cin.film.offset=ReadBlobByte(image);
642
if (((size_t) cin.film.offset) != ~0UL)
642
if ((unsigned long) cin.film.offset != ~0UL)
643
643
(void) FormatImageProperty(image,"cin:film.offset","%d",
644
644
cin.film.offset);
645
645
cin.film.reserve1=ReadBlobByte(image);
647
647
cin.film.prefix=ReadBlobLong(image);
649
649
if (cin.film.prefix != ~0UL)
650
(void) FormatImageProperty(image,"cin:film.prefix","%.20g",(double)
650
(void) FormatImageProperty(image,"cin:film.prefix","%lu",
651
651
cin.film.prefix);
652
652
cin.film.count=ReadBlobLong(image);
657
657
cin.film.frame_position=ReadBlobLong(image);
659
659
if (cin.film.frame_position != ~0UL)
660
(void) FormatImageProperty(image,"cin:film.frame_position","%.20g",
661
(double) cin.film.frame_position);
660
(void) FormatImageProperty(image,"cin:film.frame_position","%lu",
661
cin.film.frame_position);
662
662
cin.film.frame_rate=ReadBlobFloat(image);
664
664
if (IsFloatDefined(cin.film.frame_rate) != MagickFalse)
687
687
(void) SetImageProfile(image,"cin:user.data",profile);
688
688
profile=DestroyStringInfo(profile);
690
for ( ; offset < (ssize_t) cin.file.image_offset; offset++)
690
for ( ; offset < (long) cin.file.image_offset; offset++)
691
691
(void) ReadBlobByte(image);
692
692
image->depth=cin.image.channel[0].bits_per_pixel;
693
693
image->columns=cin.image.channel[0].pixels_per_line;
714
714
quantum_type=GrayQuantum;
715
715
length=GetBytesPerRow(image->columns,1,image->depth,MagickTrue);
717
for (y=0; y < (ssize_t) image->rows; y++)
717
for (y=0; y < (long) image->rows; y++)
719
719
q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
720
720
if (q == (PixelPacket *) NULL)
729
729
if (image->previous == (Image *) NULL)
731
status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y,
731
status=SetImageProgress(image,LoadImageTag,y,image->rows);
733
732
if (status == MagickFalse)
764
763
% The format of the RegisterCINImage method is:
766
% size_t RegisterCINImage(void)
765
% unsigned long RegisterCINImage(void)
769
ModuleExport size_t RegisterCINImage(void)
768
ModuleExport unsigned long RegisterCINImage(void)
909
908
(void) ResetMagickMemory(&cin,0,sizeof(cin));
911
910
cin.file.magic=0x802A5FD7UL;
912
offset+=WriteBlobLong(image,(unsigned int) cin.file.magic);
911
offset+=WriteBlobLong(image,cin.file.magic);
913
912
cin.file.image_offset=0x800;
914
913
profile=GetImageProfile(image,"cin:user.data");
915
914
if (profile != (StringInfo *) NULL)
917
cin.file.image_offset+=(size_t) GetStringInfoLength(profile);
916
cin.file.image_offset+=(unsigned long) GetStringInfoLength(profile);
918
917
cin.file.image_offset=(((cin.file.image_offset+0x2000-1)/0x2000)*0x2000);
920
offset+=WriteBlobLong(image,(unsigned int) cin.file.image_offset);
919
offset+=WriteBlobLong(image,cin.file.image_offset);
921
920
cin.file.generic_length=0x400;
922
offset+=WriteBlobLong(image,(unsigned int) cin.file.generic_length);
921
offset+=WriteBlobLong(image,cin.file.generic_length);
923
922
cin.file.industry_length=0x400;
924
offset+=WriteBlobLong(image,(unsigned int) cin.file.industry_length);
923
offset+=WriteBlobLong(image,cin.file.industry_length);
925
924
cin.file.user_length=0x00;
926
925
if (profile != (StringInfo *) NULL)
928
cin.file.user_length+=(size_t) GetStringInfoLength(profile);
927
cin.file.user_length+=(unsigned long) GetStringInfoLength(profile);
929
928
cin.file.user_length=(((cin.file.user_length+0x2000-1)/0x2000)*0x2000);
931
offset+=WriteBlobLong(image,(unsigned int) cin.file.user_length);
930
offset+=WriteBlobLong(image,cin.file.user_length);
932
931
cin.file.file_size=4*image->columns*image->rows+0x2000;
933
offset+=WriteBlobLong(image,(unsigned int) cin.file.file_size);
932
offset+=WriteBlobLong(image,cin.file.file_size);
934
933
(void) CopyMagickString(cin.file.version,"V4.5",sizeof(cin.file.version));
935
934
offset+=WriteBlob(image,sizeof(cin.file.version),(unsigned char *)
936
935
cin.file.version);
974
973
offset+=WriteBlobByte(image,cin.image.channel[0].bits_per_pixel);
975
974
offset+=WriteBlobByte(image,cin.image.channel[0].reserve);
976
975
cin.image.channel[i].pixels_per_line=image->columns;
977
offset+=WriteBlobLong(image,(unsigned int)
978
cin.image.channel[0].pixels_per_line);
976
offset+=WriteBlobLong(image,cin.image.channel[0].pixels_per_line);
979
977
cin.image.channel[i].lines_per_image=image->rows;
980
offset+=WriteBlobLong(image,(unsigned int)
981
cin.image.channel[0].lines_per_image);
978
offset+=WriteBlobLong(image,cin.image.channel[0].lines_per_image);
982
979
cin.image.channel[i].min_data=0;
983
980
offset+=WriteBlobFloat(image,cin.image.channel[0].min_data);
984
981
cin.image.channel[i].min_quantity=0.0;
1010
1007
cin.data_format.interleave=0; /* pixel interleave (rgbrgbr...) */
1011
1008
offset+=WriteBlobByte(image,cin.data_format.interleave);
1012
cin.data_format.packing=5; /* packing ssize_tword (32bit) boundaries */
1009
cin.data_format.packing=5; /* packing longword (32bit) boundaries */
1013
1010
offset+=WriteBlobByte(image,cin.data_format.packing);
1014
1011
cin.data_format.sign=0; /* unsigned data */
1015
1012
offset+=WriteBlobByte(image,cin.data_format.sign);
1016
1013
cin.data_format.sense=0; /* image sense: positive image */
1017
1014
offset+=WriteBlobByte(image,cin.data_format.sense);
1018
1015
cin.data_format.line_pad=0;
1019
offset+=WriteBlobLong(image,(unsigned int) cin.data_format.line_pad);
1016
offset+=WriteBlobLong(image,cin.data_format.line_pad);
1020
1017
cin.data_format.channel_pad=0;
1021
offset+=WriteBlobLong(image,(unsigned int) cin.data_format.channel_pad);
1018
offset+=WriteBlobLong(image,cin.data_format.channel_pad);
1022
1019
offset+=WriteBlob(image,sizeof(cin.data_format.reserve),(unsigned char *)
1023
1020
cin.data_format.reserve);
1028
1025
value=GetCINProperty(image_info,image,"cin:origination.x_offset");
1029
1026
if (value != (const char *) NULL)
1030
1027
cin.origination.x_offset=StringToLong(value);
1031
offset+=WriteBlobLong(image,(unsigned int) cin.origination.x_offset);
1028
offset+=WriteBlobLong(image,(unsigned long) cin.origination.x_offset);
1032
1029
cin.origination.y_offset=0UL;
1033
1030
value=GetCINProperty(image_info,image,"cin:origination.y_offset");
1034
1031
if (value != (const char *) NULL)
1035
1032
cin.origination.y_offset=StringToLong(value);
1036
offset+=WriteBlobLong(image,(unsigned int) cin.origination.y_offset);
1033
offset+=WriteBlobLong(image,(unsigned long) cin.origination.y_offset);
1037
1034
value=GetCINProperty(image_info,image,"cin:origination.filename");
1038
1035
if (value != (const char *) NULL)
1039
1036
(void) CopyMagickString(cin.origination.filename,value,
1107
1104
value=GetCINProperty(image_info,image,"cin:film.prefix");
1108
1105
if (value != (const char *) NULL)
1109
1106
cin.film.prefix=StringToUnsignedLong(value);
1110
offset+=WriteBlobLong(image,(unsigned int) cin.film.prefix);
1107
offset+=WriteBlobLong(image,cin.film.prefix);
1111
1108
cin.film.count=0UL;
1112
1109
value=GetCINProperty(image_info,image,"cin:film.count");
1113
1110
if (value != (const char *) NULL)
1114
1111
cin.film.count=StringToUnsignedLong(value);
1115
offset+=WriteBlobLong(image,(unsigned int) cin.film.count);
1112
offset+=WriteBlobLong(image,cin.film.count);
1116
1113
value=GetCINProperty(image_info,image,"cin:film.format");
1117
1114
if (value != (const char *) NULL)
1118
1115
(void) CopyMagickString(cin.film.format,value,sizeof(cin.film.format));
1122
1119
value=GetCINProperty(image_info,image,"cin:film.frame_position");
1123
1120
if (value != (const char *) NULL)
1124
1121
cin.film.frame_position=StringToUnsignedLong(value);
1125
offset+=WriteBlobLong(image,(unsigned int) cin.film.frame_position);
1122
offset+=WriteBlobLong(image,cin.film.frame_position);
1126
1123
cin.film.frame_rate=0.0f;
1127
1124
value=GetCINProperty(image_info,image,"cin:film.frame_rate");
1128
1125
if (value != (const char *) NULL)
1162
1159
quantum_type=GrayQuantum;
1163
1160
length=GetBytesPerRow(image->columns,3,image->depth,MagickTrue);
1165
for (y=0; y < (ssize_t) image->rows; y++)
1162
for (y=0; y < (long) image->rows; y++)
1167
1164
p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
1168
1165
if (p == (const PixelPacket *) NULL)
1172
1169
count=WriteBlob(image,length,pixels);
1173
1170
if (count != (ssize_t) length)
1175
status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y,
1172
status=SetImageProgress(image,SaveImageTag,y,image->rows);
1177
1173
if (status == MagickFalse)