.bmp フォーマットを .tif フォーマット(今回は特に FAX にも使われる TIFF-F)に変換するプログラムを書いて下さい。
.bmp ファイルはすでに 2 値化されているものとします。2 値化については以下で取り扱っています。
https://gist.github.com/satoyuichi/faf4b22d3038abbd895b2893fb26e237
TIFF-F の仕様は以下を参照して下さい。
.bmp フォーマットを .tif フォーマット(今回は特に FAX にも使われる TIFF-F)に変換するプログラムを書いて下さい。
.bmp ファイルはすでに 2 値化されているものとします。2 値化については以下で取り扱っています。
https://gist.github.com/satoyuichi/faf4b22d3038abbd895b2893fb26e237
TIFF-F の仕様は以下を参照して下さい。
.bmp ファイルを読み込んで、2 値画像(白、黒のみ)の新たな .bmp ファイルとして出力して下さい。
.bmp の形式は以下で取り扱ったものとします。 https://gist.github.com/satoyuichi/9bd2febd63756dcf77426b6ded6a6e42
.bmp 形式で画像ファイルを出力するプログラムを作成して下さい。ただし、画像を扱うライブラリなどは用いずバイナリデータ出力してください。 画像の内容は任意ですが、国旗のようなものが取り組みやすいと思います。
ファイルフォーマットは次の記事を参考にして下さい。 Windows、OS/2の2種類があるので、 Windows とします。 http://www.umekkii.jp/data/computer/file_format/bitmap.cgi
'use strict'; | |
const http = require('http'); | |
const pug = require('pug'); | |
const mysql = require('promise-mysql'); | |
const DB_NAME = 'enquetes'; | |
const DB_USER = 'y_sato'; | |
const DB_PASSWD = '!Qaz2wsx'; | |
const server = http.createServer((req, res) => { |
doctype html | |
html(lang="ja") | |
head | |
meta(charset="UTF-8") | |
title アンケート | |
body | |
h1 日時: #{date} | |
h1 #{food_menu} が | |
h1 #{quantity} 人前注文されました |
doctype html | |
html(lang="ja") | |
head | |
meta(charset="UTF-8") | |
title ログ | |
body | |
h1 ログ | |
table | |
tbody | |
each val in order_array |
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>アンケート</title> | |
</head> | |
<body> | |
<h1>どちらが食べたいですか?</h1> |
'use strict'; | |
const http = require('http'); | |
const pug = require('pug'); | |
const server = http.createServer((req, res) => { | |
const now = new Date(); | |
console.info('[' + now + '] Requested by ' + req.connection.remoteAddress); | |
res.writeHead(200, { | |
'Content-Type': 'text/html; charset=utf-8' | |
}); |
'use strict'; | |
const http = require('http'); | |
const server = http.createServer((req, res) => { | |
const now = new Date(); | |
console.info('[' + now + '] Requested by ' + req.connection.remoteAddress); | |
res.writeHead(200, { | |
'Content-Type': 'text/html; charset=utf-8' | |
}); | |
switch (req.method) { |