Changeset 134:116d23207a86

Show
Ignore:
Timestamp:
01/21/08 12:38:19 (9 months ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

changed PNG loader to use internal inflating

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dsss.conf

    r132 r134  
    9797buildflags+=-L-lcairo 
    9898buildflags+=-g -gc 
     99buildflags+=-I/home/frank/jive 
    99100buildflags+=-Jdwtexamples/controlexample 
    100101 
  • dwt/dwthelper/InflaterInputStream.d

    r132 r134  
    77import dwt.dwthelper.utils; 
    88import tango.io.Stdout; 
     9import tango.io.compress.ZlibStream; 
    910 
    1011class InputStreamWrapper : tango.io.model.IConduit.InputStream { 
     
    1718 
    1819    uint read (void[] dst){ 
    19         int res = istr.read( cast(byte[])dst, 0, dst.length ); 
    20         //Stdout.formatln( "read {}/{}", dst.length, res ); 
     20        int res = istr.read( cast(byte[])dst ); 
    2121        return res; 
    2222    } 
     
    4949    package bool usesDefaultInflater = false; 
    5050 
    51     InputStreamWrapper tangoIstr; 
     51    ZlibInput tangoIstr; 
    5252 
    5353    public this ( dwt.dwthelper.InputStream.InputStream istr ){ 
    54         tangoIstr = new InputStreamWrapper(istr ); 
     54        tangoIstr = new ZlibInput( new InputStreamWrapper(istr )); 
    5555    } 
    5656 
     
    5858        ubyte[1] data; 
    5959        uint res = tangoIstr.read( data ); 
    60         if( res !is tango.io.model.IConduit.IOStream.Eof ){ 
     60        if( res !is 1 ){ 
    6161            return data[0] & 0xFF; 
    6262        } 
  • dwt/internal/image/FileFormat.d

    r131 r134  
    1 /******************************************************************************* 
     1/******************************************************************************* 
    22 * Copyright (c) 2000, 2006 IBM Corporation and others. 
    33 * All rights reserved. This program and the accompanying materials 
  • dwt/internal/image/PNGFileFormat.d

    r131 r134  
    1 /******************************************************************************* 
     1/******************************************************************************* 
    22 * Copyright (c) 2000, 2006 IBM Corporation and others. 
    33 * All rights reserved. This program and the accompanying materials 
  • dwt/internal/image/PngChunk.d

    r131 r134  
    1 /******************************************************************************* 
     1/******************************************************************************* 
    22 * Copyright (c) 2000, 2006 IBM Corporation and others. 
    33 * All rights reserved. This program and the accompanying materials 
     
    313313        int chunkLength = tempChunk.getSize(); 
    314314        byte[] chunk = new byte[chunkLength]; 
     315 
    315316        result = stream.read(chunk, 0, chunkLength); 
    316317        if (result !is chunkLength) return null; 
  • dwt/internal/image/PngIendChunk.d

    r108 r134  
    1 /******************************************************************************* 
     1/******************************************************************************* 
    22 * Copyright (c) 2000, 2006 IBM Corporation and others. 
    33 * All rights reserved. This program and the accompanying materials 
     
    3838 * Answer whether the chunk is a valid IEND chunk. 
    3939 */ 
    40 void validate(PngFileReadState readState, PngIhdrChunk headerChunk) { 
     40override void validate(PngFileReadState readState, PngIhdrChunk headerChunk) { 
    4141    // An IEND chunk is invalid if no IHDR has been read. 
    4242    // Or if a palette is required and has not been read. 
  • dwtexamples/controlexample/ControlExample.d

    r132 r134  
    8080import tango.util.PathUtil; 
    8181/*** Linker workaround end ***/ 
     82 
     83import jive.stacktrace; 
    8284 
    8385void main(){