+++ /dev/null
-/**
- * @file canvas.c
- * @author Copyright(C) 2012 Shinichiro Nakamura
- */
-
-/*
- * ===============================================================
- * BlueTank
- * ===============================================================
- * Copyright (c) 2012 Shinichiro Nakamura
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use,
- * copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following
- * conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- * ===============================================================
- */
-
-#include "canvas.h"
-
-/**
- * @brief ピクセル値を書き込む。
- * @details
- * インターフェースでは、何にどのように書き込むかについて一切感知していない。
- * この関数では、何にどのように書き込むかについて解決する。
- *
- * @param x X座標。
- * @param y Y座標。
- * @param r 赤。
- * @param g 緑。
- * @param b 青。
- * @param extobj ユーザが指定した拡張オブジェクト。
- */
-void canvas_pixel_writer(const int x, const int y, const uint8_t r, const uint8_t g, const uint8_t b, void *extobj)
-{
- canvas_t *canvas = (canvas_t *)extobj;
- bmpcol_t *buffer = canvas->buffer + (canvas->w * y) + x;
- buffer->r = r;
- buffer->g = g;
- buffer->b = b;
-}
-
-/**
- * @brief ピクセル値を読み込む。
- * @details
- * インターフェースでは、何からどのように読み込むかについて一切感知していない。
- * この関数では、何からどのように読み込むかについて解決する。
- *
- * @param x X座標。
- * @param y Y座標。
- * @param r 赤。
- * @param g 緑。
- * @param b 青。
- * @param extobj ユーザが指定した拡張オブジェクト。
- */
-void canvas_pixel_reader(const int x, const int y, uint8_t *r, uint8_t *g, uint8_t *b, void *extobj)
-{
- canvas_t *canvas = (canvas_t *)extobj;
- bmpcol_t *buffer = canvas->buffer + (canvas->w * y) + x;
- *r = buffer->r;
- *g = buffer->g;
- *b = buffer->b;
-}
-
-void canvas_drawer(const int px, const int py, int on, void *extobj)
-{
- canvas_t *canvas = (canvas_t *)extobj;
- bmpcol_t *buffer = canvas->buffer + (canvas->w * py) + px;
- buffer->r = on ? 255 : 127;
- buffer->g = on ? 255 : 129;
- buffer->b = on ? 255 : 240;
-}
-