Filewatcher File Search
FTP Search
  
Directory 
  
Content Search 
   
pkg://ikit-0.4-1.sparc.rpm:138064/usr/local/lib/ikit/ikit_jpeg.tcl  info  downloads

#
# Copyright (c) 1997 Picture Elements, Inc.
# Stephen Williams (steve@picturel.com)
#
#    This source code is free software; you can redistribute it
#    and/or modify it in source code form under the terms of the GNU
#    Library General Public License as published by the Free Software
#    Foundation; either version 2 of the License, or (at your option)
#    any later version. In order to redistribute the software in
#    binary form, you will need a Picture Elements Binary Software
#    License.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU Library General Public License for more details.
#
#    You should have received a copy of the GNU Library General Public
#    License along with this program; if not, write to the Free
#    Software Foundation, Inc.,
#    59 Temple Place - Suite 330
#    Boston, MA 02111-1307, USA
#
#    You should also have recieved a copy of the Picture Elements
#    Binary Software License offer along with the source. This offer
#    allows you to obtain the right to redistribute the software in
#    binary (compiled) form. If you have not received it, contact
#    Picture Elements, Inc.,
#    777 Panoramic Way
#    Berkeley, CA 94704.
#
#ident "$Id: ikit_jpeg.tcl,v 1.2 1997/07/03 00:27:27 steve Exp $"

# --
# Set up the PNG stuff, including all the global functions
# needed. Install hooks into the GUI as needed.
#



# --
# Load a PNG file into an image, and push the result onto the top
# of the stack.

set jpeg_file_load ""

proc jpeg_load {} {
    global jpeg_file_load
    ik_get_values "{jpeg_file_load {JPEG/JFIF file to load:} filename}"
    set file "$jpeg_file_load"

    set label [ik_unique_image_name [file tail $jpeg_file_load]]

    image create ik_image $label -jpeg $file
    ik_stack_push $label "$label <-- JPEG($file)\n"
}

# --
# Save an image into a PBM file.

set jpeg_file_save ""
proc jpeg_save {} {
    global jpeg_file_save
    set source [ik_stack_peek]
    if {[llength $source] == 0} return

    ik_get_values "{jpeg_file_save {JPEG/JFIF file to save:} filename}"
    set file "$jpeg_file_save"

    ik_store $source -jpeg $file

    ik_console "Store $source in JPEG/JFIF file $file\n"
}


ik_add_saver  "JPEG/JFIF" jpeg_save
ik_add_loader "JPEG/JFIF" jpeg_load

#
# $Log: ikit_jpeg.tcl,v $
# Revision 1.2  1997/07/03 00:27:27  steve
#  Add ability to write JFIF files.
#
# Revision 1.1  1997/07/02 22:30:08  steve
#  Introduce JPEG support.
#
#
Results 1 - 1
Help - FTP Sites List - Software Dir.
Searching half a billion files worldwide
© 1997-2009 MARUHN Internet Solutions