cshkit library
Reads and writes Adobe Photoshop CSH custom-shape libraries in pure Dart.
Classes
- CshCodec
- Converts CSH models to and from their binary representation.
- CshDecodeOptions
- Resource and preservation limits applied while decoding a CSH library.
- CshDecoder
-
Decodes Adobe Photoshop
cushcustom-shape libraries. - CshEncodeOptions
- Preservation and validation choices applied while encoding a CSH library.
- CshEncoder
- Encodes immutable CSH models into Photoshop custom-shape libraries.
- CshFile
- Complete decoded contents of one Adobe Photoshop custom-shape library.
- CshHierarchyEntry
-
One ordered item from a trailing Photoshop
phryhierarchy descriptor. - CshShape
- One complete vector preset from a Photoshop custom-shape library.
- CshSvgEncoder
- Converts decoded custom-shape geometry to dependency-free SVG text.
- CshWarning
- Describes a recoverable compatibility issue found while decoding.
- PsAliasValue
- Opaque length-prefixed platform alias data.
- PsBezierKnot
- One cubic Bézier knot with incoming and outgoing control handles.
- PsBezierKnotRecord
- A record containing one cubic Bézier knot.
- PsBinaryReader
- Bounds-checked big-endian input used by Photoshop format parsers.
- PsBinaryWriter
- Growable big-endian output used by the PSD writer.
- PsBooleanValue
- A one-byte descriptor Boolean.
- PsClassValue
- A Photoshop class name and identifier.
- PsDescriptor
- A Photoshop action descriptor containing ordered, typed items.
- PsDescriptorCodec
- Encodes and decodes Photoshop action descriptors.
- PsDescriptorDecodeOptions
- Resource limits applied while decoding an Action Descriptor.
- PsDescriptorEnumeration
- A Photoshop enumeration represented by its type and selected identifiers.
- PsDescriptorItem
- One keyed value inside a Photoshop action descriptor.
- PsDescriptorNumber
- A descriptor number paired with its optional Photoshop unit identifier.
- PsDescriptorValue
- Base type for Photoshop action-descriptor values.
- PsDoubleValue
- A double-precision descriptor number.
- PsEnumeratedReferenceValue
- An enumerated form inside a Photoshop object reference.
- PsEnumeratedValue
- A pair of Photoshop type and enumeration identifiers.
- PsIdentifierValue
- An integer identifier form inside a Photoshop object reference.
- PsIndexValue
- An integer index form inside a Photoshop object reference.
- PsIntegerValue
- A signed 32-bit descriptor integer.
- PsLargeIntegerValue
- A signed 64-bit descriptor integer.
- PsListValue
- An ordered list of independently typed descriptor values.
- PsNameValue
- A Unicode name form inside a Photoshop object reference.
- PsObjectArrayValue
- A descriptor-shaped object array with an explicit element count.
- PsObjectValue
- A nested action descriptor.
- PsOffsetValue
- An offset form inside a Photoshop object reference.
- PsPackBitsCodec
- Encodes and decodes the PackBits run-length format used by Photoshop.
- PsPathClipboardRecord
- A clipboard-bounds and resolution path record.
- PsPathFillRuleRecord
- A path fill-rule record, whose defined payload is normally all zeroes.
- PsPathInitialFillRecord
- The initial fill state used before applying subpath operations.
- PsPathPoint
- A two-dimensional point in Photoshop path coordinates.
- PsPathRecord
- Base type for one fixed-size Photoshop path record.
- PsPathValue
- Opaque length-prefixed Photoshop descriptor path data.
- PsPattern
- A complete Photoshop pattern record with its source planes and metadata.
- PsPatternBlockDecoder
- Decodes four-byte-aligned length-prefixed pattern records from Photoshop blocks.
- PsPatternBlockDecodeResult
- Every pattern decoded from a length-prefixed block and its retained byte cost.
- PsPatternBlockEncoder
- Encodes length-prefixed, four-byte-aligned embedded pattern records.
- PsPatternChannel
- One decoded or preserved virtual-memory channel from a Photoshop pattern.
- PsPatternChannelSlot
- One of the declared channel slots in a Photoshop virtual-memory array.
- PsPatternDecodeOptions
- Resource and preservation limits for one Photoshop pattern record.
- PsPatternDecodeResult
- One decoded pattern together with its retained uncompressed-byte cost.
- PsPatternEncodeOptions
- Preservation and validation choices applied while encoding pattern records.
- PsPatternImage
- A rendered row-major RGBA image suitable for editor integration.
- PsPatternIndexedMetadata
- The four bytes following an indexed pattern's 256-entry palette.
- PsPatternRecordDecoder
- Decodes the shared versioned pattern-record structure used by Photoshop formats.
- PsPatternRecordEncoder
- Encodes the pattern-record structure shared by PAT, ABR, ASL, and PSD data.
- PsPresetHierarchyEntry
-
One ordered item from a Photoshop
phryhierarchy descriptor. - PsPresetHierarchyMapper
-
Converts a generic Photoshop
phrydescriptor into typed hierarchy entries. - PsPresetIdentity
- The identity fields used to resolve a hierarchy entry to a preset.
- PsPropertyValue
- A property form inside a Photoshop object reference.
- PsRawValue
- Opaque length-prefixed descriptor data.
- PsRectangle
- A rectangle using Photoshop's inclusive top/left and exclusive bottom/right convention.
- PsReferenceClassValue
- A class form inside a Photoshop object reference.
- PsReferenceValue
- An ordered Photoshop object reference.
- PsRgbColor
- An eight-bit red, green, and blue color returned by a color converter.
- PsStringValue
- A UTF-16 Photoshop descriptor string.
- PsSubpath
- One open or closed contour inside a Photoshop path.
- PsSubpathLengthRecord
- A record declaring the knot count and operation of a subpath.
- PsTaggedBlock
- One Photoshop tagged block with loss-preserving source metadata.
- PsTaggedBlockCodec
- Reads, writes, and recognizes Photoshop tagged-block framing.
- PsTaggedBlockHeader
- A decoded tagged-block header whose payload has not yet been consumed.
- PsToneCurve
- An immutable Photoshop tone curve with evaluation helpers.
- PsToneCurveCodec
- Encodes and decodes count-prefixed Photoshop tone-curve point records.
- PsToneCurvePoint
- One input-to-output control point in a Photoshop tone curve.
- PsUnitFloatsValue
- A list of double-precision values sharing a Photoshop unit code.
- PsUnitFloatValue
- A double-precision number carrying a Photoshop unit code.
- PsUnknownPathRecord
- An unrecognized 26-byte Photoshop path record.
- PsVectorPath
- An ordered Photoshop path retaining every fixed-size source record.
- PsVectorPathCodec
- Encodes and decodes streams of 26-byte Photoshop path records.
- PsVersionedDescriptor
- A Photoshop Action Descriptor preceded by its 32-bit format version.
- PsVersionedDescriptorCodec
- Encodes and decodes 32-bit-versioned Photoshop Action Descriptors.
Enums
- CshDecodeMode
- Controls whether recoverable CSH compatibility issues stop decoding.
- CshEncodeMode
- Controls how strongly a CSH library is validated before encoding.
- CshHierarchyEntryKind
- Identifies the role of one slot in Photoshop's optional shape hierarchy.
- CshSvgCoordinateSpace
- Selects the coordinate system used by SVG geometry helpers.
- PsDescriptorAccessMode
- Selects whether descriptor accessors accept compatible scalar encodings.
- PsPathFillRule
- Fill rule inferred from Photoshop's subpath flags.
- PsPathOperation
- Boolean operation applied when Photoshop combines a subpath.
- PsPatternColorMode
- Identifies the Photoshop color model used by a pattern record.
- PsPatternCompression
- Identifies the storage method used by a pattern channel.
- PsPatternEncodeMode
- Controls how strongly a Photoshop pattern record is validated before encoding.
- PsPatternRecordKind
- Distinguishes standalone PAT records from length-bounded embedded records.
- PsPresetHierarchyEntryKind
- Identifies the role of one Photoshop preset-hierarchy slot.
- PsToneCurveInterpolation
- Selects how values between tone-curve control points are calculated.
Extensions
- PsDescriptorAccess on PsDescriptor
- Provides null-safe typed projections over Photoshop Action Descriptors.
- PsDescriptorValueAccess on PsDescriptorValue?
- Provides typed projections for an individual nullable descriptor value.
Constants
- psMaxExactInteger → const int
- Largest integer this platform represents exactly.
- psMinExactInteger → const int
- Smallest integer this platform represents exactly.
Typedefs
- CshBezierKnot = PsBezierKnot
- One cubic Bézier knot in a custom shape.
- CshBezierKnotRecord = PsBezierKnotRecord
- A record containing one cubic Bézier knot.
- CshPathClipboardRecord = PsPathClipboardRecord
- A custom-shape clipboard record.
- CshPathFillRule = PsPathFillRule
- Fill rule inferred from a shape contour's flags.
- CshPathFillRuleRecord = PsPathFillRuleRecord
- A custom-shape path fill-rule record.
- CshPathInitialFillRecord = PsPathInitialFillRecord
- A custom-shape initial-fill record.
- CshPathOperation = PsPathOperation
- Boolean operation applied when Photoshop combines a shape contour.
- CshPathPoint = PsPathPoint
- A point in normalized or transformed custom-shape coordinates.
- CshPathRecord = PsPathRecord
- Base type for one fixed-size custom-shape path record.
- CshRectangle = PsRectangle
- Signed reference rectangle stored by a custom-shape record.
- CshSubpath = PsSubpath
- One open or closed custom-shape contour.
- CshSubpathLengthRecord = PsSubpathLengthRecord
- A record declaring the knot count and operation of a contour.
- CshTaggedBlock = PsTaggedBlock
- Backward-compatible name for a shared Photoshop tagged block.
- CshUnknownPathRecord = PsUnknownPathRecord
- An unrecognized custom-shape path record.
- CshVectorPath = PsVectorPath
- An ordered custom-shape path retaining every decoded source record.
- PsCmykToRgbConverter = PsRgbColor Function({required double black, required double cyan, required double magenta, required double yellow})
- Converts normalized CMYK ink amounts to an eight-bit RGB color.
- PsPatternDecodedBytesGuard = void Function(int bytes, int offset)
-
Verifies that retaining
bytesdecoded bytes remains within a caller's aggregate budget. - PsPatternIssueHandler = void Function(String message, int offset)
- Receives a recoverable pattern compatibility issue and its absolute byte offset.
- PsPresetHierarchyIssueHandler = void Function(String message)
- Receives a recoverable preset-hierarchy compatibility issue.
- PsTaggedBlockWideLengthResolver = bool Function(String signature, String key)
- Determines whether one Photoshop tagged block uses a 64-bit length.
Exceptions / Errors
- CshFormatException
- Reports malformed, truncated, unsupported, or unsafe CSH input.
- CshWriteException
- Reports model data that cannot be represented by the requested CSH output.
- PsFormatException
- Reports malformed, truncated, or unsupported Photoshop-format input.
- PsWriteException
- Reports data that cannot be represented by a requested Photoshop format.