~ubuntu-branches/ubuntu/dapper/fpc/dapper

« back to all changes in this revision

Viewing changes to packages/base/pasjpeg/rdtarga.pas

  • Committer: Bazaar Package Importer
  • Author(s): Carlos Laviola
  • Date: 2005-05-30 11:59:10 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050530115910-x5pbzm4qqta4i94h
Tags: 2.0.0-2
debian/fp-compiler.postinst.in: forgot to reapply the patch that
correctly creates the slave link to pc(1).  (Closes: #310907)

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
  jinclude,
22
22
  jdeferr,
23
23
  jerror,
24
 
  cdjpeg;               { Common decls for cjpeg/djpeg applications }
 
24
  cdjpeg;               { Common decls for cjpeg/djpeg applications }
25
25
 
26
26
 
27
27
{ The module selection routine for Targa format input. }
165
165
  begin { decrement pixels remaining in block }
166
166
    i := read_byte(sinfo);
167
167
    if (i and $80) <> 0 then
168
 
    begin               { Start of duplicate-pixel block? }
 
168
    begin               { Start of duplicate-pixel block? }
169
169
      sinfo^.dup_pixel_count := i and $7F; { number of dups after this one }
170
 
      sinfo^.block_count := 0;  { then read new block header }
 
170
      sinfo^.block_count := 0;  { then read new block header }
171
171
    end
172
172
    else
173
173
    begin
408
408
           ( uInt(UCH(targaheader[14+1])) ) shl 8);
409
409
 
410
410
  source^.pixel_size := UCH(targaheader[16]) shl 3;
411
 
  flags := UCH(targaheader[17]);        { Image Descriptor byte }
 
411
  flags := UCH(targaheader[17]);        { Image Descriptor byte }
412
412
 
413
 
  is_bottom_up := (flags and $20) = 0;  { bit 5 set => top-down }
414
 
  interlace_type := flags shl 6;        { bits 6/7 are interlace code }
 
413
  is_bottom_up := (flags and $20) = 0;  { bit 5 set => top-down }
 
414
  interlace_type := flags shl 6;        { bits 6/7 are interlace code }
415
415
 
416
416
  if (cmaptype > 1) or                  { cmaptype must be 0 or 1 }
417
417
     (source^.pixel_size < 1) or (source^.pixel_size > 4) or
434
434
  end;
435
435
 
436
436
  { Now should have subtype 1, 2, or 3 }
437
 
  components := 3;              { until proven different }
 
437
  components := 3;              { until proven different }
438
438
  cinfo^.in_color_space := JCS_RGB;
439
439
 
440
440
  case (subtype) of
455
455
      end;
456
456
      TRACEMS2(j_common_ptr(cinfo), 1, JTRC_TGA, width, height);
457
457
    end;
458
 
  3:begin       { Grayscale image }
 
458
  3:begin       { Grayscale image }
459
459
      components := 1;
460
460
      cinfo^.in_color_space := JCS_GRAYSCALE;
461
461
      if (source^.pixel_size = 1) then
547
547
  { Create module interface object }
548
548
  source := tga_source_ptr (
549
549
      cinfo^.mem^.alloc_small (j_common_ptr (cinfo), JPOOL_IMAGE,
550
 
                                  SIZEOF(tga_source_struct)) );
551
 
  source^.cinfo := cinfo;       { make back link for subroutines }
 
550
                                  SIZEOF(tga_source_struct)) );
 
551
  source^.cinfo := cinfo;       { make back link for subroutines }
552
552
  { Fill in method ptrs, except get_pixel_rows which start_input sets }
553
553
  source^.pub.start_input := start_input_tga;
554
554
  source^.pub.finish_input := finish_input_tga;
556
556
  jinit_read_targa  := cjpeg_source_ptr (source);
557
557
end;
558
558
 
559
 
end. { TARGA_SUPPORTED }
 
 
b'\\ No newline at end of file'
 
559
end. { TARGA_SUPPORTED }