Commit graph

50 commits

Author SHA1 Message Date
Fred Kiefer
a047b10a51
16bit (#123)
* Fix compiler warnings

* Attempt to sort out byte order for 15 bit images.

* Try to get integer types from standard location

* Remove extra swap code by using more complex condition.
Thanks to Riccardo Mottola.
2021-11-08 22:46:25 +01:00
Riccardo Mottola
9c7eeb9c20 Support for writing resolution
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@40491 72102866-910b-0410-8b05-ffd578937521
2017-04-24 10:42:32 +00:00
Fred Kiefer
8e8a1af817 * Source/nsimage-tiff.h: Correct field types.
* Source/NSImage.m (-TIFFRepresentation)
        (TIFFRepresentationUsingCompression:factor:): Pass on bitmaps
only.
        * Source/NSBitmapImageRep.m: Implement methods to generate tiff
        for multiple bitmaps.
        * Source/tiff.m: Fix long standing bug in TiffHandleSeek.
        In NSTiffWrite write image tiff directory to allow for multiple
        images.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@39050 72102866-910b-0410-8b05-ffd578937521
2015-10-10 19:18:33 +00:00
Fred Kiefer
29f4f8c512 * Source/tiff.m: Correct check for old libtiff version based on
idea by Riccardo Mottola <rm@gnu.org>.
        Remove all usages of deprecated types.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38300 72102866-910b-0410-8b05-ffd578937521
2015-01-23 13:29:38 +00:00
Fred Kiefer
51276dc346 * Source/tiff.m: Use type tmsize_t.
Base on patch by Marat Ibadinov <ibadinov@me.com>


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38287 72102866-910b-0410-8b05-ffd578937521
2015-01-11 21:51:20 +00:00
Eric Wasylishen
76d30190e9 * Source/tiff.m:
* Source/nsimage-tiff.h:
* Source/NSBitmapImageRep.m: Read DPI metadata in TIFF files and use this
to set the point size of the image rep


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32920 72102866-910b-0410-8b05-ffd578937521
2011-04-21 22:19:06 +00:00
Fred Kiefer
924b24dde4 Fix warnigns reported by clang.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32814 72102866-910b-0410-8b05-ffd578937521
2011-04-08 23:21:55 +00:00
Fred Kiefer
2d01942e4b Replace #include -> #import
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32451 72102866-910b-0410-8b05-ffd578937521
2011-03-04 11:33:22 +00:00
Richard Frith-MacDonald
edb6aa47ee avoid obsolete macros
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32412 72102866-910b-0410-8b05-ffd578937521
2011-02-28 15:43:25 +00:00
Wolfgang Lux
106d7bf39d Fix long standing bug where an incorrect tiff representation was
generated for RGB images if bits per sample != 8.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31829 72102866-910b-0410-8b05-ffd578937521
2011-01-04 14:10:12 +00:00
Riccardo Mottola
ed0d31d84e remove useless double statement, remove unused variable and assignment
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31344 72102866-910b-0410-8b05-ffd578937521
2010-09-13 15:41:53 +00:00
Fred Kiefer
c05581a005 Fix up teh includes to compile again after latest changes to base. Still
plenty of warnings and the result isn't working at least on 64 bit
machines :-(


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29685 72102866-910b-0410-8b05-ffd578937521
2010-02-20 10:40:44 +00:00
Adam Fedor
41ec18afa4 Fix incorrect commits
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26633 72102866-910b-0410-8b05-ffd578937521
2008-06-12 14:09:48 +00:00
Adam Fedor
7afdd32ac1 Revert library license version to 2 until applications can be converted
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26619 72102866-910b-0410-8b05-ffd578937521
2008-06-10 04:01:49 +00:00
Richard Frith-MacDonald
03a4a96a40 Update includes ... closer MacOS-X compatibility.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25635 72102866-910b-0410-8b05-ffd578937521
2007-11-29 20:28:03 +00:00
Fred Kiefer
0477e36f24 Bugs reported by gcc 4.2.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25582 72102866-910b-0410-8b05-ffd578937521
2007-11-11 18:10:42 +00:00
Fred Kiefer
193e31e678 Change all files to use GPL 3 and LGPL 3.
Prepare for next release.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25536 72102866-910b-0410-8b05-ffd578937521
2007-10-29 21:16:17 +00:00
Mark Tracy
9f633f60f6 Change Log
Mon. 20-Nov-2006 Mark Tracy <tracy454 at concentric dot net>
Many changes related to bitmap images

1.  NSBitmapImateRep attribute global strings were not defined
    Fix: add definitions to externs.h, and declarations to NSBitmapImageRep.h
    Comment: Two strings defined in Cocoa were commented out: NSImageColorSyncData
      is proprietary to Apple, and NSImageEXIFData has no support elsewhere in
      GNUstep. I propose adding GSImageICCProfileData if and when color management
      is added to GNUstep.

2.  LZW compression in TIFF was disabled for lack of a test of its availability
    Fix: Implement NSTiffIsCodecConfigured(codec) in tiff.m
    Comment: As of libtiff-3.7.0, there is a function call in the API to test
      availability at runtime. For libtiff-3.6.0 (earlier?) there are macros
      #defined in tiffconf.h. The implementation check the library version at
      compile time, and uses one of the two methods. I have not tested the 
      second method for lack of an installation of an old libtiff.

3.  -canCompressUsing: relied on a static list of capabilities
    Fix: Use the new NSTiffIsCodecConfigured(codec) in NSBitmapImageRep.m
    Comment: The static list could be wrong, as it was on my system. Also
      eliminate the supports_lzw_compression flag.

4.  +getTIFFCompressionTypes:count: relied on a static list of compressors.
    Fix: Use the new NSTiffIsCodecConfigured(codec) in NSBitmapImageRep.m
    Comment: Compares GNUstep supported compressors against actual availability.
      Also change the private instance methods _localFromCompressionType and 
      _compressionTypeFromLocal to private class methods so that they can be used
      in -initWithTIFFImage:number: and -TIFFRepresentationUsingCompression:factor:
      and +getTIFFCompressionTypes:count: This is probably a clumsy implementation
      but it works.

5.  -setProperty:toValue: and -valueForProperty: were not implemented
    Fix: Add a new instance variable NSMutableDictionary * _properties to 
      NSBitmapImageRep.h and implemented accessors in NSBitmapImageRep.m. Patch
      -_initFromTIFFImage to set compression type and factor in _properties.
    Comment: This feature is used to pass options to and from JPEG, PNG, TIFF, and
      GIF in Cocoa, although the docs are kind of vague. In one case the Cocoa docs
      said the properties were set when reading a TIFF, but the implementation
      didn't; I chose to implement the docs. Cocoa does use properties when 
      exporting bitmaps, so I implemented that.

6.  Checked and updated NSBitmapImageFileType in NSBitmapImageRep.h
    Fix: confirmed the enumeration values against Cocoa, and added 
      NSJPEG2000FileType = 5
    Comment: JPEG-2000 is not implemented, just reserved a space for it.

7.  -representationUsingType:properties: was not implemented
    Fix: Implement export of TIFF, JPEG, GIF and PNG in NSBitmapImage.m
    Comment: See the change notes for JPEG, GIF, and PNG for more. BMP and JPEG-2000
      are not implemented; they just log a message to that effect. As apparently
      Cocoa does it this way, if you pass nil for properties, it falls back to 
      the internal _properties, and if that is empty, there are some safe defaults.

8.  +representationfOfImageRepsInArray:UsingType:properties: was not implemented
    Fix: Partially implement in NSBitmapImageRep.m
    Comment: I just stole the incomplete code from
      +TIFFRepresentationOfImageRepsInArray: since I have yet to find an explanation
      of how this really ought to work.

9.  JPEG export didn't handle alpha channel, properties or errors.
    Fix: Add -_JPEGRepresentationWithProperties:errorMessage: to
      NSBitmapImageRep+JPEG.h and greatly rework Nicolas Roard's code in
      NSBitmapImageRep+JPEG.m. Patch -_initBitmapFromJPEG:errorMessage to
      write properties.
    Comment: Major rewrite of Nicolas Roard's JPEG export code. 
    To do: Support for planar bitmaps and support for colorspaces other than
      RGB(A).

10. PNG export not implemented
    Fix: Add -_PNGRepresentationWithProperties: to
      NSBitmapImageRep+PNG.h and implement NSBitmapImageRep+PNG.m
    Comment: No support yet for planar bitmaps. Only supports 
      NS*WhiteColorSpace and NS*RGBColorSpace. Does support alpha. Support for
      reading and writing NSImageGamma is experimental. In keeping with Cocoa,
      the property NSImageGamma ranges from 0.0 to 1.0; representing the range
      of minimum supported gamma to maximum supported gamma, in this case 1.0
      to 2.5. This is in contrast to GNUstep where by convention the property
      would range from 0.0 to 255.0.
    To do: proper error message support

11. GIF export not implemented
    Fix: Add -_GIFRepresentationWithPropterties:errorMessage: to
      NSBitmapImageRep+GIF.h and implement in NSBitmapImageRep+GIF.m
    Comments: Supports only RGB(A) colorspaces, but ignores alpha. Supports
      planar or interleaved bitmaps. Supports properties NSImageRGBColorTable.

12. -_initBitmapFromGIF:errorMessage: did not support transparency
    Fix: Don't ignore control blocks in NSBitmapImageRep+GIF.m; check for
      transparency.
    Comment: If a transparent color is found, it adds an alpha channel to the 
      bitmap. Also, save the color table in properties.

13. -_initBitmapFromGIF:errorMessage: would show the last image in a 
      multi-image GIF file
    Fix: Break the parsing loop after the first image in NSBitmapImageRep+GIF.m
    Comment: Also check for frame duration, and set that property. There is not
      yet any support for animated GIF. This will require some additional 
      infrastructure, and I won't do it unless asked.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24140 72102866-910b-0410-8b05-ffd578937521
2006-11-21 06:36:26 +00:00
Adam Fedor
303dd1baf9 Update FSF Address.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@21259 72102866-910b-0410-8b05-ffd578937521
2005-05-26 02:52:46 +00:00
Alexander Malmberg
ad2419e484 2005-01-21 21:43 Alexander Malmberg <alexander@malmberg.org>
Various whitespace cleanups, comment type fixes, and changes
	to avoid warnings from recent versions of gcc.

	* Headers/Additions/GNUstepGUI/GSToolbar.h (-_toolbars): Declare.
	* Source/NSWindow+Toolbar.m: Remove conflicting declaration of
	[NSToolbar -_toolbars].

	* Headers/Additions/GNUstepGUI/GSServicesManager.h,
 	Source/GSServicesMananger.m (-item2title:, -validateMenuItem:):
	Adjust argument types.
	* Headers/AppKit/NSMenu.h (-validateMenuItem:): Adjust argument
	type.

	* Source/NSTextView.m (-sizeToFit): Don't use size uninitialized
	if neither resizable flags is set.
	(-insertText:): Adjust argument type.
	* Headers/AppKit/NSResponder.h, Source/NSResponder.m (-insertText:):
	Adjust argument type. Document.

	* Headers/AppKit/NSView.h: Change type of ivar _window to NSWindow *.

	* Source/GSTitleView.m (-mouseDown:): Always initialize
	startWindowOrigin.
	* Source/NSApplication.m (-setApplicationIconImage:): Add casts
	to avoid warnings.
	* Source/NSCell.m (-cellSize): Add default: case.
	* Source/NSPasteboard.m
	([GSFiltered -pasteboard:provideDataForType:]): Detect and warn if we
	can't find a filter that will get us the desired type.
	* Source/NSProgressIndicator.m: Comment out unused variable 'images'.
	* Source/NSBezierPath.m: Declare GSBezierPath fully before using it.
	(-bezierPathByFlatteningPath, -bezierPathByReversingPath): Make sure
	variables are always initialized.

	* Source/NSMenuView.m,
	* Source/NSPrintOperation.m,
	* Source/NSSplitView.m,
	* Source/NSTableHeaderView.m: Make sure variables are always
	initialized.

	* Source/NSBox.m,
	* Source/NSImageview.m,
	* Source/NSText.m,
	* Source/NSTextStorage.m: Add missing includes.

	* Source/GSKeyBindingTable.m,
	* Source/GSLayoutManager.m,
	* Source/NSBitmapImageRep+PNM.m,
	* Source/NSBundleAdditions.m,
	* Source/NSLayoutManager.m,
	* Source/nsimage-tiff.h,
	* Source/tiff.m,
	* Headers/Additions/GNUstepGUI/GSDisplayServer.h,
	* Source/GSDisplayServer.m: Change signedness of various variables.

	* Source/NSPanel.m (-sendEvent:): Remove.
	* Source/NSWindow.m (-becomesKeyOnlyIfNeeded): New method.
	(-_sendEvent:becomesKeyOnlyIfNeeded:): Remove. Move code ...
	(-sendEvent:): ... here. Use -becomesKeyOnlyIfNeeded instead
	of the argument.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@20590 72102866-910b-0410-8b05-ffd578937521
2005-01-21 20:39:18 +00:00
Alexander Malmberg
e2e0084fdb Log tiff warnings using NSDebugLLog instead of NSLog. Make private methods static.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@20082 72102866-910b-0410-8b05-ffd578937521
2004-09-18 13:16:55 +00:00
Adam Fedor
bbeec6b247 Better error checking and documentation
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17638 72102866-910b-0410-8b05-ffd578937521
2003-09-08 02:07:53 +00:00
David Ayers
b18f1c4ac4 Header reorganization - Please refer to ChangeLog
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17408 72102866-910b-0410-8b05-ffd578937521
2003-07-31 23:52:10 +00:00
Fred Kiefer
26c82d8aef Removed compiler warning about signed/unsigned comparision.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17005 72102866-910b-0410-8b05-ffd578937521
2003-06-23 15:50:46 +00:00
Adam Fedor
6be9174933 Include <> -> ""
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@16917 72102866-910b-0410-8b05-ffd578937521
2003-06-13 15:01:12 +00:00
Adam Fedor
0a30e76ea7 Set EXTRASAMPLES even if 0
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@10840 72102866-910b-0410-8b05-ffd578937521
2001-09-04 03:58:59 +00:00
Adam Fedor
09193da35a Fix image unacrhiving
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@10831 72102866-910b-0410-8b05-ffd578937521
2001-09-01 20:57:51 +00:00
Adam Fedor
94398b3eda Fix image encoding
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@10827 72102866-910b-0410-8b05-ffd578937521
2001-09-01 04:20:55 +00:00
Adam Fedor
67b4261f59 Image archiving fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@10820 72102866-910b-0410-8b05-ffd578937521
2001-08-30 22:02:38 +00:00
Adam Fedor
a77949a8e6 MinGW cleanup
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@10640 72102866-910b-0410-8b05-ffd578937521
2001-08-02 14:51:41 +00:00
Adam Fedor
fc383e05d2 Check for sel.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@9895 72102866-910b-0410-8b05-ffd578937521
2001-05-08 02:42:45 +00:00
Adam Fedor
77aed0db2b Fix declarations
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@9304 72102866-910b-0410-8b05-ffd578937521
2001-03-06 03:29:55 +00:00
Adam Fedor
135259b7c2 Dont free colormap tables in PHOTOMETRIC_PALETTE
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@7620 72102866-910b-0410-8b05-ffd578937521
2000-09-27 15:16:42 +00:00
Adam Fedor
c604091e89 Image improvements.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6481 72102866-910b-0410-8b05-ffd578937521
2000-04-18 16:58:14 +00:00
Adam Fedor
456220f857 Get alpha with 2 parameters
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6467 72102866-910b-0410-8b05-ffd578937521
2000-04-16 16:27:47 +00:00
Adam Fedor
c256b1df22 View display an tiff improvements
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6463 72102866-910b-0410-8b05-ffd578937521
2000-04-13 19:23:16 +00:00
David Lazaro Saz
a95ce979e7 Changed name of NSWriteTiff function to NSTiffWrite so GNUstep GUI library can
be linked again (also for coherence).


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5639 72102866-910b-0410-8b05-ffd578937521
1999-12-29 01:25:46 +00:00
Adam Fedor
4f1dbcfbe8 More imaging and compositing stuff
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5635 72102866-910b-0410-8b05-ffd578937521
1999-12-28 19:20:45 +00:00
Richard Frith-MacDonald
ec738f36de Image encoding support - first cut
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5633 72102866-910b-0410-8b05-ffd578937521
1999-12-28 16:02:01 +00:00
Adam Fedor
013b7770f1 Minor fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4106 72102866-910b-0410-8b05-ffd578937521
1999-04-21 17:31:41 +00:00
Richard Frith-MacDonald
33fd342d55 Misc bugfixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@3758 72102866-910b-0410-8b05-ffd578937521
1999-02-19 20:31:07 +00:00
Scott Christley
aee90a695e Convert to the GNUstep makefile package.
The config.h files should not be installed with the other
header files; it is only used for compilation, so the source
files should include it not the header files.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2439 72102866-910b-0410-8b05-ffd578937521
1997-09-23 22:43:24 +00:00
Scott Christley
1957d087a5 Additional NSScroller implementation.
Fix locking/unlocking of focus for view hierarchy.
Numerous bug fixes.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2255 72102866-910b-0410-8b05-ffd578937521
1997-03-20 19:23:21 +00:00
Scott Christley
1fee4feff2 Minor bug fixes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2234 72102866-910b-0410-8b05-ffd578937521
1997-03-06 01:46:43 +00:00
Scott Christley
d7d2c449e6 Make sure config.h file is included.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2232 72102866-910b-0410-8b05-ffd578937521
1997-03-06 01:27:45 +00:00
Scott Christley
1f73912776 Remove internal NSLog() implementation.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2224 72102866-910b-0410-8b05-ffd578937521
1997-03-04 17:55:44 +00:00
Scott Christley
c47e7d474c An almost complete NSButtonCell implementation.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2192 72102866-910b-0410-8b05-ffd578937521
1997-02-18 18:45:16 +00:00
Scott Christley
151bf11e2c Header files reorganized. All the definitions were moved in appropiate files.
Each header file includes only the header files it needs and it uses
@class to forward reference a class.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2189 72102866-910b-0410-8b05-ffd578937521
1997-02-18 00:29:25 +00:00
Scott Christley
50604fcf31 Corrected FSF address and moved comment about NET-Community
support into SUPPORT file.
Additional NSImage work.
Added resources for common TIFF images.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@1869 72102866-910b-0410-8b05-ffd578937521
1996-10-18 17:14:13 +00:00
Scott Christley
9156e43f7c Minor modifications for Win32
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@1856 72102866-910b-0410-8b05-ffd578937521
1996-10-07 20:29:00 +00:00
Renamed from Source/tiff.c (Browse further)