You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PICF.java 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /* ====================================================================
  2. Licensed to the Apache Software Foundation (ASF) under one or more
  3. contributor license agreements. See the NOTICE file distributed with
  4. this work for additional information regarding copyright ownership.
  5. The ASF licenses this file to You under the Apache License, Version 2.0
  6. (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. ==================================================================== */
  15. package org.apache.poi.hwpf.model;
  16. import java.util.Arrays;
  17. import org.apache.poi.hwpf.model.types.PICFAbstractType;
  18. import org.apache.poi.util.Internal;
  19. /**
  20. * The PICF structure specifies the type of a picture, as well as the size of
  21. * the picture and information about its border.
  22. * <p>
  23. * Class and fields descriptions are quoted from Microsoft Office Word 97-2007
  24. * Binary File Format and [MS-DOC] - v20110608 Word (.doc) Binary File Format
  25. *
  26. * @author Sergey Vladimirov (vlsergey {at} gmail {dot} com)
  27. */
  28. @Internal
  29. public class PICF extends PICFAbstractType
  30. {
  31. public PICF()
  32. {
  33. }
  34. public PICF( byte[] std, int offset )
  35. {
  36. fillFields( std, offset );
  37. }
  38. @Override
  39. public boolean equals( Object obj )
  40. {
  41. if ( this == obj )
  42. return true;
  43. if ( obj == null )
  44. return false;
  45. if ( getClass() != obj.getClass() )
  46. return false;
  47. PICF other = (PICF) obj;
  48. if ( field_10_padding2 != other.field_10_padding2 )
  49. return false;
  50. if ( field_11_dxaGoal != other.field_11_dxaGoal )
  51. return false;
  52. if ( field_12_dyaGoal != other.field_12_dyaGoal )
  53. return false;
  54. if ( field_13_mx != other.field_13_mx )
  55. return false;
  56. if ( field_14_my != other.field_14_my )
  57. return false;
  58. if ( field_15_dxaReserved1 != other.field_15_dxaReserved1 )
  59. return false;
  60. if ( field_16_dyaReserved1 != other.field_16_dyaReserved1 )
  61. return false;
  62. if ( field_17_dxaReserved2 != other.field_17_dxaReserved2 )
  63. return false;
  64. if ( field_18_dyaReserved2 != other.field_18_dyaReserved2 )
  65. return false;
  66. if ( field_19_fReserved != other.field_19_fReserved )
  67. return false;
  68. if ( field_1_lcb != other.field_1_lcb )
  69. return false;
  70. if ( field_20_bpp != other.field_20_bpp )
  71. return false;
  72. if ( !Arrays.equals( field_21_brcTop80, other.field_21_brcTop80 ) )
  73. return false;
  74. if ( !Arrays.equals( field_22_brcLeft80, other.field_22_brcLeft80 ) )
  75. return false;
  76. if ( !Arrays.equals( field_23_brcBottom80, other.field_23_brcBottom80 ) )
  77. return false;
  78. if ( !Arrays.equals( field_24_brcRight80, other.field_24_brcRight80 ) )
  79. return false;
  80. if ( field_25_dxaReserved3 != other.field_25_dxaReserved3 )
  81. return false;
  82. if ( field_26_dyaReserved3 != other.field_26_dyaReserved3 )
  83. return false;
  84. if ( field_27_cProps != other.field_27_cProps )
  85. return false;
  86. if ( field_2_cbHeader != other.field_2_cbHeader )
  87. return false;
  88. if ( field_3_mm != other.field_3_mm )
  89. return false;
  90. if ( field_4_xExt != other.field_4_xExt )
  91. return false;
  92. if ( field_5_yExt != other.field_5_yExt )
  93. return false;
  94. if ( field_6_swHMF != other.field_6_swHMF )
  95. return false;
  96. if ( field_7_grf != other.field_7_grf )
  97. return false;
  98. if ( field_8_padding != other.field_8_padding )
  99. return false;
  100. if ( field_9_mmPM != other.field_9_mmPM )
  101. return false;
  102. return true;
  103. }
  104. @Override
  105. public int hashCode() {
  106. return Arrays.deepHashCode(new Object[]{field_1_lcb, field_2_cbHeader, field_3_mm, field_4_xExt, field_5_yExt,
  107. field_6_swHMF, field_7_grf, field_8_padding, field_9_mmPM, field_10_padding2, field_11_dxaGoal,
  108. field_12_dyaGoal, field_13_mx, field_14_my, field_15_dxaReserved1, field_16_dyaReserved1, field_17_dxaReserved2,
  109. field_18_dyaReserved2, field_19_fReserved, field_20_bpp, field_21_brcTop80, field_22_brcLeft80,
  110. field_23_brcBottom80, field_24_brcRight80, field_25_dxaReserved3, field_26_dyaReserved3, field_27_cProps});
  111. }
  112. }