structUpdateFrameCount method

  1. @override
void structUpdateFrameCount(
  1. int frameCount
)
override

Updates frameCount and resynchronizes frame-dependent memory state.

This must be used when native decoders determine the frame count after allocation/loading (for example animated GIF decoding), because changing frameCount affects derived memory layout such as dataLength.

This is separate from directly assigning frameCount because platform implementations may need to refresh internal views or buffers after the frame count changes.

Implementation

@override
void structUpdateFrameCount(int frameCount) => structOnOp((p) {
  if (this.frameCount != frameCount) {
    this.frameCount = frameCount;
    structSyncFromMemory();
  }
});