DrawKit
Vector and illustration framework for Mac OS X
Instance Methods | Protected Attributes | List of all members
DKColourQuantizer Class Reference

generic interface and simple quantizer which performs uniform quantization. More...

Inheritance diagram for DKColourQuantizer:
Inheritance graph
[legend]

Instance Methods

(void) - analyse:
 
(NSColor *) - colourForIndex:
 
(NSArray *) - colourTable
 
(NSUInteger- indexForRGB:
 
(id- initWithBitmapImageRep:maxColours:colourBits:
 
(NSInteger- numberOfColours
 
- Instance Methods inherited from NSObject
(NSString *) - address
 
(DKStyleRegistry *) - applicationWillReturnStyleRegistry
 
(BOOL- canBeUsedWithSelectionTool
 
(id- categoryManager:shouldReplaceObject:withObject:
 
(Class- classForCoder
 
(NSColor *) - colorValue
 
(NSColor *) - colourValue
 
(id- copy
 
(void) - dealloc
 
(id- deepCopy
 
(NSDictionary *) - dimensionValuesForArrowStroke:
 
(CGFloat- drawing:convertDistanceToExternalCoordinates:
 
(NSPoint) - drawing:convertLocationToExternalCoordinates:
 
(void) - drawing:didDrawRect:inView:
 
(void) - drawing:willDrawRect:inView:
 
(NSString *) - drawing:willReturnAbbreviationForUnit:
 
(NSString *) - drawing:willReturnFormattedCoordinateForDistance:
 
(CGFloat- drawingWillReturnUnitToPointsConversonFactor:
 
(void) - finalize
 
(NSString *) - hexString
 
(void) - hotspot:didEndTrackingWithEvent:inView:
 
(void) - hotspot:isTrackingWithEvent:inView:
 
(void) - hotspot:willBeginTrackingWithEvent:inView:
 
(NSData *) - imageData
 
(NSImage *) - imageResourceNamed:
 
(id- init
 
(id- initWithExpression:
 
(id- instantiateObjectWithShortName:parameters:
 
(BOOL- isLiteralValue
 
(void) - layoutManager:willPlaceGlyphAtIndex:atLocation:pathAngle:yOffset:
 
(void) - menuItem:wasAddedForObject:inCategory:
 
(BOOL- moveObjectTo:position:slope:userInfo:
 
(id- mutableCopy
 
(void) - oneShotComplete
 
(void) - oneShotHasReached:
 
(void) - oneShotWillBegin
 
(void) - path:elementIndex:type:points:subPathIndex:subPathClosed:contextInfo:
 
(id- placeLinkFromPoint:toPoint:onPath:linkNumber:userInfo:
 
(id- placeObjectAtPoint:onPath:position:slope:userInfo:
 
(NSPoint) - point
 
(NSPoint) - pointForTextLayout
 
(DKStyle *) - registry:shouldReplaceStyle:withStyle:
 
(NSBezierPath *) - renderer:willRenderPath:
 
(void) - routeFinder:progressHasReached:
 
(void) - setValue:forNumericParameter:
 
(NSString *) - stringValue
 
(CGFloat- taperFactorAtDistance:onPath:ofLength:
 
(void) - toolDidPerformUndoableAction:
 
(void) - toolWillPerformUndoableAction:
 
(NSURL *) - url
 
- Instance Methods inherited from <NSObject>
(NSString *) - description
 
(NSUInteger- hash
 
(BOOL- isEqual:
 
- Instance Methods inherited from <NSKeyValueBindingCreation>
(void) - bind:toObject:withKeyPath:options:
 
(NSArray *) - exposedBindings
 
(NSDictionary *) - infoForBinding:
 
(NSArray *) - optionDescriptionsForBinding:
 
(void) - unbind:
 
(Class- valueClassForBinding:
 

Protected Attributes

NSMutableArraym_cTable
 
NSSize m_imageSize
 
NSUInteger m_maxColours
 
NSUInteger m_nBits
 

Additional Inherited Members

- Class Methods inherited from NSObject
(id+ alloc
 
(Class+ class
 
(void) + initialize
 
(void) + load
 
(id+ new
 
- Class Methods inherited from <NSKeyValueBindingCreation>
(void) + exposeBinding:
 

Detailed Description

generic interface and simple quantizer which performs uniform quantization.

Author
Contributions from the community; see CONTRIBUTORS.md
Date
2005-2015

s Results with this quantizer are generally only barely acceptable - colours may be mapped to something grossly different from the original since this does not take any notice of the pixels actually used in the image, only the basic size of the RGB colour space it is given.

See also
DKOctreeQuantizer

Method Documentation

- (void) analyse: (NSBitmapImageRep *)  rep
- (NSColor*) colourForIndex: (NSUInteger index
- (NSArray*) colourTable
- (NSUInteger) indexForRGB: (NSUInteger[])  rgb
- (id) initWithBitmapImageRep: (NSBitmapImageRep *)  rep
maxColours: (NSUInteger maxColours
colourBits: (NSUInteger nBits 
- (NSInteger) numberOfColours

Member Data Documentation

- (NSMutableArray*) m_cTable
protected
- (NSSize) m_imageSize
protected
- (NSUInteger) m_maxColours
protected
- (NSUInteger) m_nBits
protected