0

Using graphics_capture_frame_buffer a GBitmap is returned. What is the format of this if I wanted to work with it directly. How would I modify a single pixel?

4

2 に答える 2

3

gbitmap_*Pebble 3.0 では、アクセサーを使用できます。

フォーマットが の場合GBitmapFormat8Bit、各ピクセルは ARGB で 1 バイト (コンポーネントあたり 2 ビット) です。

于 2015-03-03T23:33:14.510 に答える
0

これは、SDK で提供されている等尺性の例で見つかりました。そのため、ARGB をそれぞれ 2 ビットで保持する行は、一度に 1 行のピクセルごとに 1 つの uint8_t のように見えます。

#define GColorFromRGB ((GColor8){ \ .a = 3, \ .r = (uint8_t)(red) >> 6, \ .g = (uint8_t)(green) >> 6, \ .b = (uint8_t)(blue) >> 6, \ })

static void set_pixel(GPoint pixel, GColor color) {
  if(pixel.x >= 0 && pixel.x < 144 && pixel.y >= 0 && pixel.y < 168) {
    memset(&s_fb_data[(pixel.y * s_fb_size.w) + pixel.x], (uint8_t)color.argb, 1);
  }
}
于 2015-03-03T20:23:13.180 に答える