Skip to content

feat: Complete image display processing pipeline implementation#40

Open
FlowingSPDG wants to merge 1 commit intomainfrom
feature/image-display-processing
Open

feat: Complete image display processing pipeline implementation#40
FlowingSPDG wants to merge 1 commit intomainfrom
feature/image-display-processing

Conversation

@FlowingSPDG
Copy link
Owner

Summary

This PR implements the complete image display processing pipeline as specified in the implementation plan.

Changes

Core Features

  • BGR→RGB conversion: Full support for V1 protocol (BMP format) with BGR color order
  • Image transformations: Integrated rotation (270°) and flip (horizontal/vertical) transformations
  • Device configuration: Automatic transformation parameter detection from device settings
  • Streaming processing: Memory-efficient pixel processing to avoid large buffer allocation

Technical Improvements

  • Memory optimization: On-the-fly pixel processing during transformation avoids IMAGE_BUFFER_SIZE (1024 bytes) limitations
  • Error handling: Enhanced format validation, size checks, and detailed warning messages
  • Code organization: Clean separation of concerns with dedicated helper functions

Implementation Details

Transformation Pipeline

USB受信 → プロトコルパース → BMPヘッダースキップ → BGR→RGB変換 → 画像変換(回転/反転) → RGB565変換 → ディスプレイ出力

Device-Specific Transformations

  • V1 Mini: BGR→RGB + 270° rotation (clockwise)
  • V1 Original: BGR→RGB + horizontal flip
  • V2 devices: Device-specific transformations from DisplayConfig

Memory Efficiency

  • Uses streaming pixel processing: process_and_send_pixels_streaming()
  • Avoids allocating large buffers by processing pixels on-the-fly
  • Calculates source pixel positions during transformation, eliminating need for full image buffer

Testing

  • ✅ Compiles successfully
  • ✅ No linter errors
  • ⏳ Hardware testing required (V1 protocol with Mini device)

Related

Implements Phase 1 of image display functionality plan.
Future work: JPEG decoding support for V2 protocol devices.

- Add BGR to RGB conversion for V1 protocol (BMP format)
- Integrate image transformations (rotation, flip) from protocol module
- Implement streaming pixel processing to avoid large buffer allocation
- Add device configuration-based transformation parameters
- Enhance error handling with format validation and size checks
- Support device-specific transformations: 270° rotation, horizontal/vertical flip

Implements Phase 1 of the image display functionality plan:
- V1 devices (Mini): BGR→RGB + 270° rotation
- V1 devices (Original): BGR→RGB + horizontal flip
- V2 devices: Device-specific transformations as configured

Memory optimization: Process pixels on-the-fly during transformation
to avoid IMAGE_BUFFER_SIZE limitations.
@FlowingSPDG
Copy link
Owner Author

実機でのテストが必要
通り次第マージする

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant