Core Plot (macOS)
Cocoa plotting framework for macOS, iOS, and tvOS
CPTMutableNumericData Class Reference

An annotated NSMutableData type. More...

#import <CPTMutableNumericData.h>

+ Inheritance diagram for CPTMutableNumericData:
+ Collaboration diagram for CPTMutableNumericData:

Public Instance Methods

Samples
(nullable void *) - mutableSamplePointer:
 Gets a pointer to a given sample in the data buffer. More...
 
(nullable void *) - mutableSamplePointerAtIndex:
 Gets a pointer to a given sample in the data buffer. More...
 
Type Conversion
(void) - convertToType:sampleBytes:byteOrder:
 Converts the current numeric data to a new data type. More...
 
- Public Instance Methods inherited from CPTNumericData
(nonnull instancetype) - initWithData:dataType:shape:
 Initializes a newly allocated CPTNumericData object with the provided data. More...
 
(nonnull instancetype) - initWithData:dataTypeString:shape:
 Initializes a newly allocated CPTNumericData object with the provided data. More...
 
(nonnull instancetype) - initWithArray:dataType:shape:
 Initializes a newly allocated CPTNumericData object with the provided data. More...
 
(nonnull instancetype) - initWithArray:dataTypeString:shape:
 Initializes a newly allocated CPTNumericData object with the provided data. More...
 
(nonnull instancetype) - initWithData:dataType:shape:dataOrder:
 Initializes a newly allocated CPTNumericData object with the provided data. This is the designated initializer. More...
 
(nonnull instancetype) - initWithData:dataTypeString:shape:dataOrder:
 Initializes a newly allocated CPTNumericData object with the provided data. More...
 
(nonnull instancetype) - initWithArray:dataType:shape:dataOrder:
 Initializes a newly allocated CPTNumericData object with the provided data. More...
 
(nonnull instancetype) - initWithArray:dataTypeString:shape:dataOrder:
 Initializes a newly allocated CPTNumericData object with the provided data. More...
 
(nullable instancetype) - initWithCoder:
 Returns an object initialized from data in a given unarchiver. More...
 
(NSUInteger- sampleIndex:
 Gets the offset of a given sample in the data buffer. More...
 
(nullable const void *) - samplePointer:
 Gets a pointer to a given sample in the data buffer. More...
 
(nullable const void *) - samplePointerAtIndex:
 Gets a pointer to a given sample in the data buffer. More...
 
(nullable NSNumber *) - sampleValue:
 Gets the value of a given sample in the data buffer. More...
 
(nullable NSNumber *) - sampleValueAtIndex:
 Gets the value of a given sample in the data buffer. More...
 
(nonnull CPTNumberArray *) - sampleArray
 Gets an array data samples from the receiver. More...
 
(nonnull CPTNumericData *) - dataByConvertingToDataType:
 Copies the current numeric data and converts the data to a new data type. More...
 
(nonnull CPTNumericData *) - dataByConvertingToType:sampleBytes:byteOrder:
 Copies the current numeric data and converts the data to a new data type. More...
 
(void) - convertData:dataType:toData:dataType:
 Copies a data buffer and converts the data to a new data type without changing the byte order. More...
 
(void) - swapByteOrderForData:sampleSize:
 Swaps the byte order for each sample stored in a data buffer. More...
 
- Public Instance Methods inherited from NSObject
(Class- classForCoder
 
(id- copy
 
(void) - dealloc
 
(void) - finalize
 
(id- init
 
(id- mutableCopy
 
- Public Instance Methods inherited from <NSObject>
(NSString *) - description
 
(NSUInteger- hash
 
(BOOL- isEqual:
 
- Public Instance Methods inherited from <NSKeyValueBindingCreation>
(NSArray *) - exposedBindings
 
(Class- valueClassForBinding:
 
(void) - bind:toObject:withKeyPath:options:
 
(NSArray *) - optionDescriptionsForBinding:
 
(NSDictionary *) - infoForBinding:
 
(void) - unbind:
 
- Public Instance Methods inherited from <NSCopying>
(id- copyWithZone:
 
- Public Instance Methods inherited from <NSMutableCopying>
(id- mutableCopyWithZone:
 
- Public Instance Methods inherited from <NSCoding>
(id- initWithCoder:
 
(void) - encodeWithCoder:
 

Properties

Data Buffer
void * mutableBytes
 Returns a pointer to the data buffer’s contents. More...
 
Dimensions
CPTNumberArrayshape
 The shape of the data buffer array. Set a new shape to change the size of the data buffer. More...
 
Data Format
CPTNumericDataType dataType
 The type of data stored in the data buffer. More...
 
CPTDataTypeFormat dataTypeFormat
 The format of the data stored in the data buffer. More...
 
size_t sampleBytes
 The number of bytes in a single sample of data. More...
 
CFByteOrder byteOrder
 The byte order used to store each sample in the data buffer. More...
 
- Properties inherited from CPTNumericData
NSDatadata
 The data buffer. More...
 
const void * bytes
 Returns a pointer to the data buffer’s contents. More...
 
NSUInteger length
 Returns the number of bytes contained in the data buffer. More...
 
CPTNumericDataType dataType
 The type of data stored in the data buffer. More...
 
CPTDataTypeFormat dataTypeFormat
 The format of the data stored in the data buffer. More...
 
size_t sampleBytes
 The number of bytes in a single sample of data. More...
 
CFByteOrder byteOrder
 The byte order used to store each sample in the data buffer. More...
 
CPTNumberArrayshape
 The shape of the data buffer array. More...
 
NSUInteger numberOfDimensions
 The number dimensions in the data buffer array. More...
 
NSUInteger numberOfSamples
 The number of samples of dataType stored in the data buffer. More...
 
CPTDataOrder dataOrder
 The order that numbers are stored in a multi-dimensional data array. More...
 

Additional Inherited Members

- Public Class Methods inherited from CPTNumericData
(nonnull instancetype) + numericDataWithData:dataType:shape:
 Creates and returns a new CPTNumericData instance. More...
 
(nonnull instancetype) + numericDataWithData:dataTypeString:shape:
 Creates and returns a new CPTNumericData instance. More...
 
(nonnull instancetype) + numericDataWithArray:dataType:shape:
 Creates and returns a new CPTNumericData instance. More...
 
(nonnull instancetype) + numericDataWithArray:dataTypeString:shape:
 Creates and returns a new CPTNumericData instance. More...
 
(nonnull instancetype) + numericDataWithData:dataType:shape:dataOrder:
 Creates and returns a new CPTNumericData instance. More...
 
(nonnull instancetype) + numericDataWithData:dataTypeString:shape:dataOrder:
 Creates and returns a new CPTNumericData instance. More...
 
(nonnull instancetype) + numericDataWithArray:dataType:shape:dataOrder:
 Creates and returns a new CPTNumericData instance. More...
 
(nonnull instancetype) + numericDataWithArray:dataTypeString:shape:dataOrder:
 Creates and returns a new CPTNumericData instance. More...
 
- Public Class Methods inherited from NSObject
(id+ alloc
 
(Class+ class
 
(void) + initialize
 
(void) + load
 
(id+ new
 
- Public Class Methods inherited from <NSKeyValueBindingCreation>
(void) + exposeBinding:
 
- Public Class Methods inherited from <NSSecureCoding>
(BOOL+ supportsSecureCoding:
 

Detailed Description

An annotated NSMutableData type.

CPTNumericData combines a mutable data buffer with information about the data (shape, data type, size, etc.). The data is assumed to be an array of one or more dimensions of a single type of numeric data. Each numeric value in the array, which can be more than one byte in size, is referred to as a “sample”. The structure of this object is similar to the NumPy ndarray object.

Method Documentation

◆ convertToType:sampleBytes:byteOrder:

- (void) convertToType: (CPTDataTypeFormat newDataType
sampleBytes: (size_t)  newSampleBytes
byteOrder: (CFByteOrder newByteOrder 

Converts the current numeric data to a new data type.

Parameters
newDataTypeThe new data type format.
newSampleBytesThe number of bytes used to store each sample.
newByteOrderThe new byte order.

Provided by category CPTMutableNumericData(TypeConversion).

◆ mutableSamplePointer:

- (nullable void *) mutableSamplePointer: (NSUInteger sample

Gets a pointer to a given sample in the data buffer.

Parameters
sampleThe zero-based index into the sample array. The array is treated as if it only has one dimension.
Returns
A pointer to the sample or NULL if the sample index is out of bounds.

◆ mutableSamplePointerAtIndex:

- (nullable void *) mutableSamplePointerAtIndex: (NSUInteger idx
,   ... 

Gets a pointer to a given sample in the data buffer.

Parameters
idxThe zero-based indices into a multi-dimensional sample array. Each index should of type NSUInteger and the number of indices (including idx) should match the numberOfDimensions.
Returns
A pointer to the sample or NULL if any of the sample indices are out of bounds.

Property Documentation

◆ byteOrder

- (CFByteOrder) byteOrder
readwritenonatomicassign

The byte order used to store each sample in the data buffer.

Provided by category CPTMutableNumericData(TypeConversion).

◆ dataType

- (CPTNumericDataType) dataType
readwritenonatomicassign

The type of data stored in the data buffer.

Provided by category CPTMutableNumericData(TypeConversion).

◆ dataTypeFormat

- (CPTDataTypeFormat) dataTypeFormat
readwritenonatomicassign

The format of the data stored in the data buffer.

Provided by category CPTMutableNumericData(TypeConversion).

◆ mutableBytes

- (nonnull void *) mutableBytes
readnonatomicassign

Returns a pointer to the data buffer’s contents.

◆ sampleBytes

- (size_t) sampleBytes
readwritenonatomicassign

The number of bytes in a single sample of data.

Provided by category CPTMutableNumericData(TypeConversion).

◆ shape

- (nonnull CPTNumberArray *) shape
readwritenonatomiccopy

The shape of the data buffer array. Set a new shape to change the size of the data buffer.

The shape describes the dimensions of the sample array stored in the data buffer. Each entry in the shape array represents the size of the corresponding array dimension and should be an unsigned integer encoded in an instance of NSNumber.


The documentation for this class was generated from the following files: