Lines Matching refs:tga_info
178 tga_info; in ReadTGAImage() local
209 count=ReadBlob(image,1,&tga_info.id_length); in ReadTGAImage()
210 tga_info.colormap_type=(unsigned char) ReadBlobByte(image); in ReadTGAImage()
211 tga_info.image_type=(TGAImageType) ReadBlobByte(image); in ReadTGAImage()
213 ((tga_info.image_type != TGAColormap) && in ReadTGAImage()
214 (tga_info.image_type != TGARGB) && in ReadTGAImage()
215 (tga_info.image_type != TGAMonochrome) && in ReadTGAImage()
216 (tga_info.image_type != TGARLEColormap) && in ReadTGAImage()
217 (tga_info.image_type != TGARLERGB) && in ReadTGAImage()
218 (tga_info.image_type != TGARLEMonochrome)) || in ReadTGAImage()
219 (((tga_info.image_type == TGAColormap) || in ReadTGAImage()
220 (tga_info.image_type == TGARLEColormap)) && in ReadTGAImage()
221 (tga_info.colormap_type == 0))) in ReadTGAImage()
223 tga_info.colormap_index=ReadBlobLSBShort(image); in ReadTGAImage()
224 tga_info.colormap_length=ReadBlobLSBShort(image); in ReadTGAImage()
225 tga_info.colormap_size=(unsigned char) ReadBlobByte(image); in ReadTGAImage()
226 tga_info.x_origin=ReadBlobLSBShort(image); in ReadTGAImage()
227 tga_info.y_origin=ReadBlobLSBShort(image); in ReadTGAImage()
228 tga_info.width=(unsigned short) ReadBlobLSBShort(image); in ReadTGAImage()
229 tga_info.height=(unsigned short) ReadBlobLSBShort(image); in ReadTGAImage()
230 tga_info.bits_per_pixel=(unsigned char) ReadBlobByte(image); in ReadTGAImage()
231 tga_info.attributes=(unsigned char) ReadBlobByte(image); in ReadTGAImage()
234 if ((((tga_info.bits_per_pixel <= 1) || (tga_info.bits_per_pixel >= 17)) && in ReadTGAImage()
235 (tga_info.bits_per_pixel != 24) && (tga_info.bits_per_pixel != 32))) in ReadTGAImage()
240 image->columns=tga_info.width; in ReadTGAImage()
241 image->rows=tga_info.height; in ReadTGAImage()
242 alpha_bits=(tga_info.attributes & 0x0FU); in ReadTGAImage()
243 image->alpha_trait=(alpha_bits > 0) || (tga_info.bits_per_pixel == 32) || in ReadTGAImage()
244 (tga_info.colormap_size == 32) ? BlendPixelTrait : UndefinedPixelTrait; in ReadTGAImage()
245 if ((tga_info.image_type != TGAColormap) && in ReadTGAImage()
246 (tga_info.image_type != TGARLEColormap)) in ReadTGAImage()
247 image->depth=(size_t) ((tga_info.bits_per_pixel <= 8) ? 8 : in ReadTGAImage()
248 (tga_info.bits_per_pixel <= 16) ? 5 : 8); in ReadTGAImage()
250 image->depth=(size_t) ((tga_info.colormap_size <= 8) ? 8 : in ReadTGAImage()
251 (tga_info.colormap_size <= 16) ? 5 : 8); in ReadTGAImage()
252 if ((tga_info.image_type == TGAColormap) || in ReadTGAImage()
253 (tga_info.image_type == TGAMonochrome) || in ReadTGAImage()
254 (tga_info.image_type == TGARLEColormap) || in ReadTGAImage()
255 (tga_info.image_type == TGARLEMonochrome)) in ReadTGAImage()
258 if ((tga_info.image_type == TGARLEColormap) || in ReadTGAImage()
259 (tga_info.image_type == TGARLEMonochrome) || in ReadTGAImage()
260 (tga_info.image_type == TGARLERGB)) in ReadTGAImage()
264 if (tga_info.colormap_type != 0) in ReadTGAImage()
265 image->colors=tga_info.colormap_index+tga_info.colormap_length; in ReadTGAImage()
272 image->colors=one << tga_info.bits_per_pixel; in ReadTGAImage()
280 if (tga_info.id_length != 0) in ReadTGAImage()
291 length=(size_t) tga_info.id_length; in ReadTGAImage()
306 if (tga_info.attributes & (1UL << 4)) in ReadTGAImage()
308 if (tga_info.attributes & (1UL << 5)) in ReadTGAImage()
315 if (tga_info.attributes & (1UL << 5)) in ReadTGAImage()
330 if (tga_info.colormap_type != 0) in ReadTGAImage()
335 if (image->colors < tga_info.colormap_index) in ReadTGAImage()
336 image->colors=tga_info.colormap_index; in ReadTGAImage()
339 for (i=0; i < (ssize_t) tga_info.colormap_index; i++) in ReadTGAImage()
343 switch (tga_info.colormap_size) in ReadTGAImage()
421 if (((unsigned char) (tga_info.attributes & 0x20) >> 5) == 0) in ReadTGAImage()
428 if ((tga_info.image_type == TGARLEColormap) || in ReadTGAImage()
429 (tga_info.image_type == TGARLERGB) || in ReadTGAImage()
430 (tga_info.image_type == TGARLEMonochrome)) in ReadTGAImage()
449 switch (tga_info.bits_per_pixel) in ReadTGAImage()
460 if (tga_info.colormap_type != 0) in ReadTGAImage()
543 if (((unsigned char) (tga_info.attributes & 0xc0) >> 6) == 2) in ReadTGAImage()
758 tga_info; in WriteTGAImage() local
784 tga_info.id_length=0; in WriteTGAImage()
787 tga_info.id_length=(unsigned char) MagickMin(strlen(comment),255); in WriteTGAImage()
788 tga_info.colormap_type=0; in WriteTGAImage()
789 tga_info.colormap_index=0; in WriteTGAImage()
790 tga_info.colormap_length=0; in WriteTGAImage()
791 tga_info.colormap_size=0; in WriteTGAImage()
792 tga_info.x_origin=0; in WriteTGAImage()
793 tga_info.y_origin=0; in WriteTGAImage()
794 tga_info.width=(unsigned short) image->columns; in WriteTGAImage()
795 tga_info.height=(unsigned short) image->rows; in WriteTGAImage()
796 tga_info.bits_per_pixel=8; in WriteTGAImage()
797 tga_info.attributes=0; in WriteTGAImage()
803 tga_info.image_type=compression == RLECompression ? TGARLEMonochrome : in WriteTGAImage()
811 tga_info.image_type=compression == RLECompression ? TGARLERGB : TGARGB; in WriteTGAImage()
814 tga_info.bits_per_pixel=16; in WriteTGAImage()
816 tga_info.attributes=1; /* # of alpha bits */ in WriteTGAImage()
820 tga_info.bits_per_pixel=24; in WriteTGAImage()
823 tga_info.bits_per_pixel=32; in WriteTGAImage()
824 tga_info.attributes=8; /* # of alpha bits */ in WriteTGAImage()
833 tga_info.image_type=compression == RLECompression ? TGARLEColormap : in WriteTGAImage()
835 tga_info.colormap_type=1; in WriteTGAImage()
836 tga_info.colormap_length=(unsigned short) image->colors; in WriteTGAImage()
838 tga_info.colormap_size=16; in WriteTGAImage()
840 tga_info.colormap_size=24; in WriteTGAImage()
844 tga_info.attributes|=(1UL << 4); in WriteTGAImage()
847 tga_info.attributes|=(1UL << 5); in WriteTGAImage()
853 (void) WriteBlobByte(image,tga_info.id_length); in WriteTGAImage()
854 (void) WriteBlobByte(image,tga_info.colormap_type); in WriteTGAImage()
855 (void) WriteBlobByte(image,(unsigned char) tga_info.image_type); in WriteTGAImage()
856 (void) WriteBlobLSBShort(image,tga_info.colormap_index); in WriteTGAImage()
857 (void) WriteBlobLSBShort(image,tga_info.colormap_length); in WriteTGAImage()
858 (void) WriteBlobByte(image,tga_info.colormap_size); in WriteTGAImage()
859 (void) WriteBlobLSBShort(image,tga_info.x_origin); in WriteTGAImage()
860 (void) WriteBlobLSBShort(image,tga_info.y_origin); in WriteTGAImage()
861 (void) WriteBlobLSBShort(image,tga_info.width); in WriteTGAImage()
862 (void) WriteBlobLSBShort(image,tga_info.height); in WriteTGAImage()
863 (void) WriteBlobByte(image,tga_info.bits_per_pixel); in WriteTGAImage()
864 (void) WriteBlobByte(image,tga_info.attributes); in WriteTGAImage()
865 if (tga_info.id_length != 0) in WriteTGAImage()
866 (void) WriteBlob(image,tga_info.id_length,(unsigned char *) comment); in WriteTGAImage()
867 if (tga_info.colormap_type != 0) in WriteTGAImage()
877 tga_info.colormap_length,(tga_info.colormap_size/8)* in WriteTGAImage()
902 (void) WriteBlob(image,(size_t) ((tga_info.colormap_size/8)* in WriteTGAImage()
903 tga_info.colormap_length),targa_colormap); in WriteTGAImage()
925 if (tga_info.image_type == TGARLEColormap) in WriteTGAImage()
931 else if (tga_info.image_type == TGARLEMonochrome) in WriteTGAImage()
966 WriteTGAPixel(image,tga_info.image_type,p-((count+1)* in WriteTGAImage()
976 WriteTGAPixel(image,tga_info.image_type,p,range,midpoint); in WriteTGAImage()
986 WriteTGAPixel(image,tga_info.image_type,p,range,midpoint); in WriteTGAImage()