Commit graph

82 commits

Author SHA1 Message Date
Fred Kiefer
270baf4037 More CGFloat, NSUInteger and NSInteger changes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36148 72102866-910b-0410-8b05-ffd578937521
2013-02-16 00:08:33 +00:00
Fred Kiefer
4d8bbcfe9b * Source/NSBitmapImageRep.m (-_convertToFormatBitsPerSample:...bitsPerPixel:): Correct
handling of black data.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34762 72102866-910b-0410-8b05-ffd578937521
2012-02-15 22:04:08 +00:00
Fred Kiefer
2d48b49175 Deal with images taht result in no data. This happens in themes that
have to small images to be split up into 9 tiles.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34688 72102866-910b-0410-8b05-ffd578937521
2012-02-01 10:49:35 +00:00
Fred Kiefer
d570812401 Fix clang compiler warnings as reported by Sebastian Reitenbach
<sebastia@l00-bugdead-prods.de>.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34608 72102866-910b-0410-8b05-ffd578937521
2012-01-23 14:27:58 +00:00
Fred Kiefer
afe8c3bea5 * Source/NSBitmapImageRep.m (+imageRepWithData:): Add missing
AUTORELEASE.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34078 72102866-910b-0410-8b05-ffd578937521
2011-10-27 17:07:54 +00:00
Eric Wasylishen
25c6770196 * Source/NSBitmapImageRep.m:
* Source/NSColor.m:
* Source/GSThemeTools.m:
* Source/NSGraphicsContext.m:
* Headers/AppKit/NSColor.h:
* Headers/AppKit/NSGraphicsContext.h:
* ColorPickers/GSGrayColorPicker.m:
* ColorPickers/GSCMYKColorPicker.m:
* ColorPickers/GSWheelColorPicker.m:
* ColorPickers/GSRGBColorPicker.m:
* ColorPickers/GSHSBColorPicker.m: Migrate float to CGFloat in
NSColor


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34070 72102866-910b-0410-8b05-ffd578937521
2011-10-26 00:21:57 +00:00
Fred Kiefer
86ff6abf69 Replace direct use of the isa pointer with a call to object_getClass()
to make David happy.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33545 72102866-910b-0410-8b05-ffd578937521
2011-07-14 07:17:24 +00:00
David Chisnall
002f6635b4 Small GC fixups. Make sure that we're actually using GC-tracked memory when we think that we are.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33416 72102866-910b-0410-8b05-ffd578937521
2011-06-29 15:41:14 +00:00
Eric Wasylishen
af6f2c29bc * Source/NSBitmapImageRep.m: Reduce floating-point error in the
expression which computes image point size using DPI and pixel size
(for TIFF images.)


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33293 72102866-910b-0410-8b05-ffd578937521
2011-06-13 22:09:52 +00:00
David Chisnall
b4e3915c33 Turn release messages sent to autorelease pools into drain messages. No
functionality change in non-GC mode, in GC mode it invokes a quick GC pass to
try to delete the short-lived objects.

Also deleted some [pool release] lines just before exit() or return-from-main
statements.  These cause objects to be swapped in and destructors to be run to
no benefit (the OS will reclaim this memory without requiring stuff to be
swapped in when the process exits).



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33146 72102866-910b-0410-8b05-ffd578937521
2011-05-27 12:42:37 +00:00
Fred Kiefer
2608a790ed Method to get all images from an ICNS file.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33062 72102866-910b-0410-8b05-ffd578937521
2011-05-18 20:07:02 +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
2e738f7ba2 Correct issues with missing or incorrect self
tests in initXXX methods pointed out by static analyser.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32588 72102866-910b-0410-8b05-ffd578937521
2011-03-14 22:59:20 +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
Fred Kiefer
99e273a57d few compiler warning fixes plus a lot of #import replacement.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30448 72102866-910b-0410-8b05-ffd578937521
2010-05-24 10:48:14 +00:00
Fred Kiefer
b8d68dcdbb Apply patch by Eric Wasylishen to correct the orientation of colorAtX:y:
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29120 72102866-910b-0410-8b05-ffd578937521
2009-12-14 13:26:26 +00:00
Fred Kiefer
97d5040a02 Made the code a bit more tolerant on matching colour spaces during
image conversion.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27280 72102866-910b-0410-8b05-ffd578937521
2008-12-11 23:34:56 +00:00
Fred Kiefer
99acf8e220 Filled with some more code. The conversion within the same colour
space and be between black/white and RGB should now be correct
and faster.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27013 72102866-910b-0410-8b05-ffd578937521
2008-11-06 09:23:10 +00:00
Fred Kiefer
288bf8cfbe Add drop in replacement code for libicns.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26829 72102866-910b-0410-8b05-ffd578937521
2008-09-03 07:02:34 +00:00
Gregory John Casamento
8b4277dcdc * configure: Regenerated file
* configure.ac: Added check for libicns. (http://icns.sourceforge.net/)
        * Headers/Additions/GNUstepGUI/config.h.in
        * Source/GNUmakefile: Added new files
        * Source/NSBitmapImageRep+ICNS.h: Header for ICNS category
        * Source/NSBitmapImageRep+ICNS.m: Implementation if ICNS reading
        logic.
        * Source/NSBitmapImageRep.m: Add support for the ICNS file 
        format so that GNUstep can read Mac OS X icon files.   Uses
        the libicns library available from sourceforge.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26805 72102866-910b-0410-8b05-ffd578937521
2008-08-12 04:58:04 +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
Fred Kiefer
0d146e1c55 Small improvements on premultiplcation of alpha.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26276 72102866-910b-0410-8b05-ffd578937521
2008-03-11 20:11:53 +00:00
Fred Kiefer
2dabdc3270 In _premultiply and _unpremultiply flag the format as changed.
Add fast path for 8 bit images.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26131 72102866-910b-0410-8b05-ffd578937521
2008-02-25 15:35:57 +00:00
Fred Kiefer
5efc693137 Better support for transparent images and more image formats.
Add background image in info panel.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26043 72102866-910b-0410-8b05-ffd578937521
2008-02-08 22:40:38 +00:00
Fred Kiefer
56b6a0ff3e Do all bitmap image drawing via GSDrawImage:: to allow better
implementations in backends.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25600 72102866-910b-0410-8b05-ffd578937521
2007-11-22 10:47:33 +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
Fred Kiefer
d9445dfd53 Add MacOSX 10.4 methods and constants.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25359 72102866-910b-0410-8b05-ffd578937521
2007-07-26 17:55:36 +00:00
Richard Frith-MacDonald
bc34ad5f62 Document some typedefs
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24351 72102866-910b-0410-8b05-ffd578937521
2007-01-15 10:18:24 +00:00
Mark Tracy
311911e218 Autogsdoc comments for Source/NSBitmapImageRep.m
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24196 72102866-910b-0410-8b05-ffd578937521
2006-12-10 09:46:21 +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
Richard Frith-MacDonald
57435da7d5 tidyups and minor theme tiling updates.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23871 72102866-910b-0410-8b05-ffd578937521
2006-10-15 08:34:47 +00:00
Gregory John Casamento
84d0296b74 Correction for GSNibCompatibility. Added coding to classes for keyed archiving.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23225 72102866-910b-0410-8b05-ffd578937521
2006-08-09 01:37:32 +00:00
Fabien Vallon
b566e2c30b Improved documentation
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22037 72102866-910b-0410-8b05-ffd578937521
2005-11-18 14:38:23 +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
Adam Fedor
bc6d45f6f7 * configure.ac: Check for libgif
* Source/NSBitmapImageRep+GIF.m: Support libgif
* Source/NSBitmapImageRem.m: Idem. (Fixes Bug #12362).


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@20936 72102866-910b-0410-8b05-ffd578937521
2005-03-21 16:12:02 +00:00
Alexander Malmberg
cc5de74696 2005-01-18 16:39 Alexander Malmberg <alexander@malmberg.org>
* Source/NSBitmapImageRep.m
	(-TIFFRepresentationUsingCompression:factor:): Don't use pointer
	comparisons to compare strings. Handle both device and calibrated
	colorspaces. Warn if the colorspace isn't recognized.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@20579 72102866-910b-0410-8b05-ffd578937521
2005-01-18 15:35:51 +00:00
Fred Kiefer
5271b53ebe Some more keyed decoding.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@20216 72102866-910b-0410-8b05-ffd578937521
2004-10-10 22:36:02 +00:00
Alexander Malmberg
9cd4d1cc7f Document GSReadRect and update users.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@19801 72102866-910b-0410-8b05-ffd578937521
2004-07-30 13:58:03 +00:00
Alexander Malmberg
edc0a6f614 Remove obsolete libwraster image loading hacks.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@18533 72102866-910b-0410-8b05-ffd578937521
2004-02-03 22:42:15 +00:00
Alexander Malmberg
896c4cb1a3 Add GIF loader.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@18339 72102866-910b-0410-8b05-ffd578937521
2004-01-08 18:43:49 +00:00
Alexander Malmberg
3f7866a8ed Add new image loaders.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@18331 72102866-910b-0410-8b05-ffd578937521
2004-01-07 23:53:15 +00:00
Adam Fedor
50ed66958a Implement GSReadRect and initWithFocusedViewRect:
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17687 72102866-910b-0410-8b05-ffd578937521
2003-09-20 02:57:45 +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
Fred Kiefer
1a94f30ba2 [canInitWithData:], [imageRepsWithData:] and [initWithData:]
protect against data being nil. [imageRepsWithFile:] check if the
file exists and only return an array when it contains objects.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17591 72102866-910b-0410-8b05-ffd578937521
2003-09-01 16:58:27 +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
677b253c54 In [_initFromTIFFImage:number:] free the info returned by
NSTiffGetInfo().


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17342 72102866-910b-0410-8b05-ffd578937521
2003-07-25 22:54:28 +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
Fred Kiefer
634aafc1de In [initWithBitmapDataPlanes:...bitsPerPixel:],
[getBitmapDataPlanes:] and [copyWithZone:] changed type of i
to unsigned int.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@16887 72102866-910b-0410-8b05-ffd578937521
2003-06-08 00:26:18 +00:00
Fred Kiefer
6f303709e5 In [imageUnfilteredFileTypes] add the tiff entries always to the
front of the list. As the standard GNUstep images are in this
format, this will speed up image loading.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@16200 72102866-910b-0410-8b05-ffd578937521
2003-03-18 23:47:23 +00:00
Fred Kiefer
86711c9522 In [TIFFRepresentationUsingCompression:factor:] set extraSamples
and correct compression type if 0.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15245 72102866-910b-0410-8b05-ffd578937521
2002-12-05 00:37:01 +00:00