| 1 | /* |
| 2 | * $Id: BITMAPINFOHEADER.java,v 1.1.1.5 2004/05/25 20:23:20 hastings Exp $ |
| 3 | * |
| 4 | * (c) Copyright, Moebius Solutions, Inc., 2004 |
| 5 | * |
| 6 | * All Rights Reserved |
| 7 | * |
| 8 | * This material may be reproduced by or for the U. S. Government |
| 9 | * pursuant to the copyright license under the clause at |
| 10 | * DFARS 252.227-7014 (OCT 2001). |
| 11 | */ |
| 12 | |
| 13 | package com.moesol.bindings.platform_sdk.windows_api; |
| 14 | |
| 15 | import com.moesol.bindings.*; |
| 16 | |
| 17 | /** |
| 18 | * @author Robert Hastings |
| 19 | */ |
| 20 | public class BITMAPINFOHEADER extends NativeStructure { |
| 21 | // BITMAPINFOHEADER |
| 22 | public static int sizeof() { |
| 23 | return 40; |
| 24 | } |
| 25 | public void set_biSize(int v) { |
| 26 | putInt(0, v); |
| 27 | } |
| 28 | public int get_biSize() { |
| 29 | return getInt(0); |
| 30 | } |
| 31 | public void set_biWidth(int v) { |
| 32 | putInt(4, v); |
| 33 | } |
| 34 | public int get_biWidth() { |
| 35 | return getInt(4); |
| 36 | } |
| 37 | public void set_biHeight(int v) { |
| 38 | putInt(8, v); |
| 39 | } |
| 40 | public int get_biHeight() { |
| 41 | return getInt(8); |
| 42 | } |
| 43 | public void set_biPlanes(short v) { |
| 44 | putShort(12, v); |
| 45 | } |
| 46 | public short get_biPlanes() { |
| 47 | return getShort(12); |
| 48 | } |
| 49 | public void set_biBitCount(short v) { |
| 50 | putShort(14, v); |
| 51 | } |
| 52 | public short get_biBitCount() { |
| 53 | return getShort(14); |
| 54 | } |
| 55 | public void set_biCompression(int v) { |
| 56 | putInt(16, v); |
| 57 | } |
| 58 | public int get_biCompression() { |
| 59 | return getInt(16); |
| 60 | } |
| 61 | public void set_biSizeImage(int v) { |
| 62 | putInt(20, v); |
| 63 | } |
| 64 | public int get_biSizeImage() { |
| 65 | return getInt(20); |
| 66 | } |
| 67 | public void set_biXPelsPerMeter(int v) { |
| 68 | putInt(24, v); |
| 69 | } |
| 70 | public int get_biXPelsPerMeter() { |
| 71 | return getInt(24); |
| 72 | } |
| 73 | public void set_biYPelsPerMeter(int v) { |
| 74 | putInt(28, v); |
| 75 | } |
| 76 | public int get_biYPelsPerMeter() { |
| 77 | return getInt(28); |
| 78 | } |
| 79 | public void set_biClrUsed(int v) { |
| 80 | putInt(32, v); |
| 81 | } |
| 82 | public int get_biClrUsed() { |
| 83 | return getInt(32); |
| 84 | } |
| 85 | public void set_biClrImportant(int v) { |
| 86 | putInt(36, v); |
| 87 | } |
| 88 | public int get_biClrImportant() { |
| 89 | return getInt(36); |
| 90 | } |
| 91 | // BEGIN_KEEP |
| 92 | public BITMAPINFOHEADER() { |
| 93 | super(new byte[sizeof()]); |
| 94 | } |
| 95 | public BITMAPINFOHEADER(byte[] bytes) { |
| 96 | super(bytes); |
| 97 | assert(bytes.length >= sizeof()); |
| 98 | } |
| 99 | public static final int BI_RGB = 0; |
| 100 | public static final int BI_RLE8 = 1; |
| 101 | public static final int BI_RLE4 = 2; |
| 102 | public static final int BI_BITFIELDS = 3; |
| 103 | |
| 104 | |
| 105 | boolean verify_biSize(int v) { |
| 106 | return jni_verify_biSize(_getStructureBytes(), v); |
| 107 | } |
| 108 | boolean verify_biPlanes(short v) { |
| 109 | return jni_verify_biPlanes(_getStructureBytes(), v); |
| 110 | } |
| 111 | boolean verify_biYPelsPerMeter(int v) { |
| 112 | return jni_verify_biYPelsPerMeter(_getStructureBytes(), v); |
| 113 | } |
| 114 | boolean verify_biClrImportant(int v) { |
| 115 | return jni_verify_biClrImportant(_getStructureBytes(), v); |
| 116 | } |
| 117 | |
| 118 | static { |
| 119 | NativeLibraryLoader.loadLibrary("com_moesol_bindings"); |
| 120 | } |
| 121 | private static native boolean jni_verify_biSize(byte[] bytes, int v); |
| 122 | private static native boolean jni_verify_biPlanes(byte[] bytes, short v); |
| 123 | private static native boolean jni_verify_biYPelsPerMeter(byte[] bytes, int v); |
| 124 | private static native boolean jni_verify_biClrImportant(byte[] bytes, int v); |
| 125 | // END_KEEP |
| 126 | } |