X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.utils.ui%2Fsrc%2Forg%2Fsimantics%2Futils%2Fui%2Fgfx%2Fclipboard%2Fheaders%2FBitmapFileHeader.java;fp=bundles%2Forg.simantics.utils.ui%2Fsrc%2Forg%2Fsimantics%2Futils%2Fui%2Fgfx%2Fclipboard%2Fheaders%2FBitmapFileHeader.java;h=5fe9a7c8fc745d6cbaf628696accaaa9f3104da5;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hp=7e38b479d39cecb575f2ceb588d77a444aab3b63;hpb=24e2b34260f219f0d1644ca7a138894980e25b14;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.utils.ui/src/org/simantics/utils/ui/gfx/clipboard/headers/BitmapFileHeader.java b/bundles/org.simantics.utils.ui/src/org/simantics/utils/ui/gfx/clipboard/headers/BitmapFileHeader.java index 7e38b479d..5fe9a7c8f 100644 --- a/bundles/org.simantics.utils.ui/src/org/simantics/utils/ui/gfx/clipboard/headers/BitmapFileHeader.java +++ b/bundles/org.simantics.utils.ui/src/org/simantics/utils/ui/gfx/clipboard/headers/BitmapFileHeader.java @@ -1,61 +1,61 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.utils.ui.gfx.clipboard.headers; - -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - - - -/** - * WIN32 API BITMAPFILEHEADER - * - * @see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_62uq.asp - * @author Marko Luukkainen - * - */ -public class BitmapFileHeader { - public short bfType; - public int bfSize; - public short bfReserved1; - public short bfReserved2; - public int bfOffBits; - public static final int sizeof = 14; - - /** - * Creates BITMAPFILEHEADER for bitmap that has - * BITMAPINFO.bmiColors field NULL / undefined - * - */ - public BitmapFileHeader() { - bfType = 'B'; - bfType <<= 8; - bfType |= (0xff & 'M'); - bfSize = 0; - bfReserved1 = 0; - bfReserved2 = 0; - bfOffBits = sizeof + BitmapInfoHeader.sizeof; - - } - - public byte[] getBytes() { - byte [] array = new byte[sizeof]; - ByteBuffer buffer = ByteBuffer.wrap(array); - buffer.order(ByteOrder.LITTLE_ENDIAN); - buffer.putShort(bfType); - buffer.putInt(bfSize); - buffer.putShort(bfReserved1); - buffer.putShort(bfReserved2); - buffer.putInt(bfOffBits); - return array; - } -} +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.utils.ui.gfx.clipboard.headers; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + + + +/** + * WIN32 API BITMAPFILEHEADER + * + * @see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_62uq.asp + * @author Marko Luukkainen + * + */ +public class BitmapFileHeader { + public short bfType; + public int bfSize; + public short bfReserved1; + public short bfReserved2; + public int bfOffBits; + public static final int sizeof = 14; + + /** + * Creates BITMAPFILEHEADER for bitmap that has + * BITMAPINFO.bmiColors field NULL / undefined + * + */ + public BitmapFileHeader() { + bfType = 'B'; + bfType <<= 8; + bfType |= (0xff & 'M'); + bfSize = 0; + bfReserved1 = 0; + bfReserved2 = 0; + bfOffBits = sizeof + BitmapInfoHeader.sizeof; + + } + + public byte[] getBytes() { + byte [] array = new byte[sizeof]; + ByteBuffer buffer = ByteBuffer.wrap(array); + buffer.order(ByteOrder.LITTLE_ENDIAN); + buffer.putShort(bfType); + buffer.putInt(bfSize); + buffer.putShort(bfReserved1); + buffer.putShort(bfReserved2); + buffer.putInt(bfOffBits); + return array; + } +}