Commit graph

83 commits

Author SHA1 Message Date
fredkiefer
13adade3a8 Correct problems found by valgrind.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36188 72102866-910b-0410-8b05-ffd578937521
2013-02-22 15:39:29 +00:00
fredkiefer
a4abfc354f 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
fredkiefer
54babc9b33 * 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
fredkiefer
05514b6ac5 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
fredkiefer
e278d9956c 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
fredkiefer
953db32805 * 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
ericwa
bc71005837 * 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
fredkiefer
5c93b41e6d 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
theraven
663aedd69e 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
ericwa
61b0a0ae7b * 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
theraven
dbd4c1b77c 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
fredkiefer
a2088a66a9 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
ericwa
cb94c73601 * 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
fredkiefer
8cf1cd3bab 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
rfm
fed6ff1796 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
fredkiefer
e64aca8bb2 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
fredkiefer
b712698565 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
fredkiefer
5dfc9be420 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
fredkiefer
ce9fd723d0 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
fredkiefer
b0608fc6c7 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
gcasa
4101e432aa * 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
fedor
ce41d782c1 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
fredkiefer
eb32df9161 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
fredkiefer
1a100f8b80 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
fredkiefer
9e7fde1f92 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
fredkiefer
b7699665db 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
fredkiefer
e25cceb710 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
fredkiefer
383d95dc44 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
rfm
6f754401c4 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
tracy454
13cf685b28 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
tracy454
fe851e6710 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
rfm
cc3cafa874 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
gcasa
1a8528922e 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_
3b5502ffa8 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
fedor
db3c52eab8 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
fedor
14d484f4a7 * 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
alexm
6bc257820a 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
FredKiefer
45b6e203cd 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
alexm
3c759b846c 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
alexm
c172a7ed18 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
alexm
15d198201b 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
alexm
20190d5c10 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
fedor
bfe2bdb1f2 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
fedor
bfc26f3c85 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
FredKiefer
c172aac0ad [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
ayers
9732999fd8 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
FredKiefer
8a0dd746ba 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
fedor
fc402789db 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
FredKiefer
d02bdec0cf 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
FredKiefer
e59a6eb372 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